Annotation of OpenXM/src/kan96xx/Kan/extern.h, Revision 1.32
1.32 ! takayama 1: /* $OpenXM: OpenXM/src/kan96xx/Kan/extern.h,v 1.31 2005/06/09 05:46:57 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();
1.27 takayama 75: int executeExecutableArray(struct object ob,char *fname,int withGotoP);
1.1 maekawa 76:
77: /* stackmachine.c export */
78: int KSdefineMacros(void);
79: struct object KSpop(void);
80: void KSpush(struct object ob);
81: char * KSstringPop(void);
82: int KSstackPointer(void);
83: struct object KSdupErrors(void);
1.3 takayama 84: struct object KSpeek(int k);
1.1 maekawa 85:
86: /* stackmachine.c context */
87: struct context *newContext0(struct context *super,char *name);
88: struct object KnewContext(struct object superobj, char *name);
89: void fprintContext(FILE *fp,struct context *c);
90: void KsetContext(struct object contextobj);
91: void contextControl(actionOfContextControl ctl);
92: struct object getSuperContext(struct object contextObj) ;
1.22 takayama 93:
94: /* stackmachine.c back-trace */
95: void tracePushName(char *s);
96: void traceClearStack(void);
97: char *tracePopName(void);
98: char *traceShowStack(void);
1.1 maekawa 99:
100: /* kclass.c */
101: int initClassDataBase();
102: void fprintClass(FILE *fp,struct object ob);
103: int KclassEqualQ(struct object ob1,struct object ob2);
104: struct object KcreateClassIncetance(struct object ob1,
105: struct object ob2,
106: struct object ob3);
107: struct object KclassDataConversion(struct object ob1,struct object ob2);
108: /* dataConversion is also used for creating new object. */
109: /* Arithmetic functions. */
110: struct object Kclass_ooAdd(struct object ob1,struct object ob2);
111:
112: /* ErrorStack */
113: int pushErrorStack(struct object obj);
114: struct object popErrorStack(void);
115: int KScheckErrorStack(void);
116: struct object KnewErrorPacket(int serial,int no,char *message);
117: struct object KnewErrorPacketObj(struct object obj);
118:
119: /** usage.c */
120: void Kusage(struct object ob);
121: void Kusage2(FILE *fp,char *s);
122:
123: /* list.c */
124: struct object *newList(struct object *op);
125: int klength(struct object *op);
126: struct object *vJoin(struct object *list1,struct object *list2);
127: struct object car(struct object *list);
128: struct object *cdr(struct object *list);
129: void printObjectList(struct object *op);
130: int memberQ(struct object *list1,struct object list2);
1.24 takayama 131:
132: struct object KvJoin(struct object listo1,struct object listo2);
133: struct object Kcar(struct object listo);
134: struct object Kcdr(struct object listo);
135: struct object KlistToArray(struct object listo);
136: struct object KarrayToList(struct object ob);
1.1 maekawa 137:
138: /* list:conversion */
139: struct object listToArray(struct object *op);
140: struct object *arrayToList(struct object ob);
1.29 takayama 141: struct object newByteArray(int size,struct object obj);
1.30 takayama 142: struct object newByteArrayFromStr(char *s,int size);
1.29 takayama 143: struct object byteArrayToArray(struct object obj);
1.1 maekawa 144:
145: /* kanExport0.c */
146: /** arithmetic **/
147: struct object KooAdd(struct object ob1, struct object ob2);
148: struct object KooSub(struct object ob1, struct object ob2);
149: struct object KooMult(struct object ob1,struct object ob2);
150: struct object KooDiv(struct object ob1,struct object ob2);
151: struct object KaoMult(struct object aa,struct object bb);
152: struct object KooDiv2(struct object ob1,struct object ob2);
153: struct object KoNegate(struct object ob1);
154: struct object KreduceRationalFunction(struct object ob);
1.16 takayama 155: struct object KooPower(struct object ob1,struct object ob2);
1.1 maekawa 156:
157: /* for rational function object */
158: struct object KoInverse(struct object ob);
159: int KisInvalidRational(objectp ob);
160: objectp copyObjectp(objectp op);
161: struct object KnewRationalFunction0(objectp op1, objectp op2);
162: int KisZeroObject(objectp ob);
163: int KisOneObject(objectp ob);
164: int KisMinusOneObject(objectp ob);
165:
166:
167: /** relation */
168: struct object KoIsPositive(struct object ob);
169: int KooEqualQ(struct object o1,struct object o2);
170: struct object KooGreater(struct object o1,struct object o2);
171: struct object KooLess(struct object o1,struct object o2);
172:
173:
174: /** Conversion */
175: struct object KdataConversion(struct object ob1, char *key);
1.21 takayama 176: struct object Kto_int32(struct object ob);
1.1 maekawa 177: struct object KpoInteger(int i);
178: struct object KpoString(char *s);
179: struct object KpoPOLY(POLY f);
180: struct object KpoArrayOfPOLY(struct arrayOfPOLY *ap);
181: struct object KpoMatrixOfPOLY(struct matrixOfPOLY *mp);
182: struct object KpoRingp(struct ring *ringp);
183: struct object KpoDouble(double a);
1.17 takayama 184: struct object KpoUniversalNumber(struct coeff *u);
1.19 takayama 185: struct object KintToUniversalNumber(int n);
1.1 maekawa 186: #define KopInteger(o) ( (o).lc.ival )
187: #define KopString(o) ( (o).lc.str )
188: #define KopPOLY(o) ( (o).lc.poly )
189: #define KopArrayOfPOLY(o) ( *((o).lc.arrayp) )
190: #define KopMatrixOfPOLY(o) ( *((o).lc.matrixp))
191: #define KopArrayOfPOLYp(o) ( (o).lc.arrayp )
192: #define KopMatrixOfPOLYp(o) ( (o).lc.matrixp)
193: #define KopRingp(o) ( (o).lc.ringp )
194: #define KopUniversalNumber(o) ( (o).lc.universalNumber )
195: #define Knumerator(o) ( (o).lc.op )
196: #define Kdenominator(o) ( (o).rc.op )
197: #define KopDouble(ob) (*((ob).lc.dbl))
1.29 takayama 198: #define KopByteArray(o) ( (o).lc.bytes )
199: #define getByteArraySize(o) ( (o).rc.ival )
1.1 maekawa 200: char *KPOLYToString(POLY f);
201: /** conversion 2 **/
202: struct object arrayOfPOLYToArray(struct arrayOfPOLY *aa);
203: struct object matrixOfPOLYToArray(struct matrixOfPOLY *pmat);
204: struct arrayOfPOLY *arrayToArrayOfPOLY(struct object oa);
205: struct matrixOfPOLY *arrayToMatrixOfPOLY(struct object oa);
206: double toDouble0(struct object ob);
207:
208: /** :ring :kan **/
209: int objArrayToOrderMatrix(struct object oA,int order[],int n,int oasize);
210: int KsetOrderByObjArray(struct object oA);
211: struct object oGetOrderMatrix(struct ring *ringp); /* order.c */
212: struct object KgetOrderMatrixOfCurrentRing();
1.17 takayama 213: struct object oRingToOXringStructure(struct ring *ringp); /* order.c */
1.1 maekawa 214: int KsetUpRing(struct object ob1,struct object ob2, struct object ob3,struct object ob4,struct object ob5);
215: void KshowRing(struct ring *ringp);
216: struct object KdefaultPolyRing(struct object num);
217: struct object KswitchFunction(struct object ob1,struct object ob2);
218: void KprintSwitchStatus(void);
219: struct object KoReplace(struct object ob,struct object rule);
220: struct object Kparts(struct object f,struct object v);
221: struct object Kparts2(struct object f,struct object v);
222: struct object parts2(POLY f,POLY g);
223: struct object Kdegree(struct object f,struct object v);
224: struct object KringMap(struct object ob);
225: struct object Ksp(struct object ob1,struct object ob2);
226: struct object Khead(struct object ob);
227: int KpolyLength(POLY f);
228: struct object KsetOutputOrder(struct object obj,struct ring *rp);
229: struct object KsetVariableNames(struct object obj,struct ring *rp);
1.28 takayama 230: /* KgetRingInfo has not yet been implemented. */
231: struct object KgetRingInfo(struct object ringObj, struct object ofunc);
1.1 maekawa 232:
233: /* :eval */
234: struct object Keval(struct object obj);
235:
236: /** misc **/
237: struct object KtoRecords(struct object ob1);
1.9 takayama 238: struct object KstringToArgv(struct object ob1);
1.1 maekawa 239: void Kclose(void);
240: int warningKan(char *s);
1.4 takayama 241: int warningKanNoStrictMode(char *s);
1.1 maekawa 242: int errorKan1(char *s,char *m);
243: struct object test(struct object ob);
244: struct object Kextension(struct object ob);
245: struct object KgbExtension(struct object ob);
246: struct object KmpzExtension(struct object ob);
1.23 takayama 247: struct object Krest(struct object ob);
248: struct object Kjoin(struct object ob1, struct object ob2);
1.25 takayama 249: struct object Kget(struct object ob1, struct object ob2);
1.1 maekawa 250:
251: /** Utilities */
252: char *KremoveSpace(char *s);
253: int KtoArgvbyCurryBrace(char *str,char *argv[],int limit);
1.31 takayama 254:
255: /** Attribute */
256: struct object KgetAttributeList(struct object ob);
1.32 ! takayama 257: struct object KsetAttributeList(struct object ob,struct object attr);
1.31 takayama 258: struct object KgetAttribute(struct object ob,struct object key);
1.32 ! takayama 259: struct object KsetAttribute(struct object ob,struct object key,struct object value);
! 260: /* ob (key) (value) setAttribute /ob set. They are not destructive. */
1.31 takayama 261:
1.1 maekawa 262:
263:
264: /** kanExport1.c */
265: /* :ring :kan */
266: struct object Kreduction(struct object f,struct object set);
267: struct object Kgroebner(struct object ob);
268:
269: /* :conversion */
270: struct object gradedPolySetToGradedArray(struct gradedPolySet *gps,
271: int keepRedundant);
272: struct object polySetToArray(struct polySet *ps,int keepRedundant);
273: struct object gradedPolySetToArray(struct gradedPolySet *g,int keepRedundant);
274: struct gradedPolySet *arrayToGradedPolySet(struct object ob);
275: struct object syzPolyToArray(int size,POLY f,struct gradedPolySet *grG);
276: struct object getBackwardArray(struct gradedPolySet *grG);
277: POLY arrayToPOLY(struct object ob);
278: struct object POLYToArray(POLY f);
279: struct object oPrincipalPart(struct object ob);
280: struct object oInitW(struct object ob,struct object oWeight);
1.11 takayama 281: struct object KordWsAll(struct object ob,struct object oWeight);
1.1 maekawa 282:
283: /* :misc */
284: struct object homogenizeObject(struct object ob,int *gradep);
285: struct object homogenizeObject_vec(struct object ob,int *gradep);
1.8 takayama 286: struct object homogenizeObject_go(struct object ob,int *gradep);
1.12 takayama 287: void KresetDegreeShift(void);
1.1 maekawa 288: int oGrade(struct object ob);
289: struct ring *oRingp(struct object ob);
290: struct object KisOrdered(struct object of);
291: struct object KvectorToSchreyer_es(struct object obarray);
1.10 takayama 292: POLY objArrayToPOLY(struct object ob);
293: struct object POLYtoObjArray(POLY f,int size);
1.18 takayama 294: struct object KgetExponents(struct object obPoly,struct object type);
1.1 maekawa 295:
296: /* hilbert.c */
297: struct object hilberto(struct object obgb,struct object obvlist);
298:
299: /* option.c */
300: struct object KsystemVariable(struct object ob);
301:
302: void KasirKanExecute0(char *s);
303:
304: struct object KbinaryToObject(int size, char *data);
305: char *KobjectToBinary(struct object ob,int *size);
306:
307: int mmLarger_tower3(POLY ff,POLY gg,struct object *gbList); /* order.c */
308: struct object KschreyerSkelton(struct object g);
1.6 takayama 309:
310: /* misc */
311: struct object KregionMatches(struct object sobj, struct object keyArray);
1.8 takayama 312: int objToInteger(struct object ob);
1.13 takayama 313:
314: /* shell.c */
315: struct object KoxWhich(struct object cmdo,struct object patho);
1.14 takayama 316: struct object KoxShell(struct object ob);
1.15 takayama 317: void KoxShellHelp(char *key,FILE *fp);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>