pike.git
/
src
/
program.h
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.h:1:
/* || 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.
-
|| $Id: program.h,v 1.
222
2006/
04
/
27
09
:
37
:
33
tor
Exp $
+
|| $Id: program.h,v 1.
223
2006/
07
/
05
02
:
21
:
21
mast
Exp $
*/ #ifndef PROGRAM_H #define PROGRAM_H #include <stdarg.h> #include "global.h" #include "pike_macros.h" #include "pike_error.h" #include "svalue.h" #include "dmalloc.h" #include "time_stuff.h" #include "program_id.h" #include "pike_rusage.h" #include "block_alloc_h.h" /* Needed to support dynamic loading on NT */
-
PMOD_
PROTO
extern struct program_state * Pike_compiler;
+
PMOD_
EXPORT
extern struct program_state * Pike_compiler;
/* 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 /* #define FORCE_RESOLVE_DEBUG */ /* Helper macros for force_resolve */ #ifdef FORCE_RESOLVE_DEBUG
pike.git/src/program.h:579:
#define PROG_FROM_PTR(P,X) (dmalloc_touch(struct program *,INHERIT_FROM_PTR(P,X)->prog)) #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, PTR_FROM_INT(P, X)) #define PROG_FROM_INT(P,X) PROG_FROM_PTR(P, PTR_FROM_INT(P, X)) #define ID_FROM_INT(P,X) ID_FROM_PTR(P, PTR_FROM_INT(P, X)) #define FIND_LFUN(P,N) ( dmalloc_touch(struct program *,(P))->flags & PROGRAM_FIXED?((P)->lfuns[(N)]):low_find_lfun((P), (N)) ) #define QUICK_FIND_LFUN(P,N) (dmalloc_touch(struct program *,(P))->lfuns[N]) #ifdef DO_PIKE_CLEANUP
-
extern int gc_external_refs_zapped;
-
void gc_check_zapped (void *a, TYPE_T type, const char *file, int line);
+
PMOD_EXPORT
extern int gc_external_refs_zapped;
+
PMOD_EXPORT
void gc_check_zapped (void *a, TYPE_T type, const char *file, int line);
#endif
-
+
#if defined (USE_DLL) && defined (DYNAMIC_MODULE)
+
/* Use the function in modules so we don't have to export the block
+
* alloc stuff. */
+
#define free_program(p) do_free_program(p)
+
#else
#define free_program(p) do{ \ struct program *_=(p); \ debug_malloc_touch(_); \ DO_IF_DEBUG ( \ DO_IF_PIKE_CLEANUP ( \ if (gc_external_refs_zapped) \ gc_check_zapped (_, PIKE_T_PROGRAM, __FILE__, __LINE__))); \ if(!sub_ref(_)) \ really_free_program(_); \ }while(0)
-
+
#endif
BLOCK_ALLOC_FILL_PAGES(program, n/a); extern struct object *error_handler; extern struct object *compat_handler; extern struct program *first_program; extern struct program *null_program; extern struct program *pike_trampoline_program;
pike.git/src/program.h:641:
struct Supporter *dependants; struct Supporter *next_dependant; supporter_callback *fun; void *data; struct program *prog; }; /* Prototypes begin here */
+
PMOD_EXPORT void do_free_program (struct program *p);
void ins_int(INT32 i, void (*func)(char tmp)); void ins_short(int i, void (*func)(char tmp)); void add_relocated_int_to_program(INT32 i); void use_module(struct svalue *s); void unuse_modules(INT32 howmany); node *find_module_identifier(struct pike_string *ident, int see_inherit); node *resolve_identifier(struct pike_string *ident); node *program_magic_identifier (struct program_state *state, int state_depth, int inherit_num,
pike.git/src/program.h:681:
void dump_program_tables (struct program *p, int indent); void check_program(struct program *p); struct program *end_first_pass(int finish); PMOD_EXPORT struct program *debug_end_program(void); PMOD_EXPORT size_t low_add_storage(size_t size, size_t alignment, ptrdiff_t modulo_orig); PMOD_EXPORT void set_init_callback(void (*init_callback)(struct object *)); PMOD_EXPORT void set_exit_callback(void (*exit_callback)(struct object *)); PMOD_EXPORT void set_gc_recurse_callback(void (*m)(struct object *)); PMOD_EXPORT void set_gc_check_callback(void (*m)(struct object *));
-
void pike_set_prog_event_callback(void (*cb)(int));
-
void pike_set_prog_optimize_callback(node *(*opt)(node *));
+
PMOD_EXPORT
void pike_set_prog_event_callback(void (*cb)(int));
+
PMOD_EXPORT
void pike_set_prog_optimize_callback(node *(*opt)(node *));
int really_low_reference_inherited_identifier(struct program_state *q, int e, int i); int low_reference_inherited_identifier(struct program_state *q, int e, struct pike_string *name, int flags); int find_inherit(struct program *p, struct pike_string *name); node *reference_inherited_identifier(struct pike_string *super_name, struct pike_string *function_name);
pike.git/src/program.h:772:
PMOD_EXPORT int debug_end_class(const char *name, ptrdiff_t namelen, INT32 flags); INT32 define_function(struct pike_string *name, struct pike_type *type, unsigned flags, unsigned function_flags, union idptr *func, unsigned opt_flags); int really_low_find_shared_string_identifier(struct pike_string *name, struct program *prog, int flags);
-
int low_find_lfun(struct program *p, ptrdiff_t lfun);
+
PMOD_EXPORT
int low_find_lfun(struct program *p, ptrdiff_t lfun);
int lfun_lookup_id(struct pike_string *lfun_name); int low_find_shared_string_identifier(struct pike_string *name, struct program *prog); struct ff_hash; int find_shared_string_identifier(struct pike_string *name, struct program *prog); PMOD_EXPORT int find_identifier(const char *name,struct program *prog); int store_prog_string(struct pike_string *str); int store_constant(struct svalue *foo, int equal,
pike.git/src/program.h:870:
struct implements_cache_s; PMOD_EXPORT int implements(struct program *a, struct program *b); PMOD_EXPORT int is_compatible(struct program *a, struct program *b); void yyexplain_not_compatible(struct program *a, struct program *b, int flags); void yyexplain_not_implements(struct program *a, struct program *b, int flags); PMOD_EXPORT void *parent_storage(int depth); PMOD_EXPORT void change_compiler_compatibility(int major, int minor); void make_program_executable(struct program *p); /* Prototypes end here */
-
void really_free_program(struct program *);
+
void count_memory_in_programs(INT32*,INT32*); #ifndef PIKE_USE_MACHINE_CODE #define make_program_executable(X) #endif #define ADD_FUNCTION(NAME, FUNC, TYPE, FLAGS) \ quick_add_function(NAME, CONSTANT_STRLEN(NAME), FUNC, TYPE,\ CONSTANT_STRLEN(TYPE), FLAGS, \ OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND)