Annotation of OpenXM_contrib2/asir2000/parse/function.c, Revision 1.1
1.1 ! noro 1: /* $OpenXM: OpenXM/src/asir99/parse/function.c,v 1.2 1999/11/18 05:42:03 noro Exp $ */
! 2: #include "ca.h"
! 3: #include "parse.h"
! 4:
! 5: void appendbinf(flistp,name,func,argc)
! 6: NODE *flistp;
! 7: char *name;
! 8: void (*func)();
! 9: int argc;
! 10: {
! 11: FUNC t;
! 12: NODE n;
! 13:
! 14: t = (FUNC)MALLOC(sizeof(struct oFUNC));
! 15: t->name = name; t->id = A_BIN; t->argc = argc; t->f.binf = func;
! 16: MKNODE(n,t,*flistp); *flistp = n;
! 17: }
! 18:
! 19: void appendparif(flistp,name,func,type)
! 20: NODE *flistp;
! 21: char *name;
! 22: int (*func)();
! 23: int type;
! 24: {
! 25: FUNC t;
! 26: NODE n;
! 27:
! 28: t = (FUNC)MALLOC(sizeof(struct oFUNC));
! 29: t->name = name; t->id = A_PARI; t->type = type; t->f.binf = (void (*)())func;
! 30: MKNODE(n,t,*flistp); *flistp = n;
! 31: }
! 32:
! 33: void appendsysf(name,func,argc)
! 34: char *name;
! 35: void (*func)();
! 36: int argc;
! 37: {
! 38: appendbinf(&sysf,name,func,argc);
! 39: }
! 40:
! 41: void appendubinf(name,func,argc)
! 42: char *name;
! 43: void (*func)();
! 44: int argc;
! 45: {
! 46: appendbinf(&ubinf,name,func,argc);
! 47: }
! 48:
! 49: void dcptolist(dc,listp)
! 50: DCP dc;
! 51: LIST *listp;
! 52: {
! 53: NODE node,tnode,ln0,ln1;
! 54: LIST l;
! 55:
! 56: for ( node = 0; dc; dc = NEXT(dc) ) {
! 57: NEXTNODE(node,tnode);
! 58: MKNODE(ln1,DEG(dc),0); MKNODE(ln0,COEF(dc),ln1);
! 59: MKLIST(l,ln0); BDY(tnode) = (pointer)l;
! 60: }
! 61: NEXT(tnode) = 0; MKLIST(l,node); *listp = l;
! 62: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>