=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/extern.h,v retrieving revision 1.2 retrieving revision 1.35 diff -u -p -r1.2 -r1.35 --- OpenXM/src/kan96xx/Kan/extern.h 2000/01/16 07:55:38 1.2 +++ OpenXM/src/kan96xx/Kan/extern.h 2006/02/01 00:30:05 1.35 @@ -1,9 +1,13 @@ -/* $OpenXM$ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/extern.h,v 1.34 2005/09/27 06:10:43 takayama Exp $ */ /*********** global variables for module stackmachine***************/ extern int VerboseStack; extern int DebugStack; extern FILE *Fstack; +#if defined(__CYGWIN__) +extern sigjmp_buf EnvOfStackMachine; +#else extern jmp_buf EnvOfStackMachine; +#endif extern struct object NullObject; extern struct object NoObject; extern int Lookup[TYPES][TYPES]; @@ -15,8 +19,8 @@ struct tokens *decomposeToTokens(char *str,int *size); struct tokens getokenSM(); struct tokens *decomposeToTokens(); char *getLOAD_SM1_PATH(); +char *traceShowScannerBuf(); - /* stackmachine.c object */ struct object *newObject(void); struct object newObjectArray(int size); @@ -61,12 +65,14 @@ void printObjectArray(struct object ob,int nl,FILE *fp /* stackmachine.c misc*/ void scanner(void); void ctrlC(int sig); +void cancelAlarm(); int executeToken(struct tokens token); int executePrimitive(struct object ob); int isLiteral(char *str); void lockCtrlCForOx(); void unlockCtrlCForOx(); void restoreCtrlCForOx(); +int executeExecutableArray(struct object ob,char *fname,int withGotoP); /* stackmachine.c export */ int KSdefineMacros(void); @@ -75,6 +81,8 @@ void KSpush(struct object ob); char * KSstringPop(void); int KSstackPointer(void); struct object KSdupErrors(void); +struct object KSpeek(int k); +struct object KSnewObjectArray(int k); /* stackmachine.c context */ struct context *newContext0(struct context *super,char *name); @@ -84,6 +92,13 @@ void KsetContext(struct object contextobj); void contextControl(actionOfContextControl ctl); struct object getSuperContext(struct object contextObj) ; +/* stackmachine.c back-trace */ +void tracePushName(char *s); +void traceClearStack(void); +char *tracePopName(void); +char *traceShowStack(void); +struct object *traceNameStackToArrayp(void); + /* kclass.c */ int initClassDataBase(); void fprintClass(FILE *fp,struct object ob); @@ -116,9 +131,18 @@ struct object *cdr(struct object *list); void printObjectList(struct object *op); int memberQ(struct object *list1,struct object list2); +struct object KvJoin(struct object listo1,struct object listo2); +struct object Kcar(struct object listo); +struct object Kcdr(struct object listo); +struct object KlistToArray(struct object listo); +struct object KarrayToList(struct object ob); + /* list:conversion */ struct object listToArray(struct object *op); struct object *arrayToList(struct object ob); +struct object newByteArray(int size,struct object obj); +struct object newByteArrayFromStr(char *s,int size); +struct object byteArrayToArray(struct object obj); /* kanExport0.c */ /** arithmetic **/ @@ -130,6 +154,7 @@ struct object KaoMult(struct object aa,struct object b struct object KooDiv2(struct object ob1,struct object ob2); struct object KoNegate(struct object ob1); struct object KreduceRationalFunction(struct object ob); +struct object KooPower(struct object ob1,struct object ob2); /* for rational function object */ struct object KoInverse(struct object ob); @@ -150,6 +175,7 @@ struct object KooLess(struct object o1,struct object o /** Conversion */ struct object KdataConversion(struct object ob1, char *key); +struct object Kto_int32(struct object ob); struct object KpoInteger(int i); struct object KpoString(char *s); struct object KpoPOLY(POLY f); @@ -157,6 +183,8 @@ struct object KpoArrayOfPOLY(struct arrayOfPOLY *ap); struct object KpoMatrixOfPOLY(struct matrixOfPOLY *mp); struct object KpoRingp(struct ring *ringp); struct object KpoDouble(double a); +struct object KpoUniversalNumber(struct coeff *u); +struct object KintToUniversalNumber(int n); #define KopInteger(o) ( (o).lc.ival ) #define KopString(o) ( (o).lc.str ) #define KopPOLY(o) ( (o).lc.poly ) @@ -169,6 +197,8 @@ struct object KpoDouble(double a); #define Knumerator(o) ( (o).lc.op ) #define Kdenominator(o) ( (o).rc.op ) #define KopDouble(ob) (*((ob).lc.dbl)) +#define KopByteArray(o) ( (o).lc.bytes ) +#define getByteArraySize(o) ( (o).rc.ival ) char *KPOLYToString(POLY f); /** conversion 2 **/ struct object arrayOfPOLYToArray(struct arrayOfPOLY *aa); @@ -182,6 +212,7 @@ int objArrayToOrderMatrix(struct object oA,int order[] int KsetOrderByObjArray(struct object oA); struct object oGetOrderMatrix(struct ring *ringp); /* order.c */ struct object KgetOrderMatrixOfCurrentRing(); +struct object oRingToOXringStructure(struct ring *ringp); /* order.c */ int KsetUpRing(struct object ob1,struct object ob2, struct object ob3,struct object ob4,struct object ob5); void KshowRing(struct ring *ringp); struct object KdefaultPolyRing(struct object num); @@ -198,26 +229,41 @@ struct object Khead(struct object ob); int KpolyLength(POLY f); struct object KsetOutputOrder(struct object obj,struct ring *rp); struct object KsetVariableNames(struct object obj,struct ring *rp); +/* KgetRingInfo has not yet been implemented. */ +struct object KgetRingInfo(struct object ringObj, struct object ofunc); - /* :eval */ struct object Keval(struct object obj); /** misc **/ struct object KtoRecords(struct object ob1); +struct object KstringToArgv(struct object ob1); +struct object KstringToArgv2(struct object ob1,struct object ob2); void Kclose(void); int warningKan(char *s); +int warningKanNoStrictMode(char *s); int errorKan1(char *s,char *m); struct object test(struct object ob); struct object Kextension(struct object ob); struct object KgbExtension(struct object ob); struct object KmpzExtension(struct object ob); +struct object Krest(struct object ob); +struct object Kjoin(struct object ob1, struct object ob2); +struct object Kget(struct object ob1, struct object ob2); /** Utilities */ char *KremoveSpace(char *s); int KtoArgvbyCurryBrace(char *str,char *argv[],int limit); +/** Attribute */ +struct object KgetAttributeList(struct object ob); +struct object KsetAttributeList(struct object ob,struct object attr); +struct object KgetAttribute(struct object ob,struct object key); +struct object KsetAttribute(struct object ob,struct object key,struct object value); +/* ob (key) (value) setAttribute /ob set. They are not destructive. */ + + /** kanExport1.c */ /* :ring :kan */ struct object Kreduction(struct object f,struct object set); @@ -235,14 +281,20 @@ POLY arrayToPOLY(struct object ob); struct object POLYToArray(POLY f); struct object oPrincipalPart(struct object ob); struct object oInitW(struct object ob,struct object oWeight); +struct object KordWsAll(struct object ob,struct object oWeight); /* :misc */ struct object homogenizeObject(struct object ob,int *gradep); struct object homogenizeObject_vec(struct object ob,int *gradep); +struct object homogenizeObject_go(struct object ob,int *gradep); +void KresetDegreeShift(void); int oGrade(struct object ob); struct ring *oRingp(struct object ob); struct object KisOrdered(struct object of); struct object KvectorToSchreyer_es(struct object obarray); +POLY objArrayToPOLY(struct object ob); +struct object POLYtoObjArray(POLY f,int size); +struct object KgetExponents(struct object obPoly,struct object type); /* hilbert.c */ struct object hilberto(struct object obgb,struct object obvlist); @@ -257,3 +309,12 @@ char *KobjectToBinary(struct object ob,int *size); int mmLarger_tower3(POLY ff,POLY gg,struct object *gbList); /* order.c */ struct object KschreyerSkelton(struct object g); + +/* misc */ +struct object KregionMatches(struct object sobj, struct object keyArray); +int objToInteger(struct object ob); + +/* shell.c */ +struct object KoxWhich(struct object cmdo,struct object patho); +struct object KoxShell(struct object ob); +void KoxShellHelp(char *key,FILE *fp);