[BACK]Return to mathcap.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_toolkit

Diff for /OpenXM/src/ox_toolkit/mathcap.c between version 1.8 and 1.16

version 1.8, 2003/05/19 06:57:38 version 1.16, 2016/06/29 05:07:23
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM: OpenXM/src/ox_toolkit/mathcap.c,v 1.7 2000/12/03 16:15:03 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_toolkit/mathcap.c,v 1.15 2015/08/18 02:24:04 noro Exp $ */
   
 /* This module includes functions for handling mathcap databases. */  /* This module includes functions for handling mathcap databases. */
   
Line 39  static int cmotbl_a[] = {
Line 39  static int cmotbl_a[] = {
     CMO_LIST,      CMO_LIST,
     CMO_MONOMIAL32,      CMO_MONOMIAL32,
     CMO_ZZ,      CMO_ZZ,
       CMO_QQ,
       CMO_BIGFLOAT32,
       CMO_COMPLEX,
       CMO_IEEE_DOUBLE_FLOAT,
     CMO_ZERO,      CMO_ZERO,
     CMO_DMS_GENERIC,      CMO_DMS_GENERIC,
     CMO_RING_BY_NAME,      CMO_RING_BY_NAME,
     CMO_INDETERMINATE,      CMO_INDETERMINATE,
     CMO_DISTRIBUTED_POLYNOMIAL,      CMO_DISTRIBUTED_POLYNOMIAL,
       CMO_RECURSIVE_POLYNOMIAL,
       CMO_POLYNOMIAL_IN_ONE_VARIABLE,
     CMO_ERROR2,      CMO_ERROR2,
     0,      0,
 };  };
Line 87  static table *new_table(int *src)
Line 93  static table *new_table(int *src)
     int i;      int i;
     while (src[len++] != 0) {      while (src[len++] != 0) {
     }      }
     new = malloc(sizeof(table)*len);      new = MALLOC(sizeof(table)*len);
     for(i=0; i<len; i++) {      for(i=0; i<len; i++) {
         table_init(new+i, src[i]);          table_init(new+i, src[i]);
     }      }
Line 236  static cmo_list *sysinfo_get()
Line 242  static cmo_list *sysinfo_get()
   
 static char *new_string(char *s)  static char *new_string(char *s)
 {  {
     char *t = malloc(strlen(s)+1);      char *t = MALLOC(strlen(s)+1);
     strcpy(t, s);      strcpy(t, s);
     return t;      return t;
 }  }
Line 247  static int *new_int_array(int *array)
Line 253  static int *new_int_array(int *array)
     int length = 0;      int length = 0;
     while(array[length++] != 0)      while(array[length++] != 0)
         ;          ;
     new_array = malloc(sizeof(int)*length);      new_array = MALLOC(sizeof(int)*length);
     return memcpy(new_array, array, sizeof(int)*length);      return memcpy(new_array, array, sizeof(int)*length);
 }  }
   
Line 268  void mathcap_init(int ver, char *vstr, char *sysname, 
Line 274  void mathcap_init(int ver, char *vstr, char *sysname, 
   
 mathcap *new_mathcap()  mathcap *new_mathcap()
 {  {
     mathcap *new = malloc(sizeof(mathcap));      mathcap *new = MALLOC(sizeof(mathcap));
     new->cmotbl = new_table(sysinfo.cmo_tags);      new->cmotbl = new_table(sysinfo.cmo_tags);
     new->smtbl  = new_table(sysinfo.sm_cmds);      new->smtbl  = new_table(sysinfo.sm_cmds);
     return new;      return new;
Line 279  cmo_mathcap* mathcap_get(mathcap *this)
Line 285  cmo_mathcap* mathcap_get(mathcap *this)
 {  {
     cmo_list *mc = new_cmo_list();      cmo_list *mc = new_cmo_list();
     cmo_list *l3 = new_cmo_list();      cmo_list *l3 = new_cmo_list();
     list_append(l3, list_appendl(new_cmo_list(),      list_append(l3, (cmo *)list_appendl(new_cmo_list(),
                                  new_cmo_int32(OX_DATA),                                   new_cmo_int32(OX_DATA),
                                  table_get_all(this->cmotbl), NULL));                                   table_get_all(this->cmotbl), NULL));
     list_appendl(mc, (cmo *)sysinfo_get(),      list_appendl(mc, (cmo *)sysinfo_get(),

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.16

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