[LON-CAPA-cvs] cvs: modules /TexConvert/tthdynamic tthfunc.c

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 09 Nov 2002 21:48:20 -0000


albertel		Sat Nov  9 16:48:20 2002 EDT

  Modified files:              
    /modules/TexConvert/tthdynamic	tthfunc.c 
  Log:
  - my changes
  - reinit all the new globals
  - Moved to use new global for detecting the first pass rather than static
  
  
Index: modules/TexConvert/tthdynamic/tthfunc.c
diff -u modules/TexConvert/tthdynamic/tthfunc.c:1.7 modules/TexConvert/tthdynamic/tthfunc.c:1.8
--- modules/TexConvert/tthdynamic/tthfunc.c:1.7	Sat Nov  9 16:46:28 2002
+++ modules/TexConvert/tthdynamic/tthfunc.c	Sat Nov  9 16:48:19 2002
@@ -19,7 +19,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /home/cvs/modules/TexConvert/tthdynamic/tthfunc.c,v 1.7 2002/11/09 21:46:28 albertel Exp $
+ * $Header: /home/cvs/modules/TexConvert/tthdynamic/tthfunc.c,v 1.8 2002/11/09 21:48:19 albertel Exp $
  */
 
 #define FLEX_SCANNER
@@ -12891,7 +12891,7 @@
 int tth_tagpurge=0;
 
  /* Define the size of djgpp stack*/
-unsigned _stklen = 1048576;  /* need a larger stack (1Mb) */
+unsigned _tth_stklen = 1048576;  /* need a larger stack (1Mb) */
 
  /*Global string pointer and length*/
  /* dynamic function globals. */ 
@@ -12911,6 +12911,7 @@
 struct tth_string tth_out;
 struct tth_string tth_err;
 int tth_reinitialize=0;
+int tth_initialized=0;
 #define MAX_INCLUDE_DEPTH 100
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
 YY_BUFFER_STATE halbuff;
