From: "Peter A. Cejchan" <pac@next.gli.cas.cz>
To: 9fans@cse.psu.edu
Subject: [9fans] ape port
Date: Wed, 3 Jul 2002 11:16:07 +0200 [thread overview]
Message-ID: <20020703111607.A201@next.gli.cas.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
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
<pac@next.gli.cas.cz>
[http | ftp]://next.gli.cas.cz
[-- Attachment #2.1: Type: text/plain, Size: 277 bytes --]
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"
[-- Attachment #2.2: builtins.h.suspect --]
[-- Type: application/octet-stream, Size: 5030 bytes --]
#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 <math.h>
#include <stdio.h>
#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*/
next reply other threads:[~2002-07-03 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-03 9:16 Peter A. Cejchan [this message]
2002-07-03 9:13 ` Lucio De Re
2002-07-03 9:15 ` Boyd Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020703111607.A201@next.gli.cas.cz \
--to=pac@next.gli.cas.cz \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).