=================================================================== RCS file: /home/cvs/OpenXM_contrib/pari-2.2/src/language/Attic/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -p -r1.1.1.1 -r1.2 --- OpenXM_contrib/pari-2.2/src/language/Attic/init.c 2001/10/02 11:17:10 1.1.1.1 +++ OpenXM_contrib/pari-2.2/src/language/Attic/init.c 2002/09/11 07:27:04 1.2 @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.1.1.1 2001/10/02 11:17:10 noro Exp $ +/* $Id: init.c,v 1.2 2002/09/11 07:27:04 noro Exp $ Copyright (C) 2000 The PARI group. @@ -37,7 +37,6 @@ byteptr diffptr; char *current_logfile, *current_psfile; int gp_colors[c_LAST]; int disable_color = 1, added_newline = 1; -int under_emacs = 0, under_texmacs = 0; int functions_tblsz = 135; /* size of functions_hash */ entree **varentries; @@ -45,11 +44,14 @@ entree **varentries; void *global_err_data; jmp_buf environnement; long *ordvar; -long DEBUGFILES,DEBUGLEVEL,DEBUGMEM,compatible; -long prec,precdl; +ulong DEBUGFILES, DEBUGLEVEL, DEBUGMEM, compatible; +ulong prec, precdl; ulong init_opts = INIT_JMPm | INIT_SIGm; -ulong top, bot, avma, memused; +gpmem_t bot = 0, top = 0, avma; +size_t memused; +gp_data *GP_DATA = NULL; + void *foreignHandler; /* Handler for foreign commands. */ char foreignExprSwitch = 3; /* Just some unprobable char. */ GEN (*foreignExprHandler)(char*); /* Handler for foreign expressions.*/ @@ -57,13 +59,22 @@ entree * (*foreignAutoload)(char*, long); /* Autoloade void (*foreignFuncFree)(entree *); /* How to free external entree. */ int (*default_exception_handler)(long); -GEN (*gp_history_fun)(long, long, char *, char *); int (*whatnow_fun)(char *, int); -void (*output_fun)(GEN); +pariout_t DFLT_OUTPUT = { 'g', 0, -1, 1, 0, f_RAW }; +extern void delete_dirs(gp_path *p); extern void initout(int initerr); extern int term_width(void); +#ifdef BOTH_GNUPLOT_AND_X11 +/* Satisfy DLL dependencies: dummy only */ +#define EXTERM_DLL_DPES *PL_markstack_ptr, PL_stack_max, *PL_Sv, *PL_stack_sp, \ + *PL_tmps_floor, *PL_tmps_ix, *PL_markstack_max, *PL_stack_base, *PL_na, \ + *PL_sv_yes, *PL_sv_no, *PL_curpad, *PL_op +extern int EXTERM_DLL_DPES; +int EXTERM_DLL_DPES; +#endif /* defined BOTH_GNUPLOT_AND_X11 */ + typedef struct cell { void *env; void *data; @@ -129,10 +140,48 @@ static int var_not_changed; /* altered in reorder() */ static int try_to_recover = 0; static long next_bloc; static GEN cur_bloc=NULL; /* current bloc in bloc list */ -static long *universal_constants; +static GEN universal_constants; +#if __MWERKS__ +static void * +macalloc(size_t size) +{ + OSErr resultCode; + Handle newH = TempNewHandle((size),&resultCode); + if (!newH) return NULL; + HLock(newH); return (void*) *newH; +} +# define __gpmalloc(size) ((size) > 1000000)? macalloc(size): malloc((size)) +#else +# define __gpmalloc(size) (malloc(size)) +#endif + +char* +gpmalloc(size_t size) +{ + if (size) + { + char *tmp = (char*)__gpmalloc(size); + if (!tmp) err(memer); + return tmp; + } + if (DEBUGMEM) err(warner,"mallocing NULL object"); + return NULL; +} + +char* +gprealloc(void *pointer, size_t size) +{ + char *tmp; + + if (!pointer) tmp = (char *) malloc(size); + else tmp = (char *) realloc(pointer,size); + if (!tmp) err(memer); + return tmp; +} + static void -pari_handle_SIGINT() +pari_handle_SIGINT(void) { #ifdef _WIN32 if (++win32ctrlc >= 5) _exit(3); @@ -145,7 +194,7 @@ static void pari_sighandler(int sig) { char *msg; - os_signal(sig,pari_sighandler); + (void)os_signal(sig,pari_sighandler); switch(sig) { #ifdef SIGBREAK @@ -354,15 +403,6 @@ pari_addfunctions(module **modlist_p, entree *func, ch modlist->help = NULL; } -static long -fix_size(long a) -{ - /* BYTES_IN_LONG*ceil(a/BYTES_IN_LONG) */ - ulong b = a+BYTES_IN_LONG - (((a-1) & (BYTES_IN_LONG-1)) + 1); - if (b > VERYBIGINT) err(talker,"stack too large"); - return b; -} - void pari_sig_init(void (*f)(int)) { @@ -394,14 +434,69 @@ reset_traps(int warn) for (i=0; i <= noer; i++) err_catch_array[i] = 0; } +static void +init_universal_constants(void) +{ + /* 2 (gnil) + 2 (gzero) + 3 (gun) + 3 (gdeux) + 3 (half) + 3 (gi) */ + GEN p = universal_constants = (long*) gpmalloc(16*sizeof(long)); + gzero = p; p+=2; gnil = p; p+=2; + gzero[0] = gnil[0] = evaltyp(t_INT) | evallg(2); + gzero[1] = gnil[1] = evallgefint(2); + + gun = p; p+=3; gdeux = p; p+=3; + gun[0] = gdeux[0] = evaltyp(t_INT) | evallg(3); + gun[1] = gdeux[1] = evalsigne(1) | evallgefint(3); + gun[2] = 1; gdeux[2]= 2; + + ghalf = p; p+=3; gi = p; p+=3; + ghalf[0] = evaltyp(t_FRAC) | evallg(3); + ghalf[1] = un; + ghalf[2] = deux; + gi[0] = evaltyp(t_COMPLEX) | evallg(3); + gi[1] = zero; + gi[2] = un; +} + +static long +fix_size(size_t a) +{ + /* BYTES_IN_LONG*ceil(a/BYTES_IN_LONG) */ + size_t b = a+BYTES_IN_LONG - (((a-1) & (BYTES_IN_LONG-1)) + 1); + if (b > VERYBIGINT) err(talker,"stack too large"); + if (b < 1024) b = 1024; + return b; +} + +static long +init_stack(size_t size) +{ + size_t s = fix_size(size), old = 0; + if (bot) + { + old = top - bot; + free((void*)bot); + } + /* NOT gpmalloc, memer would be deadly */ + bot = (gpmem_t)__gpmalloc(s); + if (!bot) + for (s = old;; s>>=1) + { + if (!s) err(memer); /* no way out. Die */ + err(warner,"not enough memory, new stack %lu",s); + bot = (gpmem_t)__gpmalloc(s); + if (bot) break; + } + avma = top = bot+s; + memused = 0; return s; +} + /* initialise les donnees de la bibliotheque PARI. Peut être précédée d'un * appel à pari_addfunctions si on ajoute d'autres fonctions au pool de base. */ void -pari_init(long parisize, long maxprime) +pari_init(size_t parisize, ulong maxprime) { - long i, size; - GEN p; + long i; #ifdef STACK_CHECK pari_init_stackcheck(&i); @@ -413,21 +508,9 @@ pari_init(long parisize, long maxprime) exit(1); } if (INIT_SIG) pari_sig_init(pari_sighandler); - size = fix_size(parisize); -#if __MWERKS__ - { - OSErr resultCode; - Handle newHand = TempNewHandle(size,&resultCode); - - if (!newHand) err(memer); - HLock(newHand); - bot = (long)*newHand; - } -#else - bot = (long) gpmalloc(size); -#endif - top = avma = memused = bot+size; + (void)init_stack(parisize); diffptr = initprimes(maxprime); + init_universal_constants(); varentries = (entree**) gpmalloc((MAXVARN+1)*sizeof(entree*)); polvar = (GEN) gpmalloc((MAXVARN+1)*sizeof(long)); @@ -437,26 +520,7 @@ pari_init(long parisize, long maxprime) polvar[0] = evaltyp(t_VEC) | evallg(1); for (i=0; i <= MAXVARN; i++) { ordvar[i] = i; varentries[i] = NULL; } - /* 2 (gnil) + 2 (gzero) + 3 (gun) + 3 (gdeux) + 3 (half) + 3 (gi) */ - p = universal_constants = (long *) gpmalloc(16*sizeof(long)); - - gzero = p; p+=2; gnil = p; p+=2; - gzero[0] = gnil[0] = evaltyp(t_INT) | evallg(2); - gzero[1] = gnil[1] = evallgefint(2); - - gun = p; p+=3; gdeux = p; p+=3; - gun[0] = gdeux[0] = evaltyp(t_INT) | evallg(3); - gun[1] = gdeux[1] = evalsigne(1) | evallgefint(3); - gun[2] = 1; gdeux[2]= 2; - - ghalf = p; p+=3; gi = p; p+=3; - ghalf[0] = evaltyp(t_FRAC) | evallg(3); - ghalf[1] = un; - ghalf[2] = deux; - gi[0] = evaltyp(t_COMPLEX) | evallg(3); - gi[1] = zero; - gi[2] = un; - fetch_var(); /* create polx/polun[MAXVARN] */ + (void)fetch_var(); /* create polx/polun[MAXVARN] */ primetab = (GEN) gpmalloc(1 * sizeof(long)); primetab[0] = evaltyp(t_VEC) | evallg(1); @@ -479,19 +543,43 @@ pari_init(long parisize, long maxprime) for (i = 0; i < functions_tblsz; i++) members_hash[i] = NULL; gp_init_entrees(pari_membermodules, members_hash, 1); - gp_history_fun = NULL; whatnow_fun = NULL; - output_fun = &outbrute; err_catch_array = (long *) gpmalloc((noer + 1) *sizeof(long)); reset_traps(0); default_exception_handler = NULL; (void)manage_var(2,NULL); /* init nvar */ - (void)get_timer(-1); /* init timers */ - var_not_changed = 1; fetch_named_var("x", 0); + var_not_changed = 1; (void)fetch_named_var("x", 0); try_to_recover=1; } +static void +delete_hist(gp_hist *h) +{ + if (h->res) free((void*)h->res); +} +static void +delete_pp(gp_pp *p) +{ + if (p->cmd) free((void*)p->cmd); +} +static void +delete_path(gp_path *p) +{ + delete_dirs(p); + free((void*)p->PATH); +} + +static void +free_gp_data(gp_data *D) +{ + if (!D) return; + delete_hist(D->hist); + delete_path(D->path); + delete_pp(D->pp); + if (D->help) free((void*)D->help); +} + void freeall(void) { @@ -501,17 +589,15 @@ freeall(void) while (delete_var()) /* empty */; for (i = 0; i < functions_tblsz; i++) { - for (ep = functions_hash[i]; ep; ep = ep1) - { - ep1 = ep->next; freeep(ep); - } - for (ep = members_hash[i]; ep; ep = ep1) - { - ep1 = ep->next; freeep(ep); - } + for (ep = functions_hash[i]; ep; ep = ep1) { ep1 = ep->next; freeep(ep); } + for (ep = members_hash[i]; ep; ep = ep1) { ep1 = ep->next; freeep(ep); } } - free((void*)varentries); free((void*)ordvar); free((void*)polvar); - free((void*)polx[MAXVARN]); free((void*)polx); free((void*)polun); + free((void*)varentries); + free((void*)ordvar); + free((void*)polvar); + free((void*)polx[MAXVARN]); + free((void*)polx); + free((void*)polun); free((void*)primetab); free((void*)universal_constants); @@ -519,12 +605,12 @@ freeall(void) while (cur_bloc) { *cur_bloc=0; killbloc(cur_bloc); } killallfiles(1); free((void *)functions_hash); - free((void *)bot); free((void *)diffptr); + free((void *)bot); + free((void *)diffptr); free(current_logfile); free(current_psfile); - if (gp_history_fun) - gp_history_fun(0,-1,NULL,NULL); + free_gp_data(GP_DATA); } GEN @@ -567,17 +653,37 @@ newbloc(long n) { if (!n) err(warner,"mallocing NULL object in newbloc"); if (DEBUGMEM > 2) - fprintferr("new bloc, size %6ld (no %ld): %08lx\n", n, next_bloc-1, x); + fprintferr("new bloc, size %6lu (no %ld): %08lx\n", n, next_bloc-1, x); } return cur_bloc = x; } -void -killbloc0(GEN x, int inspect) +/* recursively look for clones in the container and kill them */ +static void +inspect(GEN x) { - long tx,lx,l,i,j; - GEN p1; + long i, lx; + switch(typ(x)) /* HACK: if x is not a GEN, we have typ(x)=0 */ + { + case t_VEC: case t_COL: case t_MAT: + lx = lg(x); + for (i=1;i 2) fprintferr("killing bloc (no %ld): %08lx\n", bl_num(x), x); - if (inspect) - { - /* FIXME: SIGINT should be blocked at this point */ - tx=typ(x); /* if x is not a GEN, we will have tx=0 */ - if (is_vec_t(tx)) - { - lx = lg(x); - for (i=1;i1) - { - l=lg(x[1]); - if (l>1) - for (i=1;i noer) err(talker, "no such error number: %ld", errnum); + v = (cell*)gpmalloc(sizeof(cell)); v->data = data; v->env = env; v->flag = errnum; @@ -875,95 +951,75 @@ err_catch(long errnum, jmp_buf env, void *data) return (void*)v; } -/* reset traps younger than V (included) */ -void -err_leave(void **V) +static void +pop_catch_cell(stack **s) { - cell *t, *v = (cell*)*V; - - for (;;) + cell *c = (cell*)pop_stack(s); + if (c) { - t = (cell*)pop_stack(&err_catch_stack); - if (t == v || !t) break; - err_catch_array[t->flag]--; - free(t); + err_catch_array[c->flag]--; + free(c); } - if (!t) reset_traps(1); - err_catch_array[v->flag]--; - free(v); } -/* get last (most recent) handler for error n */ -static cell * -err_seek(long n) -{ - stack *s = err_catch_stack; - cell *t = NULL; - - for (;s; s = s->prev) - { - t = (cell*)s->value; - if (!t || t->flag == n) break; - } - if (!t) reset_traps(1); - return t; -} - /* kill last handler for error n */ -void +static void err_leave_default(long n) { - stack *s = err_catch_stack, *lasts = NULL; - cell *c; + stack *s = err_catch_stack, *lasts; if (n < 0) n = noer; if (!s || !err_catch_array[n]) return; - for (;s; s = s->prev) + for (lasts = NULL; s; lasts = s, s = s->prev) + if (((cell*)s->value)->flag == n) break; + pop_catch_cell(&s); + if (!lasts) err_catch_stack = s; else lasts->prev = s; +} + +/* reset traps younger than V (included) */ +void +err_leave(void **V) +{ + cell *v = (cell*)*V; + while (err_catch_stack) { - c = (cell*)s->value; - if (c->flag == n) - { /* kill */ - stack *v = s->prev; - free((void*)s); s = v; - if (lasts) lasts->prev = s; - break; - } - else lasts = s; + cell *t = (cell*)err_catch_stack->value; + pop_catch_cell(&err_catch_stack); + if (t == v) return; } - if (!lasts) + reset_traps(1); +} + +/* We know somebody is trapping n (from err_catch_array). + * Get last (most recent) handler for error n (or generic noer) killing all + * more recent non-applicable handlers (now obsolete) */ +static cell * +err_seek(long n) +{ + while (err_catch_stack) { - err_catch_stack = s; - if (!s) reset_traps(0); + cell *t = err_catch_stack->value; + if (t->flag == n || t->flag == noer) return t; + pop_catch_cell(&err_catch_stack); } + reset_traps(1); return NULL; } -/* untrapped error: remove all traps depending from a longjmp */ +/* untrapped error: find oldest trap depending from a longjmp, and kill + * everything more recent */ void -err_clean() +err_clean(void) { stack *s = err_catch_stack, *lasts = NULL; - cell *c; - - if (!s) return; - while (s) + for ( ; s; s = s->prev) { - c = (cell*)s->value; - if (c->env) - { /* kill */ - stack *v = s->prev; - free((void*)s); s = v; - if (lasts) lasts->prev = s; - } - else - { /* preserve */ - if (lasts) lasts->prev = s; else err_catch_stack = s; - lasts = s; s = s->prev; - } + cell *c = (cell*)s->value; + if (c->env) lasts = s; } - if (!lasts) + if (lasts) { - err_catch_stack = NULL; - reset_traps(0); + void *c = (void*)s->value; + err_leave(&c); } } @@ -978,7 +1034,6 @@ err_recover(long numerr) { initout(0); disable_dbg(-1); - get_timer(-1); killallfiles(0); if (pariErr->die) pariErr->die(); /* Caller wants to catch exceptions? */ @@ -1003,24 +1058,25 @@ err(long numerr, ...) va_start(ap,numerr); + global_err_data = NULL; if (err_catch_stack && !is_warn(numerr)) { - int trap = 0; - if (numerr != memer) - { /* for fear of infinite recursion don't trap memory errors */ - if (err_catch_array[numerr]) trap = numerr; - else if (err_catch_array[noer]) trap = noer; + if (!err_catch_array[numerr] && !err_catch_array[noer]) err_clean(); + else if ( (trapped = err_seek(numerr)) ) + { + void *e = trapped->env; + if (e) + { + if (numerr == invmoder) + { + (void)va_arg(ap, char*); /* junk 1st arg */ + global_err_data = (void*)va_arg(ap, GEN); + } + longjmp(e, numerr); + } + global_err_data = trapped->data; } - if (trap) trapped = err_seek(trap); else err_clean(); } - if (trapped) - { /* all errors (noer), or numerr individually trapped */ - void *e = trapped->env; - global_err_data = trapped->data; - if (e) longjmp(e, numerr); - } - else - global_err_data = NULL; if (!added_newline) { pariputc('\n'); added_newline=1; } pariflush(); pariOut = pariErr; @@ -1057,6 +1113,12 @@ err(long numerr, ...) errcontext(s,ch1,va_arg(ap,char *)); } } + else if (numerr == user) + { + GEN *g = va_arg(ap, GEN*); + pariputsf(" ### user error: "); + print0(g, f_RAW); + } else { pariputsf(" *** %s", errmessage[numerr]); @@ -1082,14 +1144,14 @@ err(long numerr, ...) case operi: case operf: { char *f, *op = va_arg(ap, char*); - long x = va_arg(ap, long); - long y = va_arg(ap, long); + GEN x = va_arg(ap, GEN); + GEN y = va_arg(ap, GEN); if (*op == '+') f = "addition"; else if (*op == '*') f = "multiplication"; - else if (*op == '/' || *op == '%') f = "division"; + else if (*op == '/' || *op == '%' || *op == '\\') f = "division"; else if (*op == 'g') { op = ","; f = "gcd"; } else { op = "-->"; f = "assignment"; } - pariputsf(" %s %s %s %s.",f,type_name(x),op,type_name(y)); + pariputsf(" %s %s %s %s.",f,type_name(typ(x)),op,type_name(typ(y))); break; } @@ -1112,7 +1174,7 @@ err(long numerr, ...) term_color(c_NONE); va_end(ap); if (numerr==errpile) { - fprintferr("\n current stack size: %ld (%.3f Mbytes)\n", + fprintferr("\n current stack size: %lu (%.3f Mbytes)\n", top-bot, (top-bot)/1048576.); fprintferr(" [hint] you can increase GP stack with allocatemem()\n"); } @@ -1122,6 +1184,51 @@ err(long numerr, ...) err_recover(numerr); } +/* Try f (trapping error e), recover using r (break_loop, if NULL) */ +GEN +trap0(char *e, char *r, char *f) +{ + long numerr = -1; + GEN x = gnil; + char *F; + if (!strcmp(e,"errpile")) numerr = errpile; + else if (!strcmp(e,"typeer")) numerr = typeer; + else if (!strcmp(e,"gdiver2")) numerr = gdiver2; + else if (!strcmp(e,"invmoder")) numerr = invmoder; + else if (!strcmp(e,"accurer")) numerr = accurer; + else if (!strcmp(e,"archer")) numerr = archer; + else if (*e) err(impl,"this trap keyword"); + /* TO BE CONTINUED */ + + if (f && r) + { /* explicit recovery text */ + char *a = get_analyseur(); + gpmem_t av = avma; + + CATCH(numerr) { x = NULL; } + TRY { x = lisseq(f); } ENDCATCH; + if (!x) { avma = av; x = lisseq(r); } + set_analyseur(a); return x; + } + + F = f? f: r; /* define a default handler */ + /* default will execute F (or start a break loop), then jump to + * environnement */ + if (F) + { + if (!*F || (*F == '"' && F[1] == '"')) /* unset previous handler */ + {/* TODO: find a better interface + * TODO: no leaked handler from the library should have survived + */ + err_leave_default(numerr); + return x; + } + F = pari_strdup(F); + } + (void)err_catch(numerr, NULL, F); + return x; +} + /*******************************************************************/ /* */ /* CLONING & COPY */ @@ -1158,8 +1265,7 @@ gcopy(GEN x) for ( ; ilen = t; - p->x = gcopy_av(x, &AVMA); + p->x = gcopy_av0(x, &AVMA); p->base= AVMA; return p; } @@ -1300,11 +1470,11 @@ bin_copy(GENbin *p) GEN x,y,base; long dx,len; + x = p->x; if (!x) { free(p); return gzero; } len = p->len; - x = p->x; base= p->base; dx = x - base; y = (GEN)memcpy((void*)new_chunk(len), (void*)GENbase(p), len*sizeof(long)); - if (dx) { y += dx; shiftaddress(y, (y-x)*sizeof(long)); } + y += dx; shiftaddress(y, (y-x)*sizeof(long)); free(p); return y; } @@ -1321,11 +1491,11 @@ bin_copy(GENbin *p) * stackdummy(z,l); z += l; We lose l words but save a costly gerepile. */ void -stackdummy(GEN z, long l) { z[0] = evaltyp(t_STR) | evallg(l); } +stackdummy(GEN z, long l) { z[0] = evaltyp(t_VECSMALL) | evallg(l); } /* gerepileupto(av, forcecopy(x)) */ GEN -gerepilecopy(long av, GEN x) +gerepilecopy(gpmem_t av, GEN x) { GENbin *p = copy_bin(x); avma = av; return bin_copy(p); @@ -1335,10 +1505,10 @@ gerepilecopy(long av, GEN x) * objects to contiguous locations and cleans up the stack between * av and avma. */ void -gerepilemany(long av, GEN* gptr[], long n) +gerepilemany(gpmem_t av, GEN* gptr[], int n) { GENbin **l = (GENbin**)gpmalloc(n*sizeof(GENbin*)); - long i; + int i; for (i=0; i=0; i--) *(gptr[i]) = bin_copy(l[i]); + free(l); free(gptr); +} + +void +gerepilemanycoeffs(gpmem_t av, GEN x, int n) +{ + int i; for (i=0; i= (ulong)av2) *g1 += dec; /* Update address if in stack */ - else if (*g1 >=(ulong)av) err(gerper); + if (*g1 >= av2) *g1 += dec; /* Update address if in stack */ + else if (*g1 >= av) err(gerper); } } } @@ -1388,26 +1573,27 @@ gerepilemanysp(long av, long tetpil, GEN* gptr[], long /* Takes an array of GENs (cast to longs), of length n. * Cleans up the stack between av and tetpil, updating those GENs. */ void -gerepilemanyvec(long av, long tetpil, long *g, long n) +gerepilemanyvec(gpmem_t av, gpmem_t tetpil, long *g, int n) { - const long av2 = avma, dec = av-tetpil; - long i; + const gpmem_t av2 = avma; + const size_t dec = av-tetpil; + int i; (void)gerepile(av,tetpil,NULL); for (i=0; i= (ulong)av2) *g += dec;/* Update addresses if in stack */ - else if ((ulong)*g >= (ulong)av) err(gerper); + if ((gpmem_t)*g >= av2) *g += dec;/* Update addresses if in stack */ + else if ((gpmem_t)*g >= av) err(gerper); } } GEN -gerepileupto(long av, GEN q) +gerepileupto(gpmem_t av, GEN q) { - if (!isonstack(q)) { avma=av; return q; } /* universal object */ + if (!isonstack(q)) { avma = av; return q; } /* universal object */ /* empty garbage */ - if ((ulong)av <= (ulong)q) return q; + if (av <= (gpmem_t)q) return q; /* The garbage is only empty when av==q. It's probably a mistake if * av < q. But "temporary variables" from sumiter are a problem since * ep->values are returned as-is by identifier() and they can be in the @@ -1416,27 +1602,27 @@ gerepileupto(long av, GEN q) */ /* Beware: (long)(q+i) --> ((long)q)+i*sizeof(long) */ - return gerepile(av, (long) (q+lg(q)), q); + return gerepile(av, (gpmem_t) (q+lg(q)), q); } /* internal */ GEN -gerepileuptoleaf(long av, GEN q) +gerepileuptoleaf(gpmem_t av, GEN q) { long i; GEN q0; - if (!isonstack(q) || av==(long)q) { avma=av; return q; } - i=lg(q); avma = (long)(((GEN)av) - i); + if (!isonstack(q) || av==(gpmem_t)q) { avma = av; return q; } + i=lg(q); avma = (gpmem_t)(((GEN)av) - i); q0 = (GEN)avma; while (--i >= 0) q0[i]=q[i]; return q0; } /* internal */ GEN -gerepileuptoint(long av, GEN q) +gerepileuptoint(gpmem_t av, GEN q) { - if (!isonstack(q) || av==(long)q) { avma=av; return q; } - avma = (long)icopy_av(q, (GEN)av); + if (!isonstack(q) || (GEN)av==q) { avma = av; return q; } + avma = (gpmem_t)icopy_av(q, (GEN)av); return (GEN)avma; } @@ -1468,19 +1654,20 @@ int ok_gerepileupto(GEN x) { return _ok_gerepileupto(x, x); } GEN -gerepile(long av, long tetpil, GEN q) +gerepile(gpmem_t av, gpmem_t tetpil, GEN q) { - long avmb, dec = av - tetpil; + gpmem_t avmb; + size_t dec = av - tetpil; GEN ll,a,b; if (dec==0) return q; - if (dec<0) err(talker,"lbot>ltop in gerepile"); + if ((long)dec<0) err(talker,"lbot>ltop in gerepile"); - if ((ulong)q>=(ulong)avma && (ulong)q<(ulong)tetpil) - q = (GEN) (((long)q) + dec); + if ((gpmem_t)q >= avma && (gpmem_t)q < tetpil) + q = (GEN) (((gpmem_t)q) + dec); for (ll=(GEN)av, a=(GEN)tetpil; a > (GEN)avma; ) *--ll= *--a; - avmb = (long)ll; + avmb = (gpmem_t)ll; while (ll < (GEN)av) { const long tl=typ(ll); @@ -1489,33 +1676,24 @@ gerepile(long av, long tetpil, GEN q) a = ll+lontyp[tl]; if (tl==t_POL) { b=ll+lgef(ll); ll+=lg(ll); } else { ll+=lg(ll); b=ll; } for ( ; a= (ulong)avma) + if ((gpmem_t)*a < av && (gpmem_t)*a >= avma) { - if ((ulong)*a < (ulong)tetpil) *a += dec; else err(gerper); + if ((gpmem_t)*a < tetpil) *a += dec; else err(gerper); } } avma = avmb; return q; } long -allocatemoremem(ulong newsize) +allocatemoremem(size_t newsize) { - long sizeold = top - bot, newbot; - if (!newsize) { - newsize = sizeold << 1; - err(warner,"doubling stack size; new stack = %ld (%.3f Mbytes)", + newsize = (top - bot) << 1; + err(warner,"doubling stack size; new stack = %lu (%.3f Mbytes)", newsize, newsize/1048576.); } - else if ((long)newsize < 1000L) - err(talker,"required stack memory too small"); - /* can't do bot = malloc directly, in case we lack memory */ - newsize = fix_size(newsize); - newbot = (long) gpmalloc(newsize); - free((void*)bot); bot = newbot; - memused = avma = top = bot + newsize; - return newsize; + return init_stack(newsize); } /* alternate stack management routine */ @@ -1524,9 +1702,9 @@ switch_stack(stackzone *z, long n) { if (!z) { /* create parallel stack */ - long size = n*sizeof(long) + sizeof(stackzone); + size_t size = n*sizeof(long) + sizeof(stackzone); z = (stackzone*) gpmalloc(size); - z->zonetop = ((long)z) + size; + z->zonetop = ((gpmem_t)z) + size; return z; } @@ -1536,10 +1714,10 @@ switch_stack(stackzone *z, long n) z->top = top; z->avma = avma; z->memused = memused; - bot = (long) (z+1); + bot = (gpmem_t) (z+1); top = z->zonetop; avma = top; - memused = (ulong)-1; + memused = (size_t)-1; } else { /* back to normalcy */ @@ -1551,57 +1729,14 @@ switch_stack(stackzone *z, long n) return NULL; } -char* -gpmalloc(size_t bytes) -{ - char *tmp; - - if (bytes) - { - tmp = (char *) malloc(bytes); - if (!tmp) err(memer); - return tmp; - } - if (DEBUGMEM) err(warner,"mallocing NULL object"); - return NULL; -} - -#if __MWERKS__ -static void * -macrealloc(void *p, size_t newsize, size_t oldsize) -{ - char *q = gpmalloc(newsize), *qq = q, *pp = p; - int l = newsize > oldsize ? oldsize : newsize; - - while (l--) *qq++ = *pp++; - free(p); return q; -} -#endif - -char* -gprealloc(void *pointer, size_t newsize, size_t oldsize) -{ - char *tmp; - - if (!pointer) tmp = (char *) malloc(newsize); -#if __MWERKS__ - else tmp = (char *) macrealloc(pointer,newsize,oldsize); -#else - else tmp = (char *) realloc(pointer,newsize); -#endif - (void)oldsize; - if (!tmp) err(memer); - return tmp; -} - #ifdef MEMSTEP void checkmemory(GEN z) { - if (DEBUGMEM && memused != (ulong)-1 && + if (DEBUGMEM && memused != (size_t)-1 && ((GEN)memused > z + MEMSTEP || z > (GEN)memused + MEMSTEP)) { - memused=(ulong)z; + memused=(size_t)z; #if MEMSTEP >= 1048576 fprintferr("...%4.0lf Mbytes used\n",(top-memused)/1048576.); #else @@ -1612,10 +1747,10 @@ checkmemory(GEN z) #endif void -init_stack() +fill_stack(void) { GEN x = ((GEN)bot); - while (x < (GEN)avma) *x++ = 0xfefefefe; + while (x < (GEN)avma) *x++ = 0xfefefefeUL; } /*******************************************************************/ @@ -1623,149 +1758,99 @@ init_stack() /* TIMER */ /* */ /*******************************************************************/ -#define MAX_TIMER 32 -#define MIN_TIMER 3 +long +_get_time(pari_timer *T, long Ticks, long TickPerSecond) +{ + long s = Ticks / TickPerSecond; + long us = (long) (Ticks % TickPerSecond) * (1000000. / TickPerSecond); + long delay = 1000 * (s - T->s) + (us - T->us) / 1000; + T->us = us; + T->s = s; return delay; +} #ifdef WINCE - static long - timer_proto(int i) - { - static DWORD oldticks[MAX_TIMER]; - DWORD ticks = GetTickCount(); - DWORD delay = ticks - oldticks[i]; - oldticks[i] = ticks; - return delay; - } +long +TIMER(pari_timer *T) +{ + return _get_time(T, GetTickCount(), 1000); +} #elif defined(macintosh) # include - static long - timer_proto(int i) - { - static long oldticks[MAX_TIMER]; - long ticks = TickCount(), delay = ticks - oldticks[i]; - - oldticks[i] = ticks; - return 50 * delay / 3; - } +long +TIMER(pari_timer *T) +{ + return _get_time(T, TickCount(), 60); +} #elif USE_TIMES # include # include # include - static long - timer_proto(int i) - { - static clock_t oldticks[MAX_TIMER]; - struct tms t; - long delay; - - times(&t); - delay = (long)((t.tms_utime - oldticks[i]) * (1000. / CLK_TCK)); - oldticks[i] = t.tms_utime; - return delay; - } +long +TIMER(pari_timer *T) +{ + struct tms t; times(&t); + return _get_time(T, t.tms_utime, CLK_TCK); +} #elif USE_GETRUSAGE # include # include - static long - timer_proto(int i) - { - static long oldmusec[MAX_TIMER],oldsec[MAX_TIMER]; - struct rusage r; - struct timeval t; - long delay; +long +TIMER(pari_timer *T) +{ + struct rusage r; + struct timeval t; + long delay; - getrusage(0,&r); t=r.ru_utime; - delay = 1000 * (t.tv_sec - oldsec[i]) + (t.tv_usec - oldmusec[i]) / 1000; - oldmusec[i] = t.tv_usec; oldsec[i] = t.tv_sec; - return delay; - } + getrusage(0,&r); t = r.ru_utime; + delay = 1000 * (t.tv_sec - T->s) + (t.tv_usec - T->us) / 1000; + T->us = t.tv_usec; + T->s = t.tv_sec; return delay; +} #elif USE_FTIME # include - static long - timer_proto(int i) - { - static long oldmsec[MAX_TIMER],oldsec[MAX_TIMER]; - struct timeb t; - long delay; +long +TIMER(pari_timer *T) +{ + struct timeb t; + long delay; - ftime(&t); - delay = 1000 * (t.time - oldsec[i]) + (t.millitm - oldmsec[i]); - oldmsec[i] = t.millitm; oldsec[i] = t.time; - return delay; - } + ftime(&t); + delay = 1000 * (t.time - T->s) + (t.millitm - T->us / 1000); + T->us = t.millitm * 1000; + T->s = t.time; return delay; +} #else # include # ifndef CLOCKS_PER_SEC # define CLOCKS_PER_SEC 1000000 /* may be false on YOUR system */ # endif - static long - timer_proto(int i) - { - static clock_t oldclocks[MAX_TIMER]; - clock_t t = clock(); - long delay = (long)((t-oldclocks[i]) * 1000. / CLOCKS_PER_SEC); - - oldclocks[i] = t; - return delay; - } -#endif - -#define is_valid_timer(t) ((t) < MAX_TIMER || (t) >= MIN_TIMER) long -gptimer() {return timer_proto(0);} -long -timer(void) {return timer_proto(1);} -long -timer2(void) {return timer_proto(2);} -long -gentimer(long t) +TIMER(pari_timer *T) { - if (!is_valid_timer(t)) - err(talker,"not an available timer (%ld)",t); - return timer_proto(t); + return _get_time(T, clock(), CLOCKS_PER_SEC); } +#endif +void +TIMERstart(pari_timer *T) { (void)TIMER(T); } -/* internal */ - long -get_timer(long t) -{ - static int used[MAX_TIMER]; - int i; - if (!t) - { /* get new timer */ - for (i=MIN_TIMER; i < MAX_TIMER; i++) - if (!used[i]) { used[i] = 1; t = i; break; } - if (!t) { t = 2; err(warner, "no timers left! Using timer2()"); } - timer_proto(t); /* init timer */ - } - else if (t < 0) - { /* initialize */ - for (i=MIN_TIMER; i < MAX_TIMER; i++) used[i] = 0; - } - else - { /* delete */ - if (!is_valid_timer(t) || !used[t]) - err(warner, "timer %ld wasn't in use", t); - else - used[t] = 0; - } - return t; -} +timer(void) { static pari_timer T; return TIMER(&T);} +long +timer2(void) { static pari_timer T; return TIMER(&T);} void -genmsgtimer(long t, char *format, ...) +msgTIMER(pari_timer *T, char *format, ...) { va_list args; PariOUT *out = pariOut; pariOut = pariErr; pariputs("Time "); va_start(args, format); vpariputs(format,args); va_end(args); - pariputsf(": %ld\n", timer_proto(t)); pariflush(); + pariputsf(": %ld\n", TIMER(T)); pariflush(); pariOut = out; } @@ -1777,7 +1862,7 @@ msgtimer(char *format, ...) pariputs("Time "); va_start(args, format); vpariputs(format,args); va_end(args); - pariputsf(": %ld\n", timer_proto(2)); pariflush(); + pariputsf(": %ld\n", timer2()); pariflush(); pariOut = out; } @@ -1848,13 +1933,13 @@ geni(void) { return gi; } * The unquoted components can be of any pari type (converted according to * the current output format) * s* any number of strings (see s) - * s*p idem, setting prettyp=1 - * s*t idem, in TeX format. + * M Mnemonic or a flag (converted to a long); description follows + * after \n at the end of the argument description * D Has a default value. Format is "Dvalue,type," (the ending comma is * mandatory). Ex: D0,L, (arg is long, 0 by default). * Special syntax: * if type = G, &, I or V: D[G&IV] all send NULL. - * if type = v: Dn sends -1. + * if type = n: Dn sends -1. * * The user-given args are read first, then completed by the defaults * @@ -1913,8 +1998,13 @@ entree functions_basic[]={ {"bernfrac",11,(void*)bernfrac,3,"L"}, {"bernreal",99,(void*)bernreal,3,"Lp"}, {"bernvec",11,(void*)bernvec,3,"L"}, +{"besselh1",29,(void*)hbessel1,3,"GGp"}, +{"besselh2",29,(void*)hbessel2,3,"GGp"}, +{"besseli",29,(void*)ibessel,3,"GGp"}, +{"besselj",29,(void*)jbessel,3,"GGp"}, {"besseljh",29,(void*)jbesselh,3,"GGp"}, {"besselk",99,(void*)kbessel0,3,"GGD0,L,p"}, +{"besseln",29,(void*)nbessel,3,"GGp"}, {"bestappr",99,(void*)bestappr0,4,"GGDG"}, {"bezout",2,(void*)vecbezout,4,"GG"}, {"bezoutres",2,(void*)vecbezoutres,4,"GG"}, @@ -1925,7 +2015,7 @@ entree functions_basic[]={ {"bitneg",99,(void*)gbitneg,2,"GD-1,L,"}, {"bitnegimply",2,(void*)gbitnegimply,2,"GG"}, {"bitor",2,(void*)gbitor,2,"GG"}, -{"bittest",2,(void*)gbittest,2,"GG"}, +{"bittest",99,(void*)gbittest3,2,"GGD1,L,"}, {"bitxor",2,(void*)gbitxor,2,"GG"}, {"bnfcertify",10,(void*)certifybuchall,6,"lG"}, {"bnfclassunit",99,(void*)bnfclassunit0,6,"GD0,L,DGp"}, @@ -1943,7 +2033,7 @@ entree functions_basic[]={ {"bnfsignunit",18,(void*)signunits,6,"G"}, {"bnfsunit",99,(void*)bnfsunit,6,"GGp"}, {"bnfunit",18,(void*)buchfu,6,"G"}, -{"bnrL1",99,(void*)bnrL1,6,"GGD0,L,p"}, +{"bnrL1",99,(void*)bnrL1,6,"GDGD0,L,p"}, {"bnrclass",99,(void*)bnrclass0,6,"GGD0,L,"}, {"bnrclassno",2,(void*)rayclassno,6,"GG"}, {"bnrclassnolist",2,(void*)rayclassnolist,6,"GG"}, @@ -1955,7 +2045,7 @@ entree functions_basic[]={ {"bnrisconductor",99,(void*)bnrisconductor,6,"lGDGDG"}, {"bnrisprincipal",99,(void*)isprincipalrayall,6,"GGD1,L,"}, {"bnrrootnumber",99,(void*)bnrrootnumber,6,"GGD0,L,p"}, -{"bnrstark",99,(void*)bnrstark,6,"GGD0,L,p"}, +{"bnrstark",99,(void*)bnrstark,6,"GDGD0,L,p"}, {"break",0,(void*)break0,11,"D1,L,"}, {"ceil",18,(void*)gceil,2,"G"}, {"centerlift",99,(void*)centerlift0,2,"GDn"}, @@ -1982,7 +2072,7 @@ entree functions_basic[]={ {"dirmul",2,(void*)dirmul,4,"GG"}, {"dirzetak",2,(void*)dirzetak,6,"GG"}, {"divisors",18,(void*)divisors,4,"G"}, -{"divrem",2,(void*)gdiventres,1,"GG"}, +{"divrem",2,(void*)divrem,1,"GGDn"}, {"eint1",99,(void*)veceint1,3,"GDGp"}, {"elladd",3,(void*)addell,5,"GGG"}, {"ellak",2,(void*)akell,5,"GG"}, @@ -2001,6 +2091,7 @@ entree functions_basic[]={ {"ellj",1,(void*)jell,5,"Gp"}, {"elllocalred",2,(void*)localreduction,5,"GG"}, {"elllseries",99,(void*)lseriesell,5,"GGDGp"}, +{"ellminimalmodel",99,(void*)ellminimalmodel,5,"GD&"}, {"ellorder",2,(void*)orderell,5,"GG"}, {"ellordinate",29,(void*)ordell,5,"GGp"}, {"ellpointtoz",29,(void*)zell,5,"GGp"}, @@ -2019,7 +2110,7 @@ entree functions_basic[]={ {"eval",18,(void*)geval,7,"G"}, {"exp",1,(void*)gexp,3,"Gp"}, {"factor",99,(void*)factor0,4,"GD-1,L,"}, -{"factorback",99,(void*)factorback,4,"GDG"}, +{"factorback",99,(void*)factorback0,4,"GDGDG"}, {"factorcantor",2,(void*)factcantor,4,"GG"}, {"factorff",3,(void*)factmod9,4,"GGG"}, {"factorial",99,(void*)mpfactr,4,"Lp"}, @@ -2034,13 +2125,16 @@ entree functions_basic[]={ {"fordiv",84,(void*)fordiv,11,"vGVI"}, {"forprime",83,(void*)forprime,11,"vV=GGI"}, {"forstep",86,(void*)forstep,11,"vV=GGGI"}, -{"forsubgroup",99,(void*)forsubgroup,11,"vV=GD0,L,I"}, +{"forsubgroup",99,(void*)forsubgroup,11,"vV=GDGI"}, {"forvec",87,(void*)forvec,11,"vV=GID0,L,"}, {"frac",18,(void*)gfrac,2,"G"}, {"galoisfixedfield",99,(void*)galoisfixedfield,6,"GGD0,L,Dn"}, {"galoisinit",99,(void*)galoisinit,6,"GDGD0,L,"}, +{"galoisisabelian",99,(void*)galoisisabelian,6,"GD0,L,"}, {"galoispermtopol",2,(void*)galoispermtopol,6,"GG"}, -{"galoissubcyclo",99,(void*)galoissubcyclo,6,"LGDGDnD0,L,"}, +{"galoissubcyclo",99,(void*)galoissubcyclo,6,"GDGD0,L,Dn"}, +{"galoissubfields",99,(void*)galoissubfields,6,"GD0,L,Dn"}, +{"galoissubgroups",18,(void*)galoissubgroups,6,"G"}, {"gamma",1,(void*)ggamma,3,"Gp"}, {"gammah",1,(void*)ggamd,3,"Gp"}, {"gcd",99,(void*)gcd0,4,"GDGD0,L,"}, @@ -2082,7 +2176,7 @@ entree functions_basic[]={ {"intnum",99,(void*)intnum0,9,"V=GGED0,L,p"}, {"isfundamental",18,(void*)gisfundamental,4,"G"}, {"isprime",99,(void*)gisprime,4,"GD0,L,"}, -{"ispseudoprime",18,(void*)gispsp,4,"G"}, +{"ispseudoprime",18,(void*)gispseudoprime,4,"GD0,L,"}, {"issquare",99,(void*)gcarrecomplet,4,"GD&"}, {"issquarefree",18,(void*)gissquarefree,4,"G"}, {"kronecker",2,(void*)gkronecker,4,"GG"}, @@ -2097,7 +2191,7 @@ entree functions_basic[]={ {"listput",25,(void*)listput,8,"GGD0,L,"}, {"listsort",99,(void*)listsort,8,"GD0,L,"}, {"lngamma",1,(void*)glngamma,3,"Gp"}, -{"log",99,(void*)log0,3,"GD0,L,p"}, +{"log",99,(void*)log0,99,"GD0,M,p\nAGM==1"}, {"matadjoint",18,(void*)adj,8,"G"}, {"matalgtobasis",2,(void*)matalgtobasis,6,"GG"}, {"matbasistoalg",2,(void*)matbasistoalg,6,"GG"}, @@ -2150,11 +2244,11 @@ entree functions_basic[]={ {"nfeltdivrem",3,(void*)nfdivres,6,"GGG"}, {"nfeltmod",3,(void*)nfmod,6,"GGG"}, {"nfeltmul",3,(void*)element_mul,6,"GGG"}, -{"nfeltmulmodpr",4,(void*)element_mulmodpr2,6,"GGGG"}, +{"nfeltmulmodpr",4,(void*)element_mulmodpr,6,"GGGG"}, {"nfeltpow",3,(void*)element_pow,6,"GGG"}, {"nfeltpowmodpr",4,(void*)element_powmodpr,6,"GGGG"}, {"nfeltreduce",3,(void*)element_reduce,6,"GGG"}, -{"nfeltreducemodpr",3,(void*)nfreducemodpr2,6,"GGG"}, +{"nfeltreducemodpr",3,(void*)nfreducemodpr,6,"GGG"}, {"nfeltval",30,(void*)element_val,6,"lGGG"}, {"nffactor",99,(void*)nffactor,6,"GG"}, {"nffactormod",99,(void*)nffactormod,6,"GGG"}, @@ -2197,15 +2291,15 @@ entree functions_basic[]={ {"pollead",99,(void*)pollead,7,"GDn"}, {"pollegendre",99,(void*)legendre,7,"LDn"}, {"polrecip",18,(void*)polrecip,7,"G"}, -{"polred",99,(void*)polred0,6,"GD0,L,DGp"}, -{"polredabs",99,(void*)polredabs0,6,"GD0,L,p"}, -{"polredord",1,(void*)ordred,6,"Gp"}, +{"polred",99,(void*)polred0,6,"GD0,L,DG"}, +{"polredabs",99,(void*)polredabs0,6,"GD0,L,"}, +{"polredord",1,(void*)ordred,6,"G"}, {"polresultant",99,(void*)polresultant0,7,"GGDnD0,L,"}, {"polroots",99,(void*)roots0,7,"GD0,L,p"}, {"polrootsmod",25,(void*)rootmod0,7,"GGD0,L,"}, {"polrootspadic",32,(void*)rootpadic,7,"GGL"}, {"polsturm",99,(void*)sturmpart,7,"lGDGDG"}, -{"polsubcyclo",99,(void*)subcyclo,7,"GGDn"}, +{"polsubcyclo",99,(void*)polsubcyclo,7,"LLDn"}, {"polsylvestermatrix",2,(void*)sylvestermatrix,7,"GG"}, {"polsym",21,(void*)polsym,7,"GL"}, {"poltchebi",99,(void*)tchebi,7,"LDn"}, @@ -2273,12 +2367,13 @@ entree functions_basic[]={ {"rnfidealup",2,(void*)rnfidealup,6,"GG"}, {"rnfinit",29,(void*)rnfinitalg,6,"GGp"}, {"rnfisfree",20,(void*)rnfisfree,6,"lGG"}, -{"rnfisnorm",99,(void*)rnfisnorm,6,"GGGD1,L,p"}, -{"rnfkummer",99,(void*)rnfkummer,6,"GGD0,L,p"}, +{"rnfisnorm",99,(void*)rnfisnorm,6,"GGD0,L,"}, +{"rnfisnorminit",99,(void*)rnfisnorminit,6,"GGD2,L,"}, +{"rnfkummer",99,(void*)rnfkummer,6,"GDGD0,L,p"}, {"rnflllgram",99,(void*)rnflllgram,6,"GGGp"}, {"rnfnormgroup",2,(void*)rnfnormgroup,6,"GG"}, {"rnfpolred",29,(void*)rnfpolred,6,"GGp"}, -{"rnfpolredabs",99,(void*)rnfpolredabs,6,"GGD0,L,p"}, +{"rnfpolredabs",99,(void*)rnfpolredabs,6,"GGD0,L,"}, {"rnfpseudobasis",2,(void*)rnfpseudobasis,6,"GG"}, {"rnfsteinitz",2,(void*)rnfsteinitz,6,"GG"}, {"round",99,(void*)round0,2,"GD&"}, @@ -2291,7 +2386,7 @@ entree functions_basic[]={ {"setrand",99,(void*)setrand,11,"lL"}, {"setsearch",99,(void*)setsearch,8,"lGGD0,L,"}, {"setunion",2,(void*)setunion,8,"GG"}, -{"shift",99,(void*)gshift,1,"GL"}, +{"shift",99,(void*)gshift3,1,"GLD0,L,"}, {"shiftmul",99,(void*)gmul2n,1,"GL"}, {"sigma",99,(void*)gsumdivk,4,"GD1,L,"}, {"sign",10,(void*)gsigne,1,"lG"}, @@ -2305,7 +2400,7 @@ entree functions_basic[]={ {"sqrt",1,(void*)gsqrt,3,"Gp"}, {"sqrtint",18,(void*)racine,4,"G"}, {"sqrtn",99,(void*)gsqrtn,3,"GGD&p"}, -{"subgrouplist",99,(void*)subgrouplist0,6,"GD0,L,D0,L,p"}, +{"subgrouplist",99,(void*)subgrouplist0,6,"GDGD0,L,p"}, {"subst",99,(void*)gsubst0,7,"GGG"}, {"sum",48,(void*)somme,9,"V=GGEDG"}, {"sumalt",99,(void*)sumalt0,9,"V=GED0,L,p"}, @@ -2330,6 +2425,7 @@ entree functions_basic[]={ {"vecmin",18,(void*)vecmin,1,"G"}, {"vecsort",99,(void*)vecsort0,8,"GDGD0,L,"}, {"vector",28,(void*)vecteur,8,"GDVDI"}, +{"vectorsmall",28,(void*)vecteursmall,8,"GDVDI"}, {"vectorv",28,(void*)vvecteur,8,"GDVDI"}, {"weber",99,(void*)weber0,3,"GD0,L,p"}, {"while",81,NULL,11,NULL},