=================================================================== RCS file: /home/cvs/OpenXM/src/ox_toolkit/mathcap.c,v retrieving revision 1.8 retrieving revision 1.18 diff -u -p -r1.8 -r1.18 --- OpenXM/src/ox_toolkit/mathcap.c 2003/05/19 06:57:38 1.8 +++ OpenXM/src/ox_toolkit/mathcap.c 2016/08/23 05:36:39 1.18 @@ -1,5 +1,5 @@ /* -*- 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.17 2016/08/23 02:24:19 ohara Exp $ */ /* This module includes functions for handling mathcap databases. */ @@ -39,11 +39,17 @@ static int cmotbl_a[] = { CMO_LIST, CMO_MONOMIAL32, CMO_ZZ, + CMO_QQ, + CMO_BIGFLOAT32, + CMO_COMPLEX, + CMO_IEEE_DOUBLE_FLOAT, CMO_ZERO, CMO_DMS_GENERIC, CMO_RING_BY_NAME, CMO_INDETERMINATE, CMO_DISTRIBUTED_POLYNOMIAL, + CMO_RECURSIVE_POLYNOMIAL, + CMO_POLYNOMIAL_IN_ONE_VARIABLE, CMO_ERROR2, 0, }; @@ -71,7 +77,8 @@ static struct { char *hosttype; int *cmo_tags; int *sm_cmds; -} sysinfo = {0, "NO VERSION", "NONAME", "UNKNOWN", cmotbl_a, smtbl_a}; + char **opts; +} sysinfo = {0, "NO VERSION", "NONAME", "UNKNOWN", cmotbl_a, smtbl_a, NULL}; __inline__ static void table_init(table *m, int key) @@ -87,7 +94,7 @@ static table *new_table(int *src) int i; while (src[len++] != 0) { } - new = malloc(sizeof(table)*len); + new = MALLOC(sizeof(table)*len); for(i=0; icmotbl = new_table(sysinfo.cmo_tags); new->smtbl = new_table(sysinfo.sm_cmds); + new->opts = clone_str_list(sysinfo.opts); return new; } @@ -279,11 +312,23 @@ cmo_mathcap* mathcap_get(mathcap *this) { cmo_list *mc = new_cmo_list(); cmo_list *l3 = new_cmo_list(); - list_append(l3, list_appendl(new_cmo_list(), + cmo_list *si = sysinfo_get(); + cmo_list *sm= table_get_all(this->smtbl); + cmo_list *opts; + int i; + + list_append(l3, (cmo *)list_appendl(new_cmo_list(), new_cmo_int32(OX_DATA), table_get_all(this->cmotbl), NULL)); - list_appendl(mc, (cmo *)sysinfo_get(), - (cmo *)table_get_all(this->smtbl), (cmo *)l3, NULL); + if(this->opts) { + opts = new_cmo_list(); + for(i=0; this->opts[i]!=NULL; i++) { + list_append(opts, (cmo *)new_cmo_string(this->opts[i])); + } + list_appendl(mc, (cmo *)si, (cmo *)sm, (cmo *)l3, (cmo *)opts, NULL); + }else { + list_appendl(mc, (cmo *)si, (cmo *)sm, (cmo *)l3, NULL); + } return new_cmo_mathcap((cmo *)mc); }