From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Message-ID: <20020703111607.A201@next.gli.cas.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline User-Agent: Mutt/1.2.5i From: "Peter A. Cejchan" Subject: [9fans] ape port Date: Wed, 3 Jul 2002 11:16:07 +0200 Topicbox-Message-UUID: bfcf6da8-eaca-11e9-9e20-41e7f4b1d025 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline mk install (w/APE): /usr/pac/wrk/engine/source/./builtins.h:89[stdin:629] name not declared: free /* * Common functions, with no fancy init or dispose phases. */ // line 89: { "sin", calc_sin, free, NULL, R_REAL }, /* Sine function */ see builtins.h appended Hand on heart, I don't understand how this table works... :-( Sorry. -- ++pac. Peter A. Cejchan Paleobiology Lab, GLU Acad. Sci. CZ [http | ftp]://next.gli.cas.cz --Kj7319i9nmIyA2yE Content-Type: multipart/mixed; boundary="upas-hdodlzjxjmsvdxjumgspzbhvig" Content-Disposition: inline This is a multi-part message in MIME format. --upas-hdodlzjxjmsvdxjumgspzbhvig Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit The following attachment had content that we can't prove to be harmless. To avoid possible automatic execution, we changed the content headers. The original header was: Content-Type: text/x-chdr; charset=us-ascii Content-Disposition: attachment; filename="builtins.h" --upas-hdodlzjxjmsvdxjumgspzbhvig Content-Type: application/octet-stream Content-Disposition: attachment; filename="builtins.h.suspect" #ifndef __built_in_h #define __built_in_h /* * builtins.h: Header file for builtins.c * * (c) 1994 Luis E. Mu#oz * TRUE Consulting - Caracas - Venezuela * * * * This code can be used for non-commercial uses. Commercial use of either * the enclosed code or any material produced with it is not permitted * without a consent from the authors. This notice must not be removed. * * lem@usb.ve * lem@true.net */ #include #include #include "slist.h" #include "ptree.h" /* * The associated types that can be returned by * each procedure. */ #define R_REAL 0 /* Real Number */ #define R_STRING 1 /* A quoted string */ #define R_COMP 2 /* Composite operation */ #define R_FUNC 3 /* Function */ #define R_IDENT 4 /* An Identifier (variable) */ #define R_NEG 5 /* Aritmetic negation */ #define R_MAP 6 /* Mapping */ #define R_NONE -1 /* No type */ #define MIN_BUF_LEN 64 #define STD_FREE free /* what to use to free default data */ typedef struct { int NumEntries; /* How many entries */ char **Entry; /* The actual entries */ } Map_Data; /* The primitive functions */ void *_plus (void *, listdesc, int *); void *_minus (void *, listdesc, int *); void *_neg (void *, listdesc, int *); void *_times (void *, listdesc, int *); void *_div (void *, listdesc, int *); /* Built inc functions */ void *calc_sin (void *, listdesc, int *); void *calc_cos (void *, listdesc, int *); void *calc_ifelse (void *, listdesc, int *); void *calc_lt (void *, listdesc, int *); void *calc_gt (void *, listdesc, int *); void *calc_eq (void *, listdesc, int *); void *calc_linear (void *, listdesc, int *); void *calc_pow (void *, listdesc, int *); void *calc_abs (void *, listdesc, int *); void *calc_accel (void *, listdesc, int *); void *calc_bound (void *, listdesc, int *); void *calc_smooth (void *, listdesc, int *); void *calc_mod (void *, listdesc, int *); void *calc_map (Map_Data *, listdesc, int *); void *map_alloc(listdesc); typedef struct { char *Token; void *(*Eval)(void*, listdesc, int *Type); void (*Free)(void *, listdesc); void *(*Alloc)(listdesc); int Type; } Table_Entry; #ifdef __BUILTIN_TABLE Table_Entry BuiltInFuncs[] = { /* * Common functions, with no fancy init or dispose phases. */ { "sin", calc_sin, free, NULL, R_REAL }, /* Sine function */ { "cos", calc_cos, free, NULL, R_REAL }, /* cosine function */ { "ifelse", calc_ifelse, free, NULL, R_REAL }, /* if...else construct */ { "gt", calc_gt, free, NULL, R_REAL }, /* greather than */ { "lt", calc_lt, free, NULL, R_REAL }, /* lower than */ { "eq", calc_eq, free, NULL, R_REAL }, /* equality */ { "linear", calc_linear, free, NULL, R_REAL }, /* linear interpolation */ { "abs", calc_abs, free, NULL, R_REAL }, /* abs val of a number */ { "pow", calc_pow, free, NULL, R_REAL }, /* power of a number */ { "accel", calc_accel, free, NULL, R_REAL }, /* acceleration func. */ { "bound", calc_bound, free, NULL, R_REAL }, /* bound function */ { "smooth", calc_smooth, free, NULL, R_REAL }, /* smooth interp */ { "mod", calc_mod, free, NULL, R_REAL }, /* modulus */ /* * More complicated functions... */ { "map", calc_map, free, map_alloc, R_STRING }, /* mapping */ /* * End Of Table. */ { NULL, NULL, NULL, NULL, R_NONE } /* Marks the end of the table! */ }; #endif /* __BUILTIN_TABLE */ /* Some macros to ease the construction of built in functions and evaluators. */ #define DECLARES(VarName) \ double * VarName;\ int VarName##Type;\ TreeNode * VarName##Node;\ void (* VarName##Free)(void *, listdesc) #define NODE(VarName) VarName##Node #define TYPE(VarName) VarName##Type #define FREE(VarName) VarName##Free #define COPY(Dest, Source) \ TYPE(Dest) = TYPE(Source);\ NODE(Dest) = NODE(Source);\ FREE(Dest) = FREE(Source);\ Dest = Source; #define EVALUATE(VarName) \ TYPE(VarName) = Eval(NODE(VarName), &VarName, &FREE(VarName)) #define CHECK_TYPE(VarName, MyType, FuncName) \ if (TYPE(VarName) != MyType) \ {\ fprintf(stderr, "Wrong arguments passed to `" FuncName "'.\n");\ exit(1);\ } #define CHECK_TO_FREE(VarName) \ if (FREE(VarName)) \ (*FREE(VarName))(VarName, NODE(VarName)->Childs)\ #define SET_RESULTING_TYPE(Pointer, Type) \ if (Pointer) *(Pointer) = (Type) #define ALLOC(Pointer, Type, Msg) \ (Pointer) = malloc(sizeof(Type)); \ if (!(Pointer)) { \ fprintf(stderr, "Cannot alloc: %s\n", (Msg)); \ exit(1); }\ /* The definition of blanks in a `Map File' */ #define MAP_BLANK " \t,:" #endif /* __built_in_h*/ --upas-hdodlzjxjmsvdxjumgspzbhvig-- --Kj7319i9nmIyA2yE--