Annotation of OpenXM/src/kan96xx/Kan/extern.h, Revision 1.6
1.6 ! takayama 1: /* $OpenXM: OpenXM/src/kan96xx/Kan/extern.h,v 1.5 2002/02/24 10:27:18 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);
68: int executeToken(struct tokens token);
69: int executePrimitive(struct object ob);
70: int isLiteral(char *str);
71: void lockCtrlCForOx();
72: void unlockCtrlCForOx();
73: void restoreCtrlCForOx();
74:
75: /* stackmachine.c export */
76: int KSdefineMacros(void);
77: struct object KSpop(void);
78: void KSpush(struct object ob);
79: char * KSstringPop(void);
80: int KSstackPointer(void);
81: struct object KSdupErrors(void);
1.3 takayama 82: struct object KSpeek(int k);
1.1 maekawa 83:
84: /* stackmachine.c context */
85: struct context *newContext0(struct context *super,char *name);
86: struct object KnewContext(struct object superobj, char *name);
87: void fprintContext(FILE *fp,struct context *c);
88: void KsetContext(struct object contextobj);
89: void contextControl(actionOfContextControl ctl);
90: struct object getSuperContext(struct object contextObj) ;
91:
92: /* kclass.c */
93: int initClassDataBase();
94: void fprintClass(FILE *fp,struct object ob);
95: int KclassEqualQ(struct object ob1,struct object ob2);
96: struct object KcreateClassIncetance(struct object ob1,
97: struct object ob2,
98: struct object ob3);
99: struct object KclassDataConversion(struct object ob1,struct object ob2);
100: /* dataConversion is also used for creating new object. */
101: /* Arithmetic functions. */
102: struct object Kclass_ooAdd(struct object ob1,struct object ob2);
103:
104: /* ErrorStack */
105: int pushErrorStack(struct object obj);
106: struct object popErrorStack(void);
107: int KScheckErrorStack(void);
108: struct object KnewErrorPacket(int serial,int no,char *message);
109: struct object KnewErrorPacketObj(struct object obj);
110:
111: /** usage.c */
112: void Kusage(struct object ob);
113: void Kusage2(FILE *fp,char *s);
114:
115: /* list.c */
116: struct object *newList(struct object *op);
117: int klength(struct object *op);
118: struct object *vJoin(struct object *list1,struct object *list2);
119: struct object car(struct object *list);
120: struct object *cdr(struct object *list);
121: void printObjectList(struct object *op);
122: int memberQ(struct object *list1,struct object list2);
123:
124: /* list:conversion */
125: struct object listToArray(struct object *op);
126: struct object *arrayToList(struct object ob);
127:
128: /* kanExport0.c */
129: /** arithmetic **/
130: struct object KooAdd(struct object ob1, struct object ob2);
131: struct object KooSub(struct object ob1, struct object ob2);
132: struct object KooMult(struct object ob1,struct object ob2);
133: struct object KooDiv(struct object ob1,struct object ob2);
134: struct object KaoMult(struct object aa,struct object bb);
135: struct object KooDiv2(struct object ob1,struct object ob2);
136: struct object KoNegate(struct object ob1);
137: struct object KreduceRationalFunction(struct object ob);
138:
139: /* for rational function object */
140: struct object KoInverse(struct object ob);
141: int KisInvalidRational(objectp ob);
142: objectp copyObjectp(objectp op);
143: struct object KnewRationalFunction0(objectp op1, objectp op2);
144: int KisZeroObject(objectp ob);
145: int KisOneObject(objectp ob);
146: int KisMinusOneObject(objectp ob);
147:
148:
149: /** relation */
150: struct object KoIsPositive(struct object ob);
151: int KooEqualQ(struct object o1,struct object o2);
152: struct object KooGreater(struct object o1,struct object o2);
153: struct object KooLess(struct object o1,struct object o2);
154:
155:
156: /** Conversion */
157: struct object KdataConversion(struct object ob1, char *key);
158: struct object KpoInteger(int i);
159: struct object KpoString(char *s);
160: struct object KpoPOLY(POLY f);
161: struct object KpoArrayOfPOLY(struct arrayOfPOLY *ap);
162: struct object KpoMatrixOfPOLY(struct matrixOfPOLY *mp);
163: struct object KpoRingp(struct ring *ringp);
164: struct object KpoDouble(double a);
165: #define KopInteger(o) ( (o).lc.ival )
166: #define KopString(o) ( (o).lc.str )
167: #define KopPOLY(o) ( (o).lc.poly )
168: #define KopArrayOfPOLY(o) ( *((o).lc.arrayp) )
169: #define KopMatrixOfPOLY(o) ( *((o).lc.matrixp))
170: #define KopArrayOfPOLYp(o) ( (o).lc.arrayp )
171: #define KopMatrixOfPOLYp(o) ( (o).lc.matrixp)
172: #define KopRingp(o) ( (o).lc.ringp )
173: #define KopUniversalNumber(o) ( (o).lc.universalNumber )
174: #define Knumerator(o) ( (o).lc.op )
175: #define Kdenominator(o) ( (o).rc.op )
176: #define KopDouble(ob) (*((ob).lc.dbl))
177: char *KPOLYToString(POLY f);
178: /** conversion 2 **/
179: struct object arrayOfPOLYToArray(struct arrayOfPOLY *aa);
180: struct object matrixOfPOLYToArray(struct matrixOfPOLY *pmat);
181: struct arrayOfPOLY *arrayToArrayOfPOLY(struct object oa);
182: struct matrixOfPOLY *arrayToMatrixOfPOLY(struct object oa);
183: double toDouble0(struct object ob);
184:
185: /** :ring :kan **/
186: int objArrayToOrderMatrix(struct object oA,int order[],int n,int oasize);
187: int KsetOrderByObjArray(struct object oA);
188: struct object oGetOrderMatrix(struct ring *ringp); /* order.c */
189: struct object KgetOrderMatrixOfCurrentRing();
190: int KsetUpRing(struct object ob1,struct object ob2, struct object ob3,struct object ob4,struct object ob5);
191: void KshowRing(struct ring *ringp);
192: struct object KdefaultPolyRing(struct object num);
193: struct object KswitchFunction(struct object ob1,struct object ob2);
194: void KprintSwitchStatus(void);
195: struct object KoReplace(struct object ob,struct object rule);
196: struct object Kparts(struct object f,struct object v);
197: struct object Kparts2(struct object f,struct object v);
198: struct object parts2(POLY f,POLY g);
199: struct object Kdegree(struct object f,struct object v);
200: struct object KringMap(struct object ob);
201: struct object Ksp(struct object ob1,struct object ob2);
202: struct object Khead(struct object ob);
203: int KpolyLength(POLY f);
204: struct object KsetOutputOrder(struct object obj,struct ring *rp);
205: struct object KsetVariableNames(struct object obj,struct ring *rp);
206:
207:
208: /* :eval */
209: struct object Keval(struct object obj);
210:
211: /** misc **/
212: struct object KtoRecords(struct object ob1);
213: void Kclose(void);
214: int warningKan(char *s);
1.4 takayama 215: int warningKanNoStrictMode(char *s);
1.1 maekawa 216: int errorKan1(char *s,char *m);
217: struct object test(struct object ob);
218: struct object Kextension(struct object ob);
219: struct object KgbExtension(struct object ob);
220: struct object KmpzExtension(struct object ob);
221:
222: /** Utilities */
223: char *KremoveSpace(char *s);
224: int KtoArgvbyCurryBrace(char *str,char *argv[],int limit);
225:
226:
227: /** kanExport1.c */
228: /* :ring :kan */
229: struct object Kreduction(struct object f,struct object set);
230: struct object Kgroebner(struct object ob);
231:
232: /* :conversion */
233: struct object gradedPolySetToGradedArray(struct gradedPolySet *gps,
234: int keepRedundant);
235: struct object polySetToArray(struct polySet *ps,int keepRedundant);
236: struct object gradedPolySetToArray(struct gradedPolySet *g,int keepRedundant);
237: struct gradedPolySet *arrayToGradedPolySet(struct object ob);
238: struct object syzPolyToArray(int size,POLY f,struct gradedPolySet *grG);
239: struct object getBackwardArray(struct gradedPolySet *grG);
240: POLY arrayToPOLY(struct object ob);
241: struct object POLYToArray(POLY f);
242: struct object oPrincipalPart(struct object ob);
243: struct object oInitW(struct object ob,struct object oWeight);
244:
245: /* :misc */
246: struct object homogenizeObject(struct object ob,int *gradep);
247: struct object homogenizeObject_vec(struct object ob,int *gradep);
248: int oGrade(struct object ob);
249: struct ring *oRingp(struct object ob);
250: struct object KisOrdered(struct object of);
251: struct object KvectorToSchreyer_es(struct object obarray);
252:
253: /* hilbert.c */
254: struct object hilberto(struct object obgb,struct object obvlist);
255:
256: /* option.c */
257: struct object KsystemVariable(struct object ob);
258:
259: void KasirKanExecute0(char *s);
260:
261: struct object KbinaryToObject(int size, char *data);
262: char *KobjectToBinary(struct object ob,int *size);
263:
264: int mmLarger_tower3(POLY ff,POLY gg,struct object *gbList); /* order.c */
265: struct object KschreyerSkelton(struct object g);
1.6 ! takayama 266:
! 267: /* misc */
! 268: struct object KregionMatches(struct object sobj, struct object keyArray);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>