[BACK]Return to strobj.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / builtin

Diff for /OpenXM_contrib2/asir2000/builtin/strobj.c between version 1.24 and 1.25

version 1.24, 2004/03/05 01:19:09 version 1.25, 2004/03/05 01:34:24
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/builtin/strobj.c,v 1.23 2004/03/05 01:15:48 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/builtin/strobj.c,v 1.24 2004/03/05 01:19:09 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 113  void write_tb(char *s,TB tb)
Line 113  void write_tb(char *s,TB tb)
 int register_symbol_table(Obj arg);  int register_symbol_table(Obj arg);
 int register_conv_rule(Obj arg);  int register_conv_rule(Obj arg);
 int register_dp_vars(Obj arg);  int register_dp_vars(Obj arg);
   int register_dp_vars_prefix(Obj arg);
 static struct TeXSymbol *user_texsymbol;  static struct TeXSymbol *user_texsymbol;
 static char *(*conv_rule)(char *);  static char *(*conv_rule)(char *);
 static char **dp_vars;  static char **dp_vars;
 int dp_vars_len;  static int dp_vars_len;
   static char *dp_vars_prefix;
   
 static struct {  static struct {
         char *name;          char *name;
Line 126  static struct {
Line 128  static struct {
         {"symbol_table",0,register_symbol_table},          {"symbol_table",0,register_symbol_table},
         {"conv_rule",0,register_conv_rule},          {"conv_rule",0,register_conv_rule},
         {"dp_vars",0,register_dp_vars},          {"dp_vars",0,register_dp_vars},
           {"dp_vars_prefix",0,register_dp_vars_prefix},
         {0,0,0},          {0,0,0},
 };  };
   
Line 162  char *conv_rule_d(char *name)
Line 165  char *conv_rule_d(char *name)
         b[j++] = '_'; b[j++] = '{';          b[j++] = '_'; b[j++] = '{';
         if ( name[i] == '_' ) i++;          if ( name[i] == '_' ) i++;
         for ( start = 1; i < l; ) {          for ( start = 1; i < l; ) {
                 if ( name[i] == '_' ) {                  if ( name[i] == '{' || name[i] == '}' || name[i] == ' ' )
                           b[j++] = name[i++];
                   else if ( name[i] == '_' ) {
                         i++;                          i++;
                         start = 1;                          start = 1;
                         b[j++] = ',';                          b[j++] = ',';
Line 272  int register_dp_vars(Obj arg)
Line 277  int register_dp_vars(Obj arg)
         if ( !arg ) {          if ( !arg ) {
                 dp_vars = 0;                  dp_vars = 0;
                 dp_vars_len = 0;                  dp_vars_len = 0;
                   return 1;
         } else if ( OID(arg) != O_LIST )          } else if ( OID(arg) != O_LIST )
                 return 0;                  return 0;
         else {          else {
Line 294  int register_dp_vars(Obj arg)
Line 300  int register_dp_vars(Obj arg)
         }          }
 }  }
   
   int register_dp_vars_prefix(Obj arg)
   {
           if ( !arg ) {
                   dp_vars_prefix = 0;
                   return 1;
           } else if ( OID(arg) == O_STR ) {
                   dp_vars_prefix = BDY((STRING)arg);
                   return 1;
           } else if ( OID(arg) == O_P ) {
                   dp_vars_prefix = NAME(VR((P)arg));
                   return 1;
           } else return 0;
   }
   
 void Pquotetotex_env(NODE arg,Obj *rp)  void Pquotetotex_env(NODE arg,Obj *rp)
 {  {
         int ac,i;          int ac,i;
Line 913  void fnodetotex_tb(FNODE f,TB tb)
Line 933  void fnodetotex_tb(FNODE f,TB tb)
                                 allzero = 0;                                  allzero = 0;
                                 if ( dp_vars && i < dp_vars_len )                                  if ( dp_vars && i < dp_vars_len )
                                         strcpy(vname,dp_vars[i]);                                          strcpy(vname,dp_vars[i]);
                                   else if ( dp_vars_prefix )
                                           sprintf(vname,"%s_{%d}",dp_vars_prefix,i);
                                 else                                  else
                                         sprintf(vname,"x_{%d}",i);                                          sprintf(vname,"x_{%d}",i);
                                 vname_conv = symbol_name(vname);                                  vname_conv = symbol_name(vname);

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>