version 1.17, 2003/04/02 09:43:33 |
version 1.18, 2003/05/14 06:20:12 |
|
|
* 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/parse/parse.h,v 1.16 2002/01/28 00:54:44 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/parse.h,v 1.17 2003/04/02 09:43:33 ohara Exp $ |
*/ |
*/ |
# if defined(VISUAL) |
# if defined(VISUAL) |
#include <time.h> |
#include <time.h> |
Line 96 typedef enum { A_UNDEF, A_BIN, A_USR, A_PURE, A_PARI } |
|
Line 96 typedef enum { A_UNDEF, A_BIN, A_USR, A_PURE, A_PARI } |
|
|
|
typedef enum { V_IND, V_UC, V_PF, V_SR } vid; |
typedef enum { V_IND, V_UC, V_PF, V_SR } vid; |
|
|
struct oVS { |
typedef struct oVS { |
unsigned int n; |
unsigned int n; |
unsigned int asize; |
unsigned int asize; |
unsigned int at; |
unsigned int at; |
|
|
struct oFUNC *usrf; |
struct oFUNC *usrf; |
struct oPV *va; |
struct oPV *va; |
NODE opt; |
NODE opt; |
}; |
} *VS; |
|
|
typedef struct oVS *VS; |
typedef struct oMODULE { |
|
char *name; |
|
VS pvs; |
|
NODE usrf_list; |
|
} *MODULE; |
|
|
struct oPV { |
typedef struct oPV { |
char *name; |
char *name; |
short attr,type; |
short attr,type; |
pointer priv; |
pointer priv; |
}; |
} *PV; |
|
|
typedef struct oPV *PV; |
typedef struct oINFILE { |
|
|
struct oINFILE { |
|
char *name; |
char *name; |
FILE *fp; |
FILE *fp; |
int ln; |
int ln; |
Line 124 struct oINFILE { |
|
Line 126 struct oINFILE { |
|
char *tname; |
char *tname; |
int encoded; |
int encoded; |
short vol; |
short vol; |
}; |
} *INFILE; |
|
|
typedef struct oINFILE *INFILE; |
|
|
|
struct oTKWD { |
struct oTKWD { |
char *name; |
char *name; |
int token; |
int token; |
}; |
}; |
|
|
struct oARF { |
typedef struct oARF { |
char *name; |
char *name; |
void (*fp)(); |
void (*fp)(); |
}; |
} *ARF; |
|
|
typedef struct oARF *ARF; |
typedef struct oFUNC { |
|
|
struct oFUNC { |
|
char *name; |
char *name; |
int argc; |
int argc; |
int type; |
int type; |
|
|
struct oUSRF *usrf; |
struct oUSRF *usrf; |
struct oPF *puref; |
struct oPF *puref; |
} f; |
} f; |
}; |
} *FUNC; |
|
|
typedef struct oFUNC *FUNC; |
typedef struct oUSRF { |
|
|
struct oUSRF { |
|
char *fname; |
char *fname; |
short vol; |
MODULE module; |
int startl,endl; |
int startl,endl; |
NODE args; |
NODE args; |
VS pvs; |
VS pvs; |
char *desc; |
char *desc; |
struct oSNODE *body; |
struct oSNODE *body; |
}; |
} *USRF; |
|
|
typedef struct oUSRF *USRF; |
typedef struct oPF { |
|
|
struct oPF { |
|
char *name; |
char *name; |
int argc; |
int argc; |
Obj body; |
Obj body; |
|
|
int (*pari)(); |
int (*pari)(); |
double (*libm)(); |
double (*libm)(); |
int (*simplify)(); |
int (*simplify)(); |
}; |
} *PF; |
|
|
typedef struct oPF *PF; |
typedef struct oPFAD { |
|
|
struct oPFAD { |
|
Obj arg; |
Obj arg; |
int d; |
int d; |
}; |
} *PFAD; |
|
|
typedef struct oPFAD *PFAD; |
typedef struct oPFINS { |
|
|
struct oPFINS { |
|
struct oPF *pf; |
struct oPF *pf; |
struct oPFAD ad[1]; |
struct oPFAD ad[1]; |
}; |
} *PFINS; |
|
|
typedef struct oPFINS *PFINS; |
|
|
|
#define NEWPF(p) ((p)=(PF)MALLOC(sizeof(struct oPF))) |
#define NEWPF(p) ((p)=(PF)MALLOC(sizeof(struct oPF))) |
|
|
struct oFNODE { |
typedef struct oFNODE { |
fid id; |
fid id; |
pointer arg[1]; |
pointer arg[1]; |
}; |
} *FNODE; |
|
|
typedef struct oFNODE *FNODE; |
|
|
|
#define NEWFNODE(a,b) \ |
#define NEWFNODE(a,b) \ |
((a)=(FNODE)MALLOC(sizeof(struct oFNODE)+sizeof(pointer)*(b-1))) |
((a)=(FNODE)MALLOC(sizeof(struct oFNODE)+sizeof(pointer)*(b-1))) |
|
|
struct oSNODE { |
typedef struct oSNODE { |
sid id; |
sid id; |
int ln; |
int ln; |
pointer arg[1]; |
pointer arg[1]; |
}; |
} *SNODE; |
|
|
typedef struct oSNODE *SNODE; |
|
|
|
#define NEWSNODE(a,b) \ |
#define NEWSNODE(a,b) \ |
((a)=(SNODE)MALLOC(sizeof(struct oSNODE)+sizeof(pointer)*(b-1)),(a)->ln=asir_infile->ln) |
((a)=(SNODE)MALLOC(sizeof(struct oSNODE)+sizeof(pointer)*(b-1)),(a)->ln=asir_infile->ln) |
|
|
struct oPVI { |
typedef struct oPVI { |
int pv; |
int pv; |
NODE index; |
NODE index; |
}; |
} *PVI; |
|
|
typedef struct oPVI *PVI; |
typedef struct oNODE2 { |
|
|
struct oNODE2 { |
|
pointer body1,body2; |
pointer body1,body2; |
struct oNODE2 *next; |
struct oNODE2 *next; |
}; |
} *NODE2; |
|
|
typedef struct oNODE2 *NODE2; |
|
|
|
struct ftab { |
struct ftab { |
char *name; |
char *name; |
void (*f)(); |
void (*f)(); |
Line 283 switch ( id ) {\ |
|
Line 263 switch ( id ) {\ |
|
} |
} |
|
|
#define DEFSIZE 32 |
#define DEFSIZE 32 |
#define MSB (1<<31) |
#define PVGLOBAL(i) (((unsigned int)(i))|(1<<30)) |
|
#define PVMGLOBAL(i) (((unsigned int)(i))|(3<<30)) |
|
#define PVATTR(i) (((unsigned int)(i))>>30) |
|
#define PVIND(i) (((unsigned int)(i))&0x3fffffff) |
#define GETPV(i,p) \ |
#define GETPV(i,p) \ |
((int)(i)>=0 ? (int)((p)=CPVS->va[(unsigned int)(i)].priv)\ |
(PVATTR(i)==0?(int)((p)=CPVS->va[(unsigned int)(i)].priv)\ |
: (int)((p)=GPVS->va[(unsigned int)(i)&(~MSB)].priv)) |
:PVATTR(i)==1?(int)((p)=GPVS->va[PVIND(i)].priv)\ |
|
:(int)((p)=MPVS->va[PVIND(i)].priv)) |
|
#define GETPVREF(i,p) \ |
|
(PVATTR(i)==0?(int)((p)=&(CPVS->va[(unsigned int)(i)].priv))\ |
|
:PVATTR(i)==1?(int)((p)=&(GPVS->va[PVIND(i)].priv))\ |
|
:(int)((p)=&(MPVS->va[PVIND(i)].priv))) |
#define GETPVNAME(i,p) \ |
#define GETPVNAME(i,p) \ |
((int)(i)>=0 ? (int)((p)=CPVS->va[(unsigned int)(i)].name)\ |
(PVATTR(i)==0?(int)((p)=CPVS->va[(unsigned int)(i)].name)\ |
: (int)((p)=GPVS->va[(unsigned int)(i)&(~MSB)].name)) |
:PVATTR(i)==1?(int)((p)=GPVS->va[PVIND(i)].name)\ |
|
:(int)((p)=MPVS->va[PVIND(i)].name)) |
#define ASSPV(i,p) \ |
#define ASSPV(i,p) \ |
((int)(i)>=0 ? (int)(CPVS->va[(unsigned int)(i)].priv=(pointer)(p))\ |
(PVATTR(i)==0?(int)(CPVS->va[(unsigned int)(i)].priv=(pointer)(p))\ |
: (int)(GPVS->va[(unsigned int)(i)&(~MSB)].priv=(pointer)(p))) |
:PVATTR(i)==1?(int)(GPVS->va[PVIND(i)].priv=(pointer)(p))\ |
|
:(int)(MPVS->va[PVIND(i)].priv=(pointer)(p))) |
|
|
#define NEWNODE2(a) ((a)=(NODE2)MALLOC(sizeof(struct oNODE2))) |
#define NEWNODE2(a) ((a)=(NODE2)MALLOC(sizeof(struct oNODE2))) |
#define MKNODE2(a,b,c,d) \ |
#define MKNODE2(a,b,c,d) \ |
Line 300 switch ( id ) {\ |
|
Line 290 switch ( id ) {\ |
|
#define BDY1(a) ((a)->body1) |
#define BDY1(a) ((a)->body1) |
#define BDY2(a) ((a)->body2) |
#define BDY2(a) ((a)->body2) |
|
|
extern VS GPVS,CPVS,EPVS,APVS; |
extern VS GPVS,CPVS,EPVS,APVS,MPVS; |
|
extern MODULE CUR_MODULE; |
|
extern NODE MODULE_LIST; |
extern ARF addfs, subfs, mulfs, divfs, remfs, pwrfs; |
extern ARF addfs, subfs, mulfs, divfs, remfs, pwrfs; |
extern INFILE asir_infile; |
extern INFILE asir_infile; |
extern NODE usrf,sysf,noargsysf,ubinf,parif,ONENODE; |
extern NODE usrf,sysf,noargsysf,ubinf,parif,ONENODE; |
Line 502 int gettype(unsigned int); |
|
Line 494 int gettype(unsigned int); |
|
int indextotype(int,int); |
int indextotype(int,int); |
int loadfile(char *); |
int loadfile(char *); |
int loadfiles(NODE); |
int loadfiles(NODE); |
int makepvar(char *); |
unsigned int makepvar(char *); |
int membertoindex(int,char *); |
int membertoindex(int,char *); |
int qcoefp(Obj); |
int qcoefp(Obj); |
int qcoefr(Obj); |
int qcoefr(Obj); |
Line 550 void instov(PFINS ,V *); |
|
Line 542 void instov(PFINS ,V *); |
|
Obj memberofstruct(COMP,char *); |
Obj memberofstruct(COMP,char *); |
void mkpf(char *,Obj ,int ,V *,int (*)(),double (*)(),int (*)(),PF *); |
void mkpf(char *,Obj ,int ,V *,int (*)(),double (*)(),int (*)(),PF *); |
void mkpfins(PF ,V *,V *); |
void mkpfins(PF ,V *,V *); |
void mkuf(char *,char *,NODE,SNODE,int,int,char *); |
void mkuf(char *,char *,NODE,SNODE,int,int,char *,MODULE); |
void newstruct(int,struct oCOMP **); |
void newstruct(int,struct oCOMP **); |
void optobj(Obj *); |
void optobj(Obj *); |
void println(int, char **, int); |
void println(int, char **, int); |
Line 778 int small_jacobi(int a,int m); |
|
Line 770 int small_jacobi(int a,int m); |
|
void mkpvs(); |
void mkpvs(); |
void pushpvs(FUNC f); |
void pushpvs(FUNC f); |
void poppvs(); |
void poppvs(); |
int makepvar(char *str); |
unsigned int makepvar(char *str); |
int searchpvar(char *str); |
int searchpvar(char *str); |
int getpvar(VS pvs,char *str,int searchonly); |
int getpvar(VS pvs,char *str,int searchonly); |
void closecurrentinput(); |
void closecurrentinput(); |
Line 891 void gen_searchf(char *name,FUNC *r); |
|
Line 883 void gen_searchf(char *name,FUNC *r); |
|
void searchf(NODE fn,char *name,FUNC *r); |
void searchf(NODE fn,char *name,FUNC *r); |
void appenduf(char *name,FUNC *r); |
void appenduf(char *name,FUNC *r); |
void mkparif(char *name,FUNC *r); |
void mkparif(char *name,FUNC *r); |
void mkuf(char *name,char *fname,NODE args,SNODE body,int startl,int endl,char *desc); |
void mkuf(char *name,char *fname,NODE args,SNODE body,int startl,int endl,char *desc,MODULE module); |
Obj getopt_from_cpvs(char *key); |
Obj getopt_from_cpvs(char *key); |
void des_enc(unsigned long *, unsigned char *, unsigned long *); |
void des_enc(unsigned long *, unsigned char *, unsigned long *); |
unsigned long round_func(unsigned long , unsigned char *); |
unsigned long round_func(unsigned long , unsigned char *); |