Annotation of OpenXM/src/kan96xx/Kan/extern.h, Revision 1.17
1.17 ! takayama 1: /* $OpenXM: OpenXM/src/kan96xx/Kan/extern.h,v 1.16 2003/12/06 02:49:22 takayama Exp $ */
1.1 maekawa 2: /*********** global variables for module stackmachine***************/
3: extern int VerboseStack;
4: extern int DebugStack;
5: extern FILE *Fstack;
1.5 takayama 6: #if defined(__CYGWIN__)
7: extern sigjmp_buf EnvOfStackMachine;
8: #else
1.1 maekawa 9: extern jmp_buf EnvOfStackMachine;
1.5 takayama 10: #endif
1.1 maekawa 11: extern struct object NullObject;
12: extern struct object NoObject;
13: extern int Lookup[TYPES][TYPES];
14:
15:
16: /* scanner.c */
17: /*struct tokens getokenSM(actionType kind,char *str);
18: struct tokens *decomposeToTokens(char *str,int *size);*/
19: struct tokens getokenSM();
20: struct tokens *decomposeToTokens();
21: char *getLOAD_SM1_PATH();
22:
23:
24: /* stackmachine.c object */
25: struct object *newObject(void);
26: struct object newObjectArray(int size);
27: int isNullObject(struct object obj);
28:
29: /* stackmachine.c dictionary */
30: int putSystemDictionary(char *str,struct object ob);
31: int findSystemDictionary(char *str);
32: int putUserDictionary(char *str,int h0,int h1,struct object ob,
33: struct dictionary *dic);
34: struct object KputUserDictionary(char *str,struct object ob);
35: struct object findUserDictionary(char *str,int h0,int h1,
36: struct context *cp);
37: struct object KfindUserDictionary(char *str);
38: int putPrimitiveFuction(char *str,int number);
39: int hash0(char *s);
40: int hash1(char *s);
41: void hashInitialize(struct dictionary *dic);
42: struct tokens lookupTokens(struct tokens t);
43: struct object lookupLiteralString(char *s);
44: int putUserDictionary2(char *str,int h0,int h1,int attr,
45: struct dictionary *dic);
46: void KdefinePrimitiveFunctions(void);
47: struct object showSystemDictionary(int f);
48: int showUserDictionary(void) ;
49:
50:
51: /* stackmachine.c stack */
52: struct object Kpop(void); /* Kpush and Kpop may be used only in stackmachine.c
53: and primitive.c */
54: int Kpush(struct object ob);
55: struct object peek(int k);
56: void printOperandStack(void);
57: struct object newOperandStack(int size);
58: void setOperandStack(struct object ob);
59: void stdOperandStack(void);
60:
61: /* stackmachine.c printing */
62: void printObject(struct object ob,int nl,FILE *fp) ;
63: void printObjectArray(struct object ob,int nl,FILE *fp);
64:
65: /* stackmachine.c misc*/
66: void scanner(void);
67: void ctrlC(int sig);
1.7 takayama 68: void cancelAlarm();
1.1 maekawa 69: int executeToken(struct tokens token);
70: int executePrimitive(struct object ob);
71: int isLiteral(char *str);
72: void lockCtrlCForOx();
73: void unlockCtrlCForOx();
74: void restoreCtrlCForOx();
75:
76: /* stackmachine.c export */
77: int KSdefineMacros(void);
78: struct object KSpop(void);
79: void KSpush(struct object ob);
80: char * KSstringPop(void);
81: int KSstackPointer(void);
82: struct object KSdupErrors(void);
1.3 takayama 83: struct object KSpeek(int k);
1.1 maekawa 84:
85: /* stackmachine.c context */
86: struct context *newContext0(struct context *super,char *name);
87: struct object KnewContext(struct object superobj, char *name);
88: void fprintContext(FILE *fp,struct context *c);
89: void KsetContext(struct object contextobj);
90: void contextControl(actionOfContextControl ctl);
91: struct object getSuperContext(struct object contextObj) ;
92:
93: /* kclass.c */
94: int initClassDataBase();
95: void fprintClass(FILE *fp,struct object ob);
96: int KclassEqualQ(struct object ob1,struct object ob2);
97: struct object KcreateClassIncetance(struct object ob1,
98: struct object ob2,
99: struct object ob3);
100: struct object KclassDataConversion(struct object ob1,struct object ob2);
101: /* dataConversion is also used for creating new object. */
102: /* Arithmetic functions. */
103: struct object Kclass_ooAdd(struct object ob1,struct object ob2);
104:
105: /* ErrorStack */
106: int pushErrorStack(struct object obj);
107: struct object popErrorStack(void);
108: int KScheckErrorStack(void);
109: struct object KnewErrorPacket(int serial,int no,char *message);
110: struct object KnewErrorPacketObj(struct object obj);
111:
112: /** usage.c */
113: void Kusage(struct object ob);
114: void Kusage2(FILE *fp,char *s);
115:
116: /* list.c */
117: struct object *newList(struct object *op);
118: int klength(struct object *op);
119: struct object *vJoin(struct object *list1,struct object *list2);
120: struct object car(struct object *list);
121: struct object *cdr(struct object *list);
122: void printObjectList(struct object *op);
123: int memberQ(struct object *list1,struct object list2);
124:
125: /* list:conversion */
126: struct object listToArray(struct object *op);
127: struct object *arrayToList(struct object ob);
128:
129: /* kanExport0.c */
130: /** arithmetic **/
131: struct object KooAdd(struct object ob1, struct object ob2);
132: struct object KooSub(struct object ob1, struct object ob2);
133: struct object KooMult(struct object ob1,struct object ob2);
134: struct object KooDiv(struct object ob1,struct object ob2);
135: struct object KaoMult(struct object aa,struct object bb);
136: struct object KooDiv2(struct object ob1,struct object ob2);
137: struct object KoNegate(struct object ob1);
138: struct object KreduceRationalFunction(struct object ob);
1.16 takayama 139: struct object KooPower(struct object ob1,struct object ob2);
1.1 maekawa 140:
141: /* for rational function object */
142: struct object KoInverse(struct object ob);
143: int KisInvalidRational(objectp ob);
144: objectp copyObjectp(objectp op);
145: struct object KnewRationalFunction0(objectp op1, objectp op2);
146: int KisZeroObject(objectp ob);
147: int KisOneObject(objectp ob);
148: int KisMinusOneObject(objectp ob);
149:
150:
151: /** relation */
152: struct object KoIsPositive(struct object ob);
153: int KooEqualQ(struct object o1,struct object o2);
154: struct object KooGreater(struct object o1,struct object o2);
155: struct object KooLess(struct object o1,struct object o2);
156:
157:
158: /** Conversion */
159: struct object KdataConversion(struct object ob1, char *key);
160: struct object KpoInteger(int i);
161: struct object KpoString(char *s);
162: struct object KpoPOLY(POLY f);
163: struct object KpoArrayOfPOLY(struct arrayOfPOLY *ap);
164: struct object KpoMatrixOfPOLY(struct matrixOfPOLY *mp);
165: struct object KpoRingp(struct ring *ringp);
166: struct object KpoDouble(double a);
1.17 ! takayama 167: struct object KpoUniversalNumber(struct coeff *u);
1.1 maekawa 168: #define KopInteger(o) ( (o).lc.ival )
169: #define KopString(o) ( (o).lc.str )
170: #define KopPOLY(o) ( (o).lc.poly )
171: #define KopArrayOfPOLY(o) ( *((o).lc.arrayp) )
172: #define KopMatrixOfPOLY(o) ( *((o).lc.matrixp))
173: #define KopArrayOfPOLYp(o) ( (o).lc.arrayp )
174: #define KopMatrixOfPOLYp(o) ( (o).lc.matrixp)
175: #define KopRingp(o) ( (o).lc.ringp )
176: #define KopUniversalNumber(o) ( (o).lc.universalNumber )
177: #define Knumerator(o) ( (o).lc.op )
178: #define Kdenominator(o) ( (o).rc.op )
179: #define KopDouble(ob) (*((ob).lc.dbl))
180: char *KPOLYToString(POLY f);
181: /** conversion 2 **/
182: struct object arrayOfPOLYToArray(struct arrayOfPOLY *aa);
183: struct object matrixOfPOLYToArray(struct matrixOfPOLY *pmat);
184: struct arrayOfPOLY *arrayToArrayOfPOLY(struct object oa);
185: struct matrixOfPOLY *arrayToMatrixOfPOLY(struct object oa);
186: double toDouble0(struct object ob);
187:
188: /** :ring :kan **/
189: int objArrayToOrderMatrix(struct object oA,int order[],int n,int oasize);
190: int KsetOrderByObjArray(struct object oA);
191: struct object oGetOrderMatrix(struct ring *ringp); /* order.c */
192: struct object KgetOrderMatrixOfCurrentRing();
1.17 ! takayama 193: struct object oRingToOXringStructure(struct ring *ringp); /* order.c */
1.1 maekawa 194: int KsetUpRing(struct object ob1,struct object ob2, struct object ob3,struct object ob4,struct object ob5);
195: void KshowRing(struct ring *ringp);
196: struct object KdefaultPolyRing(struct object num);
197: struct object KswitchFunction(struct object ob1,struct object ob2);
198: void KprintSwitchStatus(void);
199: struct object KoReplace(struct object ob,struct object rule);
200: struct object Kparts(struct object f,struct object v);
201: struct object Kparts2(struct object f,struct object v);
202: struct object parts2(POLY f,POLY g);
203: struct object Kdegree(struct object f,struct object v);
204: struct object KringMap(struct object ob);
205: struct object Ksp(struct object ob1,struct object ob2);
206: struct object Khead(struct object ob);
207: int KpolyLength(POLY f);
208: struct object KsetOutputOrder(struct object obj,struct ring *rp);
209: struct object KsetVariableNames(struct object obj,struct ring *rp);
210:
211:
212: /* :eval */
213: struct object Keval(struct object obj);
214:
215: /** misc **/
216: struct object KtoRecords(struct object ob1);
1.9 takayama 217: struct object KstringToArgv(struct object ob1);
1.1 maekawa 218: void Kclose(void);
219: int warningKan(char *s);
1.4 takayama 220: int warningKanNoStrictMode(char *s);
1.1 maekawa 221: int errorKan1(char *s,char *m);
222: struct object test(struct object ob);
223: struct object Kextension(struct object ob);
224: struct object KgbExtension(struct object ob);
225: struct object KmpzExtension(struct object ob);
226:
227: /** Utilities */
228: char *KremoveSpace(char *s);
229: int KtoArgvbyCurryBrace(char *str,char *argv[],int limit);
230:
231:
232: /** kanExport1.c */
233: /* :ring :kan */
234: struct object Kreduction(struct object f,struct object set);
235: struct object Kgroebner(struct object ob);
236:
237: /* :conversion */
238: struct object gradedPolySetToGradedArray(struct gradedPolySet *gps,
239: int keepRedundant);
240: struct object polySetToArray(struct polySet *ps,int keepRedundant);
241: struct object gradedPolySetToArray(struct gradedPolySet *g,int keepRedundant);
242: struct gradedPolySet *arrayToGradedPolySet(struct object ob);
243: struct object syzPolyToArray(int size,POLY f,struct gradedPolySet *grG);
244: struct object getBackwardArray(struct gradedPolySet *grG);
245: POLY arrayToPOLY(struct object ob);
246: struct object POLYToArray(POLY f);
247: struct object oPrincipalPart(struct object ob);
248: struct object oInitW(struct object ob,struct object oWeight);
1.11 takayama 249: struct object KordWsAll(struct object ob,struct object oWeight);
1.1 maekawa 250:
251: /* :misc */
252: struct object homogenizeObject(struct object ob,int *gradep);
253: struct object homogenizeObject_vec(struct object ob,int *gradep);
1.8 takayama 254: struct object homogenizeObject_go(struct object ob,int *gradep);
1.12 takayama 255: void KresetDegreeShift(void);
1.1 maekawa 256: int oGrade(struct object ob);
257: struct ring *oRingp(struct object ob);
258: struct object KisOrdered(struct object of);
259: struct object KvectorToSchreyer_es(struct object obarray);
1.10 takayama 260: POLY objArrayToPOLY(struct object ob);
261: struct object POLYtoObjArray(POLY f,int size);
1.1 maekawa 262:
263: /* hilbert.c */
264: struct object hilberto(struct object obgb,struct object obvlist);
265:
266: /* option.c */
267: struct object KsystemVariable(struct object ob);
268:
269: void KasirKanExecute0(char *s);
270:
271: struct object KbinaryToObject(int size, char *data);
272: char *KobjectToBinary(struct object ob,int *size);
273:
274: int mmLarger_tower3(POLY ff,POLY gg,struct object *gbList); /* order.c */
275: struct object KschreyerSkelton(struct object g);
1.6 takayama 276:
277: /* misc */
278: struct object KregionMatches(struct object sobj, struct object keyArray);
1.8 takayama 279: int objToInteger(struct object ob);
1.13 takayama 280:
281: /* shell.c */
282: struct object KoxWhich(struct object cmdo,struct object patho);
1.14 takayama 283: struct object KoxShell(struct object ob);
1.15 takayama 284: void KoxShellHelp(char *key,FILE *fp);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>