[LON-CAPA-cvs] cvs: modules /TexConvert/ttmdynamic ttmfunc.c

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


albertel		Sat Nov  9 16:53:54 2002 EDT

  Modified files:              
    /modules/TexConvert/ttmdynamic	ttmfunc.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/ttmdynamic/ttmfunc.c
diff -u modules/TexConvert/ttmdynamic/ttmfunc.c:1.8 modules/TexConvert/ttmdynamic/ttmfunc.c:1.9
--- modules/TexConvert/ttmdynamic/ttmfunc.c:1.8	Sat Nov  9 16:49:20 2002
+++ modules/TexConvert/ttmdynamic/ttmfunc.c	Sat Nov  9 16:53:54 2002
@@ -19,7 +19,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /home/cvs/modules/TexConvert/ttmdynamic/ttmfunc.c,v 1.8 2002/11/09 21:49:20 albertel Exp $
+ * $Header: /home/cvs/modules/TexConvert/ttmdynamic/ttmfunc.c,v 1.9 2002/11/09 21:53:54 albertel Exp $
  */
 
 #define FLEX_SCANNER
@@ -13803,7 +13803,7 @@
 int ttm_tagpurge=0;
 
  /* Define the size of djgpp stack*/
-unsigned _stklen = 1048576;  /* need a larger stack (1Mb) */
+unsigned _ttm_stklen = 1048576;  /* need a larger stack (1Mb) */
 
  /*Global string pointer and length*/
  /* dynamic function globals. */ 
@@ -13823,6 +13823,7 @@
 struct ttm_string ttm_out;
 struct ttm_string ttm_err;
 int ttm_reinitialize=0;
+int ttm_initialized=0;
 #define MAX_INCLUDE_DEPTH 100
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
 YY_BUFFER_STATE halbuff;
@@ -14390,7 +14391,7 @@
 
 #line 514 "ttmdynamic.lex"
 
-
+#define exit return
   /* Local storage */
 
 #define NCOUNT 256
@@ -14903,10 +14904,11 @@
  if(ttm_reinitialize) {
    /* reinitialization code */
     /* int */ 
+    ttm_initialized=0;
     ttm_init_outputs();
     
     ttm_root_depth=0;
-    ttm_num_lines = 0;
+    ttm_num_lines = 1;
     ttm_push_depth=0;
     /*ttm_debug = 0; ttm_debug sould not be changed */
     ttm_verb = 0;
@@ -14916,7 +14918,13 @@
     ttm_flev=5;
     ttm_multinum=1;
     ttm_autopic=0;
-    ttm_istyle=0;
+    ttm_istyle=1;
+    ttm_htmlstyle=0;
+    ttm_unicode=0;
+    ttm_indexpage=20;
+    ttm_allowinput=1;
+    ttm_titlestate=4;
+    ttm_tagpurge=0;
     ttm_stack_ptr = 0;
     ttm_ercnt=0;
     ttm_epsftype=0;
@@ -14934,7 +14942,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;
@@ -14953,6 +14961,7 @@
     narg=0;
     margmax=0;
     eqdepth=0;
+    eqsubsup=0;
     eqclose=0;
     eqhgt=0;
     tabwidth=150;
@@ -14976,13 +14985,18 @@
     tthglue=0;
     ttm_eqwidth=100;
     boxborder=0;
-    
+    bibliogs=0;
+    verbinput=0;
+    ttm_index_face=0;
+    ttm_index_line=0;
+
     /* time_t */
     thetime=0;
 
     /* char* */
     chscratch=NULL;
     chs2=NULL;
+    chs3=NULL;
     chdef=NULL;
     chopt=0;
     
@@ -15000,7 +15014,9 @@
     /* FILE* */
     ttm_inputfile=NULL;
     if (ttm_indexfile!=NULL) {fclose(ttm_indexfile);ttm_indexfile=NULL;}
+    if (ttm_indexstyle!=NULL) {fclose(ttm_indexstyle);ttm_indexstyle=NULL;}
     if (ttm_picfile!=NULL) {fclose(ttm_picfile);ttm_picfile=NULL;}
+    if (ttm_fdout!=NULL) {fclose(ttm_fdout);ttm_fdout=NULL;}
 
     /* arrays */
     /* int[] */
@@ -15044,6 +15060,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));
@@ -15063,8 +15080,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));
@@ -18388,7 +18409,8 @@
       TTH_SCAN_STRING(argchar);
       fclose(ttm_inputfile);ttm_inputfile=NULL;
     } else{
-      add_error("No auxiliary LaTeX file found: %s\n",argchar);
+      /*Not really an error*/
+      /*add_error("No auxiliary LaTeX file found: %s\n",argchar);*/
       /* New automatic auxfile section.*/
       if(ttm_autopic){
 	add_error(
@@ -26454,7 +26476,6 @@
 	      char* errstring, int elen)
 {
   YY_BUFFER_STATE temp;
-  static int initialized=0;
   int returnval=0;
   if(ttm_mathitalic){  /* Make italic the default.*/
     strcpy(ttm_font_open[0],"<i>");
@@ -26464,8 +26485,8 @@
   }
   ttm_init_outputs();
   ttm_num_lines=0;
-  if(!initialized){
-      /*yy_push_state(latexbuiltins); Uncomment to force always LaTeX.*/
+  if(!ttm_initialized){
+    yy_push_state(latexbuiltins);/*force always LaTeX.*/
     yy_push_state(builtins);
   }
   temp=yy_scan_string(texstring);
@@ -26476,8 +26497,8 @@
   snprintf(errstring,elen,ttm_err.str);
   if (ttm_err.len>elen) { returnval |= 4; }
   ttm_free_outputs();
-  if ( !initialized ) {initialized++;}
-  return (returnval | initialized);
+  if ( !ttm_initialized ) {ttm_initialized++;}
+  return (returnval | ttm_initialized);
 }
 
  /*
@@ -26489,7 +26510,6 @@
 	      char** errstring, int maxlen)
 {
   YY_BUFFER_STATE temp;
-  static int initialized=0;
   int returnval=0;
   if(ttm_mathitalic){  /* Make italic the default.*/
     strcpy(ttm_font_open[0],"<i>");
@@ -26500,8 +26520,8 @@
   ttm_init_outputs();
   ttm_num_lines=0;
   ttm_maxlen=maxlen;
-  if(!initialized){
-      /*yy_push_state(latexbuiltins); Uncomment to force always LaTeX.*/
+  if(!ttm_initialized){
+    yy_push_state(latexbuiltins); /*force always LaTeX.*/
     yy_push_state(builtins);
   }
   temp=yy_scan_string(texstring);
@@ -26511,8 +26531,8 @@
   *errstring=ttm_err.str;ttm_err.str=NULL;
   if (ttm_out.len==maxlen-1) { returnval |= 2; }
   if (ttm_err.len==maxlen-1) { returnval |= 4; }
-  if ( !initialized ) {initialized++;}
-  return (returnval | initialized);
+  if ( !ttm_initialized ) {ttm_initialized++;}
+  return (returnval | ttm_initialized);
 }
 void ttm_restart () {
   ttm_reinitialize=1;