@@ -13977,10 +13978,11 @@
  if(tth_reinitialize) {
    /* reinitialization code */
     /* int */ 
+    tth_initialized=0;
     tth_init_outputs();
     
     tth_root_depth=0;
-    tth_num_lines = 0;
+    tth_num_lines = 1;
     tth_push_depth=0;
     /*tth_debug = 0; tth_debug sould not be changed */
     tth_verb = 0;
@@ -13991,6 +13993,13 @@
     tth_multinum=1;
     tth_autopic=0;
     tth_istyle=0;
+    tth_istyle=1;
+    tth_htmlstyle=0;
+    tth_unicode=0;
+    tth_indexpage=20;
+    tth_allowinput=1;
+    tth_titlestate=4;
+    tth_tagpurge=0;
     tth_stack_ptr = 0;
     tth_ercnt=0;
     tth_epsftype=0;
@@ -14008,7 +14017,7 @@
     halignenter=0;
     halind=0;
     eqalignlog=0; /* 1 eqalign, >1 no-numbering, >100 reset at line end. */
-    colspan=0; /* colspan of table cell; is set to 0 by EQA1 call. */
+    colspan=1; /* colspan of table cell; is set to 0 by EQA1 call. */
     eqaligncell=0;
     eqalignrow=0;
     eqaind=0;
@@ -14027,6 +14036,7 @@
     narg=0;
     margmax=0;
     eqdepth=0;
+    eqsubsup=0;
     eqclose=0;
     eqhgt=0;
     tabwidth=150;
@@ -14050,13 +14060,19 @@
     tthglue=0;
     tth_eqwidth=100;
     boxborder=0;
-    
+    bibliogs=0;
+    verbinput=0;
+    tth_index_face=0;
+    tth_index_line=0;
+    oa_removes=0;
+
     /* time_t */
     thetime=0;
 
     /* char* */
     chscratch=NULL;
     chs2=NULL;
+    chs3=NULL;
     chdef=NULL;
     chopt=0;
     
@@ -14074,7 +14090,9 @@
     /* FILE* */
     tth_inputfile=NULL;
     if (tth_indexfile!=NULL) {fclose(tth_indexfile);tth_indexfile=NULL;}
+    if (tth_indexstyle!=NULL) {fclose(tth_indexstyle);tth_indexstyle=NULL;}
     if (tth_picfile!=NULL) {fclose(tth_picfile);tth_picfile=NULL;}
+    if (tth_fdout!=NULL) {fclose(tth_fdout);tth_fdout=NULL;}
 
     /* arrays */
     /* int[] */
@@ -14118,6 +14136,7 @@
     memset(unitlength,0,TTH_CHARLEN*sizeof(char));
     memset(tdalign,0,TTH_CHARLEN*sizeof(char));
     memset(precell,0,TTH_CHARLEN*sizeof(char));
+    memset(input_filename,0,TTH_CHARLEN*sizeof(char));
     
     memset(eqchar,0,4*TTH_CHARLEN*sizeof(char));
     memset(eqchar2,0,4*TTH_CHARLEN*sizeof(char));
@@ -14137,8 +14156,12 @@
     memset(refchar,0,20*sizeof(char));
     memset(colorchar,0,20*sizeof(char));
     memset(filechar,0,20*sizeof(char));
+    memset(filenext,0,20*sizeof(char));
     memset(auxflch,0,20*sizeof(char));
 
+    memset(openscrt,0,2*sizeof(char));
+    memset(xpndstring,0,2*sizeof(char));
+
     memset(schar,0,3*sizeof(char));
 
     memset(ftntcode,0,4*sizeof(char));
@@ -26121,7 +26144,6 @@
 	      char* errstring, int elen)
 {
   YY_BUFFER_STATE temp;
-  static int initialized=0;
   int returnval=0;
   if(tth_mathitalic){  /* Make italic the default.*/
     strcpy(tth_font_open[0],"<i>");
@@ -26131,8 +26153,8 @@
   }
   tth_init_outputs();
   tth_num_lines=0;
-  if(!initialized){
-      /*yy_push_state(latexbuiltins); Uncomment to force always LaTeX.*/
+  if(!tth_initialized){
+    yy_push_state(latexbuiltins); /*force always LaTeX.*/
     yy_push_state(builtins);
   }
   temp=yy_scan_string(texstring);
@@ -26143,8 +26165,8 @@
   snprintf(errstring,elen,tth_err.str);
   if (tth_err.len>elen) { returnval |= 4; }
   tth_free_outputs();
-  if ( !initialized ) {initialized++;}
-  return (returnval | initialized);
+  if ( !tth_initialized ) {tth_initialized++;}
+  return (returnval | tth_initialized);
 }
 
  /*
@@ -26156,7 +26178,6 @@
 	      char** errstring, int maxlen)
 {
   YY_BUFFER_STATE temp;
-  static int initialized=0;
   int returnval=0;
   if(tth_mathitalic){  /* Make italic the default.*/
     strcpy(tth_font_open[0],"<i>");
@@ -26167,8 +26188,8 @@
   tth_init_outputs();
   tth_num_lines=0;
   tth_maxlen=maxlen;
-  if(!initialized){
-      /*yy_push_state(latexbuiltins); Uncomment to force always LaTeX.*/
+  if(!tth_initialized){
+    yy_push_state(latexbuiltins); /*force always LaTeX.*/
     yy_push_state(builtins);
   }
   temp=yy_scan_string(texstring);
@@ -26178,8 +26199,8 @@
   *errstring=tth_err.str;tth_err.str=NULL;
   if (tth_out.len==maxlen-1) { returnval |= 2; }
   if (tth_err.len==maxlen-1) { returnval |= 4; }
-  if ( !initialized ) {initialized++;}
-  return (returnval | initialized);
+  if ( !tth_initialized ) {tth_initialized++;}
+  return (returnval | tth_initialized);
 }
 void tth_restart () {
   tth_reinitialize=1;