[LM] trying to add linkmaster support


Subject: [LM] trying to add linkmaster support
From: Tom Dyas (tdyas@vger.rutgers.edu)
Date: Thu Sep 16 1999 - 18:23:34 EDT


If any of you LinkMaster guys could take a look at what I am doing wrong,
I would be grateful. URL is:

  ftp://vger.rutgers.edu/pub/users/tdyas/db/db-linkmaster.tar.gz

When I try to follow a link, it crashes in PilotMain() soon after the
DbgPrintF("follow link") at line 244 of main.c.

Oh, to build DB, you need the attached patch againt pilrc 2.4.

Thanks in advance for any help you can provide!

Tom

------------------------------------------------------------------------
It pays to be early to class…then you can watch the CUTE ones come in.
Find out what's hot at Talk City's back to school site.
Chat, games, fashion, prizes. http://clickhere.egroups.com/click/900

eGroups.com home: http://www.egroups.com/group/linkmaster
http://www.egroups.com - Simplifying group communications

--- pilrc.c.ORIG Thu Jul 1 09:58:08 1999
+++ pilrc.c Sat Jul 31 01:13:32 1999
@@ -86,6 +86,19 @@
 int iline;
 char szLine[4096];
 
+/* support for including files */
+
+#define MAX_INCLUDE_DEPTH 10
+
+typedef struct {
+ FILE * fp;
+ int line;
+ char fname[256];
+} INCSTACKENT;
+
+INCSTACKENT incStack[MAX_INCLUDE_DEPTH];
+int incStackNum;
+
 
 /* Rect for Prev* keywords */
 RCRECT rcPrev;
@@ -254,12 +267,32 @@
 
         retval = fFalse;
 
+ retry:
         szLine[0] = '\0'; /* just in case there is nothing to be gotten */
         if (fgets(szLine, sizeof(szLine), vfhIn) != NULL)
                 {
                 iline++;
                 retval = fTrue;
                 }
+ else
+ {
+ extern char szInFile[];
+
+ if (incStackNum > 0)
+ {
+ /* close current file */
+ fclose(vfhIn);
+
+ /* pop the stack */
+ incStackNum--;
+ strcpy(szInFile, incStack[incStackNum].fname);
+ vfhIn = incStack[incStackNum].fp;
+ iline = incStack[incStackNum].line;
+
+ /* go back and pretend we didn't switch files :) */
+ goto retry;
+ }
+ }
         FInitLexer(szLine, fTrue); /* so program can shut down gracefully */
 
         return(retval);
@@ -2619,6 +2652,7 @@
 
         strcpy( szInFile, FindAndOpenFile( szIn, "rt", &vfhIn ));
         iline = 0;
+ incStackNum = 0;
         }
 
 /*-----------------------------------------------------------------------------
@@ -2815,6 +2849,27 @@
                         {
                         ParseJavaInclude(szFileName);
                         }
+ else if (FSzEqI(pchExt, "rcp"))
+ {
+ extern char szInFile[];
+
+ if (incStackNum + 1 >= MAX_INCLUDE_DEPTH)
+ {
+ ErrorLine("too many include files");
+ return;
+ }
+
+ /* put current file on the stack */
+ incStack[incStackNum].fp = vfhIn;
+ incStack[incStackNum].line = iline;
+ strcpy(incStack[incStackNum].fname, szInFile);
+ incStackNum++;
+
+ /* open the include file */
+ strcpy(szInFile, FindAndOpenFile(szFileName, "rt",
+ &vfhIn));
+ iline = 0;
+ }
                 else
                         {
                         ParseCInclude(szFileName);

------------------------------------------------------------------------
It pays to be early to class…then you can watch the CUTE ones come in.
Find out what's hot at Talk City's back to school site.
Chat, games, fashion, prizes. http://clickhere.egroups.com/click/900

eGroups.com home: http://www.egroups.com/group/linkmaster
http://www.egroups.com - Simplifying group communications



This archive was generated by hypermail 2b25 : Tue Sep 05 2000 - 22:09:10 EDT