pike.git
/
src
/
program.h
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.h:1:
/*\ ||| This file a part of Pike, and is copyright by Fredrik Hubinette ||| Pike is distributed as GPL (General Public License) ||| See the files COPYING and DISCLAIMER for more information. \*/ /*
-
* $Id: program.h,v 1.
108
2000/08/
29
00
:
09
:
47
hubbe
Exp $
+
* $Id: program.h,v 1.
109
2000/08/
30
21
:
58
:
17
grubba
Exp $
*/ #ifndef PROGRAM_H #define PROGRAM_H #include <stdarg.h> #include "global.h" #include "pike_types.h" #include "pike_macros.h" #include "svalue.h" #include "time_stuff.h"
pike.git/src/program.h:139:
#define IDENTIFIER_IS_PIKE_FUNCTION(X) ((X) & IDENTIFIER_PIKE_FUNCTION) #define IDENTIFIER_IS_CONSTANT(X) ((X) & IDENTIFIER_CONSTANT) #define IDENTIFIER_IS_VARIABLE(X) (!((X) & (IDENTIFIER_FUNCTION | IDENTIFIER_CONSTANT))) #define IDENTIFIER_MASK 127 struct identifier { struct pike_string *name; struct pike_string *type;
-
unsigned
INT16
identifier_flags; /* IDENTIFIER_??? */
-
unsigned
INT16
run_time_type;
+
unsigned
INT8
identifier_flags;
/* IDENTIFIER_??? */
+
unsigned
INT8
run_time_type;
/* PIKE_T_??? */
+
unsigned INT16 opt_flags; /* OPT_??? */
#ifdef PROFILING unsigned INT32 num_calls; unsigned INT32 total_time; unsigned INT32 self_time; #endif /* PROFILING */ union idptr func; }; struct program_constant {
pike.git/src/program.h:425:
PMOD_EXPORT int add_program_constant(char *name, struct program *p, INT32 flags); PMOD_EXPORT int add_object_constant(char *name, struct object *o, INT32 flags); PMOD_EXPORT int add_function_constant(char *name, void (*cfun)(INT32), char * type, INT16 flags); PMOD_EXPORT int debug_end_class(char *name, ptrdiff_t namelen, INT32 flags); INT32 define_function(struct pike_string *name, struct pike_string *type,
-
INT16
flags,
-
INT8 function_flags,
-
union idptr *func);
+
unsigned
INT8
flags,
+
unsigned
INT8 function_flags,
+
union idptr *func
,
+
unsigned INT16 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); 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); int find_identifier(char *name,struct program *prog);
pike.git/src/program.h:453:
struct array *program_values(struct program *p); void program_index_no_free(struct svalue *to, struct program *p, struct svalue *ind); int get_small_number(char **q); void start_line_numbering(void); void store_linenumber(INT32 current_line, struct pike_string *current_file); char *get_line(unsigned char *pc,struct program *prog,INT32 *linep); void my_yyerror(char *fmt,...) ATTRIBUTE((format(printf,1,2))); struct program *compile(struct pike_string *prog, struct object *handler);
-
int pike_add_
function
(char *name,void (*cfun)(INT32),char *type,INT16 flags);
+
int pike_add_
function2
(char *name,
void (*cfun)(INT32),
+
char *type,
unsigned INT8 flags,
+
unsigned
INT16
opt_
flags);
PMOD_EXPORT int quick_add_function(char *name, int name_length, void (*cfun)(INT32), char *type, int type_length,
-
INT16
flags,
-
int
opt_flags);
+
unsigned INT8
flags,
+
unsigned INT16
opt_flags);
void check_all_programs(void); void init_program(void); void cleanup_program(void); void gc_mark_program_as_referenced(struct program *p); void real_gc_cycle_check_program(struct program *p, int weak); unsigned gc_touch_all_programs(void); void gc_check_all_programs(void); void gc_mark_all_programs(void); void gc_cycle_check_all_programs(void); void gc_zap_ext_weak_refs_in_programs(void);
pike.git/src/program.h:492:
struct find_child_cache_s; int find_child(struct program *parent, struct program *child); void yywarning(char *fmt, ...) ATTRIBUTE((format(printf,1,2))); struct implements_cache_s; int implements(struct program *a, struct program *b); int is_compatible(struct program *a, struct program *b); int yyexplain_not_implements(struct program *a, struct program *b, int flags); void *parent_storage(int depth); /* Prototypes end here */
-
#define ADD_FUNCTION(NAME,FUNC,TYPE,FLAGS) \
-
quick_add_function(NAME,CONSTANT_STRLEN(NAME),FUNC,TYPE,CONSTANT_STRLEN(TYPE),FLAGS,
0
)
+
#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
)
-
#define ADD_PROTOTYPE(NAME,TYPE,FLAGS) \
-
quick_add_function(NAME,CONSTANT_STRLEN(NAME),0,TYPE,CONSTANT_STRLEN(TYPE),FLAGS,
0
)
+
#define ADD_PROTOTYPE(NAME,
TYPE,
FLAGS) \
+
quick_add_function(NAME,
CONSTANT_STRLEN(NAME),
0,
TYPE,
\
+
CONSTANT_STRLEN(TYPE),
FLAGS,
\
+
OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND
)
#define ADD_INT_CONSTANT(NAME,CONST,FLAGS) \ quick_add_integer_constant(NAME,CONSTANT_STRLEN(NAME),CONST,FLAGS) #define PIKE_MAP_VARIABLE(NAME,OFFSET,TYPE,RTTYPE,FLAGS) \ quick_map_variable(NAME,CONSTANT_STRLEN(NAME),OFFSET,TYPE,CONSTANT_STRLEN(TYPE),RTTYPE,FLAGS)
-
#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,0
); \
-
free_string(_t);
\
-
}
\
+
#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); \
+
} \
} while (0)
-
+
#define pike_add_function(NAME, CFUN, TYPE, FLAGS) \
+
pike_add_function2(NAME, CFUN, TYPE, FLAGS, \
+
OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND)
+
#ifndef NO_PIKE_SHORTHAND #define add_function pike_add_function #endif #define START_NEW_PROGRAM_ID(ID) do { \ start_new_program(); \ Pike_compiler->new_program->id=PIKE_CONCAT3(PROG_,ID,_ID); \ }while(0) #ifdef DEBUG_MALLOC
pike.git/src/program.h:550:
gc_cycle_enqueue((gc_cycle_check_cb *) real_gc_cycle_check_program, (X), (WEAK)) /* 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 #endif /* PROGRAM_H */
+
+
/* 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 */