e576bb2002-10-11Martin Nilsson /* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
bfc5a52004-03-23Henrik Grubbström (Grubba) || $Id: program.h,v 1.181 2004/03/23 13:41:56 grubba Exp $
e576bb2002-10-11Martin Nilsson */
24ddc71998-03-28Henrik Grubbström (Grubba) 
5580691996-06-21Fredrik Hübinette (Hubbe) #ifndef PROGRAM_H #define PROGRAM_H
5267b71995-08-09Fredrik Hübinette (Hubbe)  #include <stdarg.h>
afa6941997-01-28Fredrik Hübinette (Hubbe) #include "global.h"
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) #include "pike_types.h"
90e9781999-01-31Fredrik Hübinette (Hubbe) #include "pike_macros.h"
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) #include "svalue.h"
05590d1998-04-23Fredrik Hübinette (Hubbe) #include "time_stuff.h"
e9ce612001-03-29Per Hedbor #include "program_id.h"
13e01d2001-12-16Martin Stjernholm #include "block_alloc_h.h"
bad5162000-06-23Fredrik Hübinette (Hubbe)  #define STRUCT #include "compilation.h" #define EXTERN #include "compilation.h"
1f21332000-07-28Fredrik Hübinette (Hubbe) /* Needed to support dynamic loading on NT */ PMOD_PROTO extern struct program_state * Pike_compiler;
38aeac2004-03-13Henrik Grubbström (Grubba) /* Compilation flags */ #define COMPILATION_CHECK_FINAL 0x01 /* This flag is set when resolve functions should force the lookup so * that we don't get a placeholder back. Used for inherits. */ #define COMPILATION_FORCE_RESOLVE 0x02
62c77b2004-03-15Henrik Grubbström (Grubba) /* #define FORCE_RESOLVE_DEBUG */ /* Helper macros for force_resolve */ #ifdef FORCE_RESOLVE_DEBUG #define DO_IF_FRD(X) X #else /* !FORCE_RESOLVE_DEBUG */ #define DO_IF_FRD(X) #endif /* FORCE_RESOLVE_DEBUG */ #define SET_FORCE_RESOLVE(OLD) do { \ int tmp_ = (OLD) = Pike_compiler->flags; \ Pike_compiler->flags |= COMPILATION_FORCE_RESOLVE; \ DO_IF_FRD(fprintf(stderr, \ "Force resolve on. Flags:0x%04x (0x%04x)\n", \ Pike_compiler->flags, tmp_)); \ } while(0) #define UNSET_FORCE_RESOLVE(OLD) do { \ int tmp_ = (Pike_compiler->flags & ~COMPILATION_FORCE_RESOLVE) | \ ((OLD) & COMPILATION_FORCE_RESOLVE); \ DO_IF_FRD(fprintf(stderr, \ "Force resolve unset. Flags:0x%04x (0x%04x)\n", \ tmp_, Pike_compiler->flags)); \ Pike_compiler->flags = tmp_; \ } while(0)
38aeac2004-03-13Henrik Grubbström (Grubba) 
9e26861999-12-31Martin Stjernholm extern struct pike_string *this_program_string;
5580691996-06-21Fredrik Hübinette (Hubbe) #define LFUN___INIT 0 #define LFUN_CREATE 1 #define LFUN_DESTROY 2 #define LFUN_ADD 3 #define LFUN_SUBTRACT 4 #define LFUN_AND 5 #define LFUN_OR 6 #define LFUN_XOR 7 #define LFUN_LSH 8 #define LFUN_RSH 9 #define LFUN_MULTIPLY 10 #define LFUN_DIVIDE 11 #define LFUN_MOD 12 #define LFUN_COMPL 13 #define LFUN_EQ 14 #define LFUN_LT 15 #define LFUN_GT 16 #define LFUN___HASH 17 #define LFUN_CAST 18 #define LFUN_NOT 19
774b061996-08-03Fredrik Hübinette (Hubbe) #define LFUN_INDEX 20 #define LFUN_ASSIGN_INDEX 21
dffa011997-01-15Fredrik Hübinette (Hubbe) #define LFUN_ARROW 22 #define LFUN_ASSIGN_ARROW 23
0683be1997-01-26Fredrik Hübinette (Hubbe) #define LFUN__SIZEOF 24 #define LFUN__INDICES 25 #define LFUN__VALUES 26 #define LFUN_CALL 27
1b89ad1997-10-10Fredrik Hübinette (Hubbe) #define LFUN_RADD 28 #define LFUN_RSUBTRACT 29 #define LFUN_RAND 30 #define LFUN_ROR 31 #define LFUN_RXOR 32 #define LFUN_RLSH 33 #define LFUN_RRSH 34 #define LFUN_RMULTIPLY 35 #define LFUN_RDIVIDE 36 #define LFUN_RMOD 37
ee37801999-02-09Fredrik Hübinette (Hubbe) #define LFUN_ADD_EQ 38
aa73fc1999-10-21Fredrik Hübinette (Hubbe) #define LFUN__IS_TYPE 39 #define LFUN__SPRINTF 40
2ba9191999-10-23Fredrik Hübinette (Hubbe) #define LFUN__EQUAL 41
a3453e2001-02-05Per Hedbor #define LFUN__M_DELETE 42
226d642001-02-24Henrik Grubbström (Grubba) #define LFUN__GET_ITERATOR 43
5580691996-06-21Fredrik Hübinette (Hubbe) 
226d642001-02-24Henrik Grubbström (Grubba) #define NUM_LFUNS 44
5580691996-06-21Fredrik Hübinette (Hubbe)  extern char *lfun_names[];
286afb2001-02-05Henrik Grubbström (Grubba) extern struct pike_string *lfun_strings[];
dfa5b31996-12-05Fredrik Hübinette (Hubbe) #ifndef STRUCT_SVALUE_DECLARED #define STRUCT_SVALUE_DECLARED
5267b71995-08-09Fredrik Hübinette (Hubbe) struct svalue;
dfa5b31996-12-05Fredrik Hübinette (Hubbe) #endif
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) #ifndef STRUCT_NODE_S_DECLARED #define STRUCT_NODE_S_DECLARED struct node_s; #endif
dfa5b31996-12-05Fredrik Hübinette (Hubbe) #ifndef STRUCT_OBJECT_DECLARED #define STRUCT_OBJECT_DECLARED
5267b71995-08-09Fredrik Hübinette (Hubbe) struct object;
dfa5b31996-12-05Fredrik Hübinette (Hubbe) #endif
5267b71995-08-09Fredrik Hübinette (Hubbe) 
aeaab72002-04-08Martin Stjernholm /* Byte-code method identification. */
b5e8272003-12-03Henrik Grubbström (Grubba) #define PIKE_BYTECODE_PORTABLE -1 /* Only used by the codec. */
aeaab72002-04-08Martin Stjernholm #define PIKE_BYTECODE_DEFAULT 0 #define PIKE_BYTECODE_GOTO 1 #define PIKE_BYTECODE_SPARC 2 #define PIKE_BYTECODE_IA32 3 #define PIKE_BYTECODE_PPC32 4
040eb02003-03-20Martin Stjernholm #define PIKE_INSTR_T void *
d8e19a2002-04-07Martin Stjernholm #else #define PIKE_OPCODE_T unsigned INT8 #endif
040eb02003-03-20Martin Stjernholm #ifndef PIKE_INSTR_T /* The type for an opcode instruction identifier (not packed). In all * cases but PIKE_BYTECODE_GOTO, this is n - F_OFFSET where n is the * number in the Pike_opcodes enum. */ #define PIKE_INSTR_T unsigned int #endif
5267b71995-08-09Fredrik Hübinette (Hubbe) /* I need: * a) one type that can point to a callable function. * (C function, or object->fun) * This can for instance be an svalue. * * b) one type that once the object/program is known can point
06983f1996-09-22Fredrik Hübinette (Hubbe)  * to the C/PIKE function body.
5267b71995-08-09Fredrik Hübinette (Hubbe)  * * c) A number of flags to send to 'add_simul_efun' to specify side effects * and such. */ /* * Max program dimensions:
5580691996-06-21Fredrik Hübinette (Hubbe)  * 2^16 functions + global variables
5267b71995-08-09Fredrik Hübinette (Hubbe)  * 2^16 inherits
06983f1996-09-22Fredrik Hübinette (Hubbe)  * 2^16 arguments to pike functions
5580691996-06-21Fredrik Hübinette (Hubbe)  * 2^32 efuns
5267b71995-08-09Fredrik Hübinette (Hubbe)  * 2^8 local variables (and arguments) */ union idptr { void (*c_fun)(INT32);
a850e32000-08-14Henrik Grubbström (Grubba)  ptrdiff_t offset;
5267b71995-08-09Fredrik Hübinette (Hubbe) };
b5e8272003-12-03Henrik Grubbström (Grubba) #define IDENTIFIER_VARIABLE 0
06983f1996-09-22Fredrik Hübinette (Hubbe) #define IDENTIFIER_PIKE_FUNCTION 1
5267b71995-08-09Fredrik Hübinette (Hubbe) #define IDENTIFIER_C_FUNCTION 2 #define IDENTIFIER_FUNCTION 3
61e9a01998-01-25Fredrik Hübinette (Hubbe) #define IDENTIFIER_CONSTANT 4
b5e8272003-12-03Henrik Grubbström (Grubba) #define IDENTIFIER_TYPE_MASK 7
0ee38f2002-05-11Martin Stjernholm #define IDENTIFIER_VARARGS 8 /* Used for functions only. */
269add2003-02-24Martin Stjernholm #define IDENTIFIER_HAS_BODY 16 /* Function has a body (set already in pass 1). */
97f6282000-03-07Fredrik Hübinette (Hubbe) #define IDENTIFIER_SCOPED 32 /* This is used for local functions only */
8322b62000-05-08Fredrik Hübinette (Hubbe) #define IDENTIFIER_SCOPE_USED 64 /* contains scoped local functions */
eff2b02001-07-03Henrik Grubbström (Grubba) #define IDENTIFIER_ALIAS 128 /* This identifier is an alias. */
d2c6081996-11-07Fredrik Hübinette (Hubbe)  #define IDENTIFIER_IS_FUNCTION(X) ((X) & IDENTIFIER_FUNCTION)
1994251999-09-06Fredrik Hübinette (Hubbe) #define IDENTIFIER_IS_PIKE_FUNCTION(X) ((X) & IDENTIFIER_PIKE_FUNCTION)
b5e8272003-12-03Henrik Grubbström (Grubba) #define IDENTIFIER_IS_C_FUNCTION(X) ((X) & IDENTIFIER_C_FUNCTION)
eff2b02001-07-03Henrik Grubbström (Grubba) #define IDENTIFIER_IS_ALIAS(X) ((X) & IDENTIFIER_ALIAS)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
eff2b02001-07-03Henrik Grubbström (Grubba) #define IDENTIFIER_MASK 255
97f6282000-03-07Fredrik Hübinette (Hubbe) 
2f075c2001-10-05Fredrik Hübinette (Hubbe) /* * Every constant, class, function and variable
0ee38f2002-05-11Martin Stjernholm  * gets exactly one of these.
2f075c2001-10-05Fredrik Hübinette (Hubbe)  */
5267b71995-08-09Fredrik Hübinette (Hubbe) struct identifier {
06983f1996-09-22Fredrik Hübinette (Hubbe)  struct pike_string *name;
d68a072001-02-20Henrik Grubbström (Grubba)  struct pike_type *type;
1ef5572000-08-30Henrik Grubbström (Grubba)  unsigned INT8 identifier_flags; /* IDENTIFIER_??? */ unsigned INT8 run_time_type; /* PIKE_T_??? */ unsigned INT16 opt_flags; /* OPT_??? */
be478c1997-08-30Henrik Grubbström (Grubba) #ifdef PROFILING unsigned INT32 num_calls;
a2a8801998-03-18Per Hedbor  unsigned INT32 total_time;
6189631998-11-12Fredrik Hübinette (Hubbe)  unsigned INT32 self_time;
be478c1997-08-30Henrik Grubbström (Grubba) #endif /* PROFILING */
5267b71995-08-09Fredrik Hübinette (Hubbe)  union idptr func; };
2f075c2001-10-05Fredrik Hübinette (Hubbe) /* * This is used to store constants, both * inline constants and those defined explicitly with * the constant keyword. */
454d541999-09-18Fredrik Hübinette (Hubbe) struct program_constant { struct svalue sval; struct pike_string *name; };
5267b71995-08-09Fredrik Hübinette (Hubbe) /* * in the bytecode, a function starts with: * char num_args * char num_locals * char code[] */
b92e341999-12-30Henrik Grubbström (Grubba) #define ID_STATIC 0x01 /* Symbol is not visible by indexing */ #define ID_PRIVATE 0x02 /* Symbol is not visible by inherit */ #define ID_NOMASK 0x04 /* Symbol may not be overloaded */
fa89602002-03-01Martin Nilsson #define ID_PUBLIC 0x08 /* Anti private */ #define ID_PROTECTED 0x10 /* Not currently used at all */ #define ID_INLINE 0x20 /* Same as local */ #define ID_HIDDEN 0x40 /* Symbols that are private and inherited one step later */ #define ID_INHERITED 0x80 /* Symbol is inherited */
b92e341999-12-30Henrik Grubbström (Grubba) #define ID_OPTIONAL 0x100 /* Symbol is not required by the interface */ #define ID_EXTERN 0x200 /* Symbol is defined later */
5ca4352000-07-12Henrik Grubbström (Grubba) #define ID_VARIANT 0x400 /* Function is overloaded by argument. */
eff2b02001-07-03Henrik Grubbström (Grubba) #define ID_ALIAS 0x800 /* Variable is an overloaded alias. */
f80d571999-11-23Henrik Grubbström (Grubba) 
eff2b02001-07-03Henrik Grubbström (Grubba) #define ID_MODIFIER_MASK 0x0fff
f80d571999-11-23Henrik Grubbström (Grubba) 
b92e341999-12-30Henrik Grubbström (Grubba) #define ID_STRICT_TYPES 0x8000 /* #pragma strict_types */
2b1b5f2002-02-06Henrik Grubbström (Grubba) #define ID_SAVE_PARENT 0x10000 /* #pragma save_parent */
2fbfc42002-06-11Martin Stjernholm #define ID_DONT_SAVE_PARENT 0x20000 /* #pragma dont_save_parent */
5267b71995-08-09Fredrik Hübinette (Hubbe) 
2f075c2001-10-05Fredrik Hübinette (Hubbe)  /* * All identifiers in this program * and all identifiers in inherited programs * needs to have a 'struct reference' in this * program. When we overload a function, we simply * change the reference to point to the new 'struct identifier'. */
5267b71995-08-09Fredrik Hübinette (Hubbe) struct reference {
cb22561995-10-11Fredrik Hübinette (Hubbe)  unsigned INT16 inherit_offset; unsigned INT16 identifier_offset;
b1f4eb1998-01-13Fredrik Hübinette (Hubbe)  INT16 id_flags; /* static, private etc.. */
5267b71995-08-09Fredrik Hübinette (Hubbe) };
76343b2003-08-18Martin Stjernholm /* Magic value used as identifier reference integer to refer to this. */ #define IDREF_MAGIC_THIS -1
2f075c2001-10-05Fredrik Hübinette (Hubbe) /* * Each program has an array of these, * the first entry points to itself, the * rest are from inherited programs. * Note that when a program is inherited, * all 'struct inherit' from that program is * copied, so the whole tree of inherits is * represented. */
5267b71995-08-09Fredrik Hübinette (Hubbe) struct inherit {
342fef2000-08-23Fredrik Hübinette (Hubbe)  INT16 inherit_level;
5267b71995-08-09Fredrik Hübinette (Hubbe)  INT16 identifier_level;
b1f4eb1998-01-13Fredrik Hübinette (Hubbe)  INT16 parent_identifier;
61e9a01998-01-25Fredrik Hübinette (Hubbe)  INT16 parent_offset;
1a49362002-05-10Henrik Grubbström (Grubba)  size_t identifier_ref_offset;
b819352000-08-14Henrik Grubbström (Grubba)  ptrdiff_t storage_offset;
b1f4eb1998-01-13Fredrik Hübinette (Hubbe)  struct object *parent; struct program *prog; struct pike_string *name;
5267b71995-08-09Fredrik Hübinette (Hubbe) };
2f075c2001-10-05Fredrik Hübinette (Hubbe)  /* * Storage struct for a trampoline object * (not a part of the program type) */
454d541999-09-18Fredrik Hübinette (Hubbe) struct pike_trampoline { struct pike_frame *frame; INT32 func; };
aa68b12001-03-19Fredrik Hübinette (Hubbe) 
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) /* program parts have been realloced into one block */ #define PROGRAM_OPTIMIZED 1 /* program has gone through pass 1 of compiler, prototypes etc. will * not change from now on */ #define PROGRAM_FIXED 2 /* Program is done and can be cloned */ #define PROGRAM_FINISHED 4 /* Program has gone through first compiler pass */ #define PROGRAM_PASS_1_DONE 8
8aae6d1999-08-19Fredrik Hübinette (Hubbe) /* Program will be destructed as soon at it runs out of references. * Normally only used for mutex lock keys and similar */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_DESTRUCT_IMMEDIATE 0x10
b504ed1997-09-21Fredrik Hübinette (Hubbe) 
8aae6d1999-08-19Fredrik Hübinette (Hubbe) /* Self explanatory, automatically detected */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_HAS_C_METHODS 0x20
05590d1998-04-23Fredrik Hübinette (Hubbe) 
f3c7152001-04-14Fredrik Hübinette (Hubbe) /* Objects created from this program are constant and shareable */ #define PROGRAM_CONSTANT 0x40
8aae6d1999-08-19Fredrik Hübinette (Hubbe) 
1994251999-09-06Fredrik Hübinette (Hubbe) /* */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_USES_PARENT 0x80
1994251999-09-06Fredrik Hübinette (Hubbe) 
2b1b5f2002-02-06Henrik Grubbström (Grubba) /* Objects should not be destructed even when they only have weak
1b0ac81999-10-29Martin Stjernholm  * references left. */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_NO_WEAK_FREE 0x100
1b0ac81999-10-29Martin Stjernholm  /* Objects should not be destructed by f_destruct(). */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_NO_EXPLICIT_DESTRUCT 0x200
1b0ac81999-10-29Martin Stjernholm 
8ba59a2000-03-26Fredrik Hübinette (Hubbe) /* Program is in an inconsistant state */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_AVOID_CHECK 0x400
8ba59a2000-03-26Fredrik Hübinette (Hubbe) 
aa68b12001-03-19Fredrik Hübinette (Hubbe) /* Program has not yet been used for compilation */
f3c7152001-04-14Fredrik Hübinette (Hubbe) #define PROGRAM_VIRGIN 0x800
aa68b12001-03-19Fredrik Hübinette (Hubbe) 
22d7992001-06-23Fredrik Hübinette (Hubbe) /* */ #define PROGRAM_NEEDS_PARENT 0x1000
b5dc812001-07-12Fredrik Hübinette (Hubbe) /* Using define instead of enum allows for ifdefs - Hubbe */ #define PROG_EVENT_INIT 0 #define PROG_EVENT_EXIT 1 #define PROG_EVENT_GC_RECURSE 2 #define PROG_EVENT_GC_CHECK 3 #define NUM_PROG_EVENTS 4
8ba59a2000-03-26Fredrik Hübinette (Hubbe) 
f3c7152001-04-14Fredrik Hübinette (Hubbe) /* These macros should only be used if (p->flags & PROGRAM_USES_PARENT) * is true */ #define LOW_PARENT_INFO(O,P) ((struct parent_info *)(PIKE_OBJ_STORAGE((O)) + (P)->parent_info_storage)) #define PARENT_INFO(O) LOW_PARENT_INFO( (O), (O)->prog)
2f075c2001-10-05Fredrik Hübinette (Hubbe) /* * Objects which needs to access their parent * have to allocate one of these structs in * the object data area. * The parent_info_storage member of the program * struct tells us where in the object to find this * data. */
f3c7152001-04-14Fredrik Hübinette (Hubbe) struct parent_info { struct object *parent; INT16 parent_identifier; };
5267b71995-08-09Fredrik Hübinette (Hubbe) struct program {
45637c2001-04-07Fredrik Hübinette (Hubbe)  PIKE_MEMORY_OBJECT_MEMBERS; /* Must be first */
5267b71995-08-09Fredrik Hübinette (Hubbe)  INT32 id; /* used to identify program in caches */
2ad3c01999-09-16Fredrik Hübinette (Hubbe)  /* storage_needed - storage needed in object struct * the first inherit[0].storage_offset bytes are not used and are * subtracted when inheriting. */
b819352000-08-14Henrik Grubbström (Grubba)  ptrdiff_t storage_needed; /* storage needed in the object struct */
f3c7152001-04-14Fredrik Hübinette (Hubbe)  ptrdiff_t xstorage; /* Non-inherited storage */ ptrdiff_t parent_info_storage;
8f29a31999-09-15Fredrik Hübinette (Hubbe)  INT16 flags; /* PROGRAM_* */
90e9781999-01-31Fredrik Hübinette (Hubbe)  unsigned INT8 alignment_needed;
05590d1998-04-23Fredrik Hübinette (Hubbe)  struct timeval timestamp;
5267b71995-08-09Fredrik Hübinette (Hubbe)  struct program *next; struct program *prev;
f3c7152001-04-14Fredrik Hübinette (Hubbe)  struct program *parent;
a5d45c2001-05-26Henrik Grubbström (Grubba)  struct node_s *(*optimize)(struct node_s *n);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) 
b5dc812001-07-12Fredrik Hübinette (Hubbe)  void (*event_handler)(int);
71f3a21998-11-22Fredrik Hübinette (Hubbe) #ifdef PIKE_DEBUG
5267b71995-08-09Fredrik Hübinette (Hubbe)  unsigned INT32 checksum; #endif
be478c1997-08-30Henrik Grubbström (Grubba) #ifdef PROFILING unsigned INT32 num_clones; #endif /* PROFILING */
5267b71995-08-09Fredrik Hübinette (Hubbe) 
de1d7d2000-07-10Henrik Grubbström (Grubba)  size_t total_size;
b1f4eb1998-01-13Fredrik Hübinette (Hubbe)  #define FOO(NUMTYPE,TYPE,NAME) TYPE * NAME ; #include "program_areas.h" #define FOO(NUMTYPE,TYPE,NAME) NUMTYPE PIKE_CONCAT(num_,NAME) ; #include "program_areas.h"
5580691996-06-21Fredrik Hübinette (Hubbe)  INT16 lfuns[NUM_LFUNS];
5267b71995-08-09Fredrik Hübinette (Hubbe) };
3c43b81999-03-19Fredrik Hübinette (Hubbe) #define INHERIT_FROM_PTR(P,X) (dmalloc_touch(struct program *,(P))->inherits + (X)->inherit_offset) #define PROG_FROM_PTR(P,X) (dmalloc_touch(struct program *,INHERIT_FROM_PTR(P,X)->prog))
5267b71995-08-09Fredrik Hübinette (Hubbe) #define ID_FROM_PTR(P,X) (PROG_FROM_PTR(P,X)->identifiers+(X)->identifier_offset) #define INHERIT_FROM_INT(P,X) INHERIT_FROM_PTR(P,(P)->identifier_references+(X)) #define PROG_FROM_INT(P,X) PROG_FROM_PTR(P,(P)->identifier_references+(X)) #define ID_FROM_INT(P,X) ID_FROM_PTR(P,(P)->identifier_references+(X))
7477e22000-02-16Henrik Grubbström (Grubba) #define FIND_LFUN(P,N) ( dmalloc_touch(struct program *,(P))->flags & PROGRAM_FIXED?((P)->lfuns[(N)]):low_find_lfun((P), (N)) )
cd66732003-01-15Martin Stjernholm #define QUICK_FIND_LFUN(P,N) (dmalloc_touch(struct program *,(P))->lfuns[N])
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) 
e83eb92001-03-22Fredrik Hübinette (Hubbe) #define free_program(p) do{ struct program *_=(p); debug_malloc_touch(_); if(!sub_ref(_)) really_free_program(_); }while(0)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
3aab372002-11-24Martin Stjernholm BLOCK_ALLOC_FILL_PAGES(program, n/a)
13e01d2001-12-16Martin Stjernholm 
1994981998-04-07Fredrik Hübinette (Hubbe) 
10e16f1999-11-04Henrik Grubbström (Grubba) extern struct object *error_handler;
a376db2001-06-08Henrik Grubbström (Grubba) extern struct object *compat_handler;
10e16f1999-11-04Henrik Grubbström (Grubba) 
1ca3ba1997-10-13Fredrik Hübinette (Hubbe) extern struct program *first_program;
92c73b2001-11-08Fredrik Hübinette (Hubbe) extern struct program *null_program;
4218011999-01-31Fredrik Hübinette (Hubbe) extern struct program *pike_trampoline_program;
e2d9e62000-06-10Martin Stjernholm extern struct program *gc_internal_program;
eaa4da2001-10-04Fredrik Hübinette (Hubbe) extern struct program *placeholder_program; extern struct object *placeholder_object;
9649491998-02-27Fredrik Hübinette (Hubbe) 
ddc1422000-06-26Henrik Grubbström (Grubba) extern int compilation_depth;
8aae6d1999-08-19Fredrik Hübinette (Hubbe) /* Flags for identifier finding... */ #define SEE_STATIC 1 #define SEE_PRIVATE 2
9649491998-02-27Fredrik Hübinette (Hubbe) #define COMPILER_IN_CATCH 1
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) 
90e9781999-01-31Fredrik Hübinette (Hubbe) #define ADD_STORAGE(X) low_add_storage(sizeof(X), ALIGNOF(X),0)
1f5bfe1999-09-28Fredrik Hübinette (Hubbe) #define STORAGE_NEEDED(X) ((X)->storage_needed - (X)->inherits[0].storage_offset)
90e9781999-01-31Fredrik Hübinette (Hubbe) 
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) #define FOO(NUMTYPE,TYPE,NAME) void PIKE_CONCAT(add_to_,NAME(TYPE ARG)); #include "program_areas.h"
5267b71995-08-09Fredrik Hübinette (Hubbe) 
c82be82001-12-14Martin Stjernholm 
c6cf602001-12-13Martin Stjernholm typedef int supporter_callback (void *, int);
92c73b2001-11-08Fredrik Hübinette (Hubbe) struct Supporter { #ifdef PIKE_DEBUG int magic; #endif struct Supporter *previous; struct Supporter *depends_on; struct Supporter *dependants; struct Supporter *next_dependant;
c6cf602001-12-13Martin Stjernholm  supporter_callback *fun;
92c73b2001-11-08Fredrik Hübinette (Hubbe)  void *data; struct program *prog; };
5267b71995-08-09Fredrik Hübinette (Hubbe) /* Prototypes begin here */
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void ins_int(INT32 i, void (*func)(char tmp)); void ins_short(INT16 i, void (*func)(char tmp));
1a49362002-05-10Henrik Grubbström (Grubba) void add_relocated_int_to_program(INT32 i);
591c0c1997-01-19Fredrik Hübinette (Hubbe) void use_module(struct svalue *s);
05590d1998-04-23Fredrik Hübinette (Hubbe) void unuse_modules(INT32 howmany);
1f21332000-07-28Fredrik Hübinette (Hubbe) struct node_s *find_module_identifier(struct pike_string *ident, int see_inherit);
f34f642002-05-05Martin Stjernholm struct node_s *resolve_identifier(struct pike_string *ident);
0ee38f2002-05-11Martin Stjernholm struct node_s *program_magic_identifier (struct program_state *state, int state_depth, int inherit_num, struct pike_string *ident, int colon_colon_ref);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) struct program *parent_compilation(int level);
b8cda21997-01-21Fredrik Hübinette (Hubbe) struct program *id_to_program(INT32 id);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void optimize_program(struct program *p);
e9c40c2003-02-24Henrik Grubbström (Grubba) void fsort_program_identifier_index(unsigned short *start, unsigned short *end, struct program *p);
50edc82001-07-13Henrik Grubbström (Grubba) struct pike_string *find_program_name(struct program *p, INT32 *line);
a1f8522002-06-11Martin Stjernholm int override_identifier (struct reference *ref, struct pike_string *name);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void fixate_program(void);
05590d1998-04-23Fredrik Hübinette (Hubbe) struct program *low_allocate_program(void);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void low_start_new_program(struct program *p,
38aeac2004-03-13Henrik Grubbström (Grubba)  int pass,
993ba72000-02-15Fredrik Hübinette (Hubbe)  struct pike_string *name, int flags, int *idp);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT void debug_start_new_program(int line, const char *file);
5683de1995-11-06Fredrik Hübinette (Hubbe) void dump_program_desc(struct program *p);
e964ae1998-04-08Fredrik Hübinette (Hubbe) int sizeof_variable(int run_time_type);
5ec1062002-05-09Martin Stjernholm void dump_program_tables (struct program *p, int indent);
624d091996-02-24Fredrik Hübinette (Hubbe) void check_program(struct program *p);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) struct program *end_first_pass(int finish);
1f21332000-07-28Fredrik Hübinette (Hubbe) PMOD_EXPORT struct program *debug_end_program(void);
b819352000-08-14Henrik Grubbström (Grubba) PMOD_EXPORT size_t low_add_storage(size_t size, size_t alignment, ptrdiff_t modulo_orig);
6e4c642002-09-11Marcus Comstedt PMOD_EXPORT void set_init_callback(void (*init_callback)(struct object *)); PMOD_EXPORT void set_exit_callback(void (*exit_callback)(struct object *));
1f21332000-07-28Fredrik Hübinette (Hubbe) PMOD_EXPORT void set_gc_recurse_callback(void (*m)(struct object *)); PMOD_EXPORT void set_gc_check_callback(void (*m)(struct object *));
b5dc812001-07-12Fredrik Hübinette (Hubbe) void pike_set_prog_event_callback(void (*cb)(int));
eaa4da2001-10-04Fredrik Hübinette (Hubbe) void pike_set_prog_optimize_callback(node *(*opt)(node *));
d429a71998-02-24Fredrik Hübinette (Hubbe) int low_reference_inherited_identifier(struct program_state *q, int e,
8aae6d1999-08-19Fredrik Hübinette (Hubbe)  struct pike_string *name, int flags);
ddc1422000-06-26Henrik Grubbström (Grubba) int find_inherit(struct program *p, struct pike_string *name);
d429a71998-02-24Fredrik Hübinette (Hubbe) node *reference_inherited_identifier(struct pike_string *super_name,
d68a072001-02-20Henrik Grubbström (Grubba)  struct pike_string *function_name);
06983f1996-09-22Fredrik Hübinette (Hubbe) void rename_last_inherit(struct pike_string *n);
61e9a01998-01-25Fredrik Hübinette (Hubbe) void low_inherit(struct program *p, struct object *parent, int parent_identifier, int parent_offset, INT32 flags, struct pike_string *name);
1f21332000-07-28Fredrik Hübinette (Hubbe) PMOD_EXPORT void do_inherit(struct svalue *s,
b1f4eb1998-01-13Fredrik Hübinette (Hubbe)  INT32 flags, struct pike_string *name);
61e9a01998-01-25Fredrik Hübinette (Hubbe) void compiler_do_inherit(node *n, INT32 flags, struct pike_string *name);
9036e82001-08-16Martin Stjernholm int call_handle_inherit(struct pike_string *s);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void simple_do_inherit(struct pike_string *s, INT32 flags, struct pike_string *name);
06983f1996-09-22Fredrik Hübinette (Hubbe) int isidentifier(struct pike_string *s);
05c7cd1997-07-19Fredrik Hübinette (Hubbe) int low_define_variable(struct pike_string *name,
d68a072001-02-20Henrik Grubbström (Grubba)  struct pike_type *type,
05c7cd1997-07-19Fredrik Hübinette (Hubbe)  INT32 flags,
de1d7d2000-07-10Henrik Grubbström (Grubba)  size_t offset,
05c7cd1997-07-19Fredrik Hübinette (Hubbe)  INT32 run_time_type);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int map_variable(const char *name, const char *type,
05c7cd1997-07-19Fredrik Hübinette (Hubbe)  INT32 flags,
de1d7d2000-07-10Henrik Grubbström (Grubba)  size_t offset,
05c7cd1997-07-19Fredrik Hübinette (Hubbe)  INT32 run_time_type);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int quick_map_variable(const char *name,
e2d9e62000-06-10Martin Stjernholm  int name_length,
de1d7d2000-07-10Henrik Grubbström (Grubba)  size_t offset,
0929a02002-09-12Marcus Comstedt  const char *type,
e2d9e62000-06-10Martin Stjernholm  int type_length, INT32 run_time_type, INT32 flags);
06983f1996-09-22Fredrik Hübinette (Hubbe) int define_variable(struct pike_string *name,
d68a072001-02-20Henrik Grubbström (Grubba)  struct pike_type *type,
5267b71995-08-09Fredrik Hübinette (Hubbe)  INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int simple_add_variable(const char *name, const char *type,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  INT32 flags);
1f21332000-07-28Fredrik Hübinette (Hubbe) PMOD_EXPORT int add_constant(struct pike_string *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  struct svalue *c, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int simple_add_constant(const char *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  struct svalue *c, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int add_integer_constant(const char *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  INT32 i, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int quick_add_integer_constant(const char *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  int name_length, INT32 i, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int add_float_constant(const char *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  double f, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int add_string_constant(const char *name, const char *str,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int add_program_constant(const char *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  struct program *p, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int add_object_constant(const char *name,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  struct object *o, INT32 flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int add_function_constant(const char *name, void (*cfun)(INT32), const char * type, INT16 flags); PMOD_EXPORT int debug_end_class(const char *name, ptrdiff_t namelen, INT32 flags);
06983f1996-09-22Fredrik Hübinette (Hubbe) INT32 define_function(struct pike_string *name,
d68a072001-02-20Henrik Grubbström (Grubba)  struct pike_type *type,
2b1b5f2002-02-06Henrik Grubbström (Grubba)  unsigned INT16 flags,
1ef5572000-08-30Henrik Grubbström (Grubba)  unsigned INT8 function_flags, union idptr *func, unsigned INT16 opt_flags);
c0e4461998-06-23Fredrik Hübinette (Hubbe) int really_low_find_shared_string_identifier(struct pike_string *name, struct program *prog,
1016021999-10-28Fredrik Hübinette (Hubbe)  int flags);
51f0e02000-08-10Henrik Grubbström (Grubba) int low_find_lfun(struct program *p, ptrdiff_t lfun);
286afb2001-02-05Henrik Grubbström (Grubba) int lfun_lookup_id(struct pike_string *lfun_name);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) int low_find_shared_string_identifier(struct pike_string *name, struct program *prog);
5267b71995-08-09Fredrik Hübinette (Hubbe) struct ff_hash;
06983f1996-09-22Fredrik Hübinette (Hubbe) int find_shared_string_identifier(struct pike_string *name,
5267b71995-08-09Fredrik Hübinette (Hubbe)  struct program *prog);
6f3ad02001-07-02Martin Stjernholm PMOD_EXPORT int find_identifier(const char *name,struct program *prog);
06983f1996-09-22Fredrik Hübinette (Hubbe) int store_prog_string(struct pike_string *str);
1016021999-10-28Fredrik Hübinette (Hubbe) int store_constant(struct svalue *foo, int equal, struct pike_string *constant_name);
15ff8c1998-05-25Henrik Grubbström (Grubba) struct array *program_indices(struct program *p); struct array *program_values(struct program *p);
e435831998-05-25Henrik Grubbström (Grubba) void program_index_no_free(struct svalue *to, struct program *p, struct svalue *ind);
1016021999-10-28Fredrik Hübinette (Hubbe) int get_small_number(char **q);
7c7a3f2002-12-01Martin Stjernholm void ext_store_program_line (struct program *prog, INT32 line, struct pike_string *file);
5267b71995-08-09Fredrik Hübinette (Hubbe) void start_line_numbering(void);
06983f1996-09-22Fredrik Hübinette (Hubbe) void store_linenumber(INT32 current_line, struct pike_string *current_file);
7c7a3f2002-12-01Martin Stjernholm PMOD_EXPORT struct pike_string *low_get_program_line(struct program *prog, INT32 *linep);
50edc82001-07-13Henrik Grubbström (Grubba) PMOD_EXPORT struct pike_string *get_program_line(struct program *prog, INT32 *linep);
1bda232003-10-20Martin Stjernholm char *debug_get_line(PIKE_OPCODE_T *pc, struct program *prog, INT32 *linep);
7c7a3f2002-12-01Martin Stjernholm PMOD_EXPORT struct pike_string *low_get_line(PIKE_OPCODE_T *pc, struct program *prog, INT32 *linep);
50edc82001-07-13Henrik Grubbström (Grubba) PMOD_EXPORT struct pike_string *get_line(PIKE_OPCODE_T *pc,
eaa4da2001-10-04Fredrik Hübinette (Hubbe)  struct program *prog, INT32 *linep);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void my_yyerror(char *fmt,...) ATTRIBUTE((format(printf,1,2)));
bfc5a52004-03-23Henrik Grubbström (Grubba) struct pike_string *format_exception_for_error_msg (struct svalue *thrown);
b34c9f2001-08-15Martin Stjernholm void yy_describe_exception(struct svalue *thrown);
92c73b2001-11-08Fredrik Hübinette (Hubbe) struct supporter_marker;
0929a02002-09-12Marcus Comstedt void verify_supporters(void);
92c73b2001-11-08Fredrik Hübinette (Hubbe) void init_supporter(struct Supporter *s,
c6cf602001-12-13Martin Stjernholm  supporter_callback *fun,
92c73b2001-11-08Fredrik Hübinette (Hubbe)  void *data); int unlink_current_supporter(struct Supporter *c);
c6cf602001-12-13Martin Stjernholm int call_dependants(struct Supporter *s, int finish);
92c73b2001-11-08Fredrik Hübinette (Hubbe) int report_compiler_dependency(struct program *p);
eaa4da2001-10-04Fredrik Hübinette (Hubbe) struct compilation; void run_pass2(struct compilation *c); struct program *compile(struct pike_string *aprog, struct object *ahandler, int amajor, int aminor, struct program *atarget, struct object *aplaceholder);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int pike_add_function2(const char *name, void (*cfun)(INT32), const char *type, unsigned INT8 flags,
d68a072001-02-20Henrik Grubbström (Grubba)  unsigned INT16 opt_flags);
0929a02002-09-12Marcus Comstedt PMOD_EXPORT int quick_add_function(const char *name,
1ef5572000-08-30Henrik Grubbström (Grubba)  int name_length, void (*cfun)(INT32),
0929a02002-09-12Marcus Comstedt  const char *type,
1ef5572000-08-30Henrik Grubbström (Grubba)  int type_length, unsigned INT8 flags, unsigned INT16 opt_flags);
be478c1997-08-30Henrik Grubbström (Grubba) void check_all_programs(void);
eaa4da2001-10-04Fredrik Hübinette (Hubbe) void placeholder_index(INT32 args);
4218011999-01-31Fredrik Hübinette (Hubbe) void init_program(void);
be478c1997-08-30Henrik Grubbström (Grubba) void cleanup_program(void);
c94c371996-03-28Fredrik Hübinette (Hubbe) void gc_mark_program_as_referenced(struct program *p);
1f21332000-07-28Fredrik Hübinette (Hubbe) void real_gc_cycle_check_program(struct program *p, int weak);
e2d9e62000-06-10Martin Stjernholm unsigned gc_touch_all_programs(void);
be478c1997-08-30Henrik Grubbström (Grubba) void gc_check_all_programs(void); void gc_mark_all_programs(void);
e2d9e62000-06-10Martin Stjernholm void gc_cycle_check_all_programs(void);
45d87e2000-07-18Martin Stjernholm void gc_zap_ext_weak_refs_in_programs(void);
be478c1997-08-30Henrik Grubbström (Grubba) void gc_free_all_unreferenced_programs(void);
4218011999-01-31Fredrik Hübinette (Hubbe) void push_compiler_frame(int lexical_scope);
eaa4da2001-10-04Fredrik Hübinette (Hubbe) void low_pop_local_variables(int level);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) void pop_local_variables(int level); void pop_compiler_frame(void);
63540d2000-08-15Henrik Grubbström (Grubba) ptrdiff_t low_get_storage(struct program *o, struct program *p);
d6896c2000-12-16Marcus Comstedt PMOD_EXPORT char *get_storage(struct object *o, struct program *p);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) struct program *low_program_from_function(struct program *p, INT32 i);
3cd7482001-04-28Martin Stjernholm PMOD_EXPORT struct program *program_from_function(const struct svalue *f); PMOD_EXPORT struct program *program_from_svalue(const struct svalue *s);
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) struct find_child_cache_s; int find_child(struct program *parent, struct program *child); void yywarning(char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
0ee27b1998-04-14Fredrik Hübinette (Hubbe) struct implements_cache_s;
d6896c2000-12-16Marcus Comstedt PMOD_EXPORT int implements(struct program *a, struct program *b); PMOD_EXPORT int is_compatible(struct program *a, struct program *b);
03318e2000-03-16Fredrik Hübinette (Hubbe) int yyexplain_not_implements(struct program *a, struct program *b, int flags);
d6896c2000-12-16Marcus Comstedt PMOD_EXPORT void *parent_storage(int depth);
ac87152000-09-25Fredrik Hübinette (Hubbe) PMOD_EXPORT void change_compiler_compatibility(int major, int minor);
f822262001-07-16Fredrik Hübinette (Hubbe) void make_program_executable(struct program *p);
5267b71995-08-09Fredrik Hübinette (Hubbe) /* Prototypes end here */
eaa4da2001-10-04Fredrik Hübinette (Hubbe) void really_free_program(struct program *); void count_memory_in_programs(INT32*,INT32*);
f822262001-07-16Fredrik Hübinette (Hubbe) #ifndef PIKE_USE_MACHINE_CODE #define make_program_executable(X) #endif
45ee5d1999-02-10Fredrik Hübinette (Hubbe) 
1ef5572000-08-30Henrik Grubbström (Grubba) #define ADD_PROTOTYPE(NAME, TYPE, FLAGS) \
f0dcda2000-03-13Henrik Grubbström (Grubba) 
106f592000-08-31Henrik Grubbström (Grubba) #define ADD_INT_CONSTANT(NAME, CONST, FLAGS) \ quick_add_integer_constant(NAME, CONSTANT_STRLEN(NAME), CONST, FLAGS)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
e2d9e62000-06-10Martin Stjernholm 
1ef5572000-08-30Henrik Grubbström (Grubba) #define ADD_FUNCTION_DTYPE(NAME,FUN,DTYPE,FLAGS) do { \ DTYPE_START; \ {DTYPE} \ { \ struct pike_string *_t; \ DTYPE_END(_t); \ quick_add_function(NAME, CONSTANT_STRLEN(NAME), FUN, \ _t->str, _t->len, FLAGS, \ OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); \ free_string(_t); \ } \
91aab41999-12-13Martin Stjernholm } while (0)
1ef5572000-08-30Henrik Grubbström (Grubba) #define pike_add_function(NAME, CFUN, TYPE, FLAGS) \ pike_add_function2(NAME, CFUN, TYPE, FLAGS, \ OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND)
0542ef1999-11-17Fredrik Hübinette (Hubbe) #ifndef NO_PIKE_SHORTHAND #define add_function pike_add_function
5267b71995-08-09Fredrik Hübinette (Hubbe) #endif
3c0c281998-01-26Fredrik Hübinette (Hubbe) 
9036e82001-08-16Martin Stjernholm #define ADD_INHERIT(PROGRAM, FLAGS) \ low_inherit((PROGRAM), 0, 0, 0, (FLAGS), 0)
8524151999-12-14Fredrik Hübinette (Hubbe) #define START_NEW_PROGRAM_ID(ID) do { \
1ef5572000-08-30Henrik Grubbström (Grubba)  start_new_program(); \ Pike_compiler->new_program->id=PIKE_CONCAT3(PROG_,ID,_ID); \ }while(0)
8524151999-12-14Fredrik Hübinette (Hubbe) 
3c0c281998-01-26Fredrik Hübinette (Hubbe) #ifdef DEBUG_MALLOC
d00c501999-03-11Henrik Grubbström (Grubba) #define end_program() ((struct program *)debug_malloc_pass(debug_end_program()))
bad5162000-06-23Fredrik Hübinette (Hubbe) #define end_class(NAME, FLAGS) (debug_malloc_touch(Pike_compiler->new_program), debug_end_class(NAME, CONSTANT_STRLEN(NAME), FLAGS))
3c0c281998-01-26Fredrik Hübinette (Hubbe) #else
45ee5d1999-02-10Fredrik Hübinette (Hubbe) #define end_class(NAME,FLAGS) debug_end_class(NAME, CONSTANT_STRLEN(NAME), FLAGS)
3c0c281998-01-26Fredrik Hübinette (Hubbe) #define end_program debug_end_program #endif
bcd5741999-03-17Fredrik Hübinette (Hubbe)  #define start_new_program() debug_start_new_program(__LINE__,__FILE__)
8524151999-12-14Fredrik Hübinette (Hubbe) 
45d87e2000-07-18Martin Stjernholm #define gc_cycle_check_program(X, WEAK) \ gc_cycle_enqueue((gc_cycle_check_cb *) real_gc_cycle_check_program, (X), (WEAK))
e2d9e62000-06-10Martin Stjernholm 
bad5162000-06-23Fredrik Hübinette (Hubbe) /* This can be used for backwards compatibility * (if added to program.h in Pike 0.6 and Pike 7.0 * -Hubbe */ #define Pike_new_program Pike_compiler->new_program
e2d9e62000-06-10Martin Stjernholm 
4f91582001-01-10Martin Stjernholm /* Return true if compat version is equal or less than MAJOR.MINOR */
ac87152000-09-25Fredrik Hübinette (Hubbe) #define TEST_COMPAT(MAJOR,MINOR) \ (Pike_compiler->compat_major < (MAJOR) || \ (Pike_compiler->compat_major == (MAJOR) && \ Pike_compiler->compat_minor <= (MINOR)))
e2d9e62000-06-10Martin Stjernholm #endif /* PROGRAM_H */
1ef5572000-08-30Henrik Grubbström (Grubba)  /* Kludge... */ #ifndef LAS_H /* FIXME: Needed for the OPT_??? macros. * Maybe they should be moved here, since las.h includes this file anyway? */ #include "las.h" #endif /* !LAS_H */