/***** * runtimebase.in * Andy Hammerlindl 2009/07/28 * * Common declarations needed for all code-generating .in files. * *****/ // Basic types need by almost all .in files. // Use Void f() instead of void f() to force an explicit Stack argument. void => primVoid() Void => primVoid() Int => primInt() bool => primBoolean() double => primReal() real => primReal() string* => primString() string => primString() #include "stack.h" #include "types.h" #include "builtin.h" #include "entry.h" #include "errormsg.h" #include "array.h" #include "triple.h" #include "callable.h" using vm::stack; using vm::error; using vm::array; using vm::callable; using types::formal; using types::function; using camp::triple; #define PRIMITIVE(name,Name,asyName) using types::prim##Name; #include #undef PRIMITIVE typedef double real; void unused(void *); namespace run { array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); double *copyArrayC(const array *a, size_t dim=0); double *copyArray2C(const array *a, bool square=true, size_t dim2=0); triple *copyTripleArrayC(const array *a, size_t dim=0); triple *copyTripleArray2C(const array *a, bool square=true, size_t dim2=0); double *copyTripleArray2Components(array *a, bool square=true, size_t dim2=0); } function *realRealFunction(); // Return the component of vector v perpendicular to a unit vector u. inline triple perp(triple v, triple u) { return v-dot(v,u)*u; } #define CURRENTPEN processData().currentpen