pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:9056:
MAKE_CONST_STRING(this_program_string,"this_program"); MAKE_CONST_STRING(this_string,"this"); MAKE_CONST_STRING(UNDEFINED_string,"UNDEFINED"); MAKE_CONST_STRING(args_string, "__args__"); MAKE_CONST_STRING(parser_system_string, "parser"); MAKE_CONST_STRING(type_check_system_string, "type_check"); MAKE_CONST_STRING(compat_lfun_destroy_string, "destroy");
-
lfun_ids = allocate_mapping(NUM_LFUNS);
-
lfun_types = allocate_mapping(NUM_LFUNS);
+
/* NB: One extra entry needed for
lfun
::destroy(). */
+
lfun
_ids = allocate_mapping(NUM_LFUNS
+ 1
);
+
lfun_types = allocate_mapping(NUM_LFUNS
+ 1
);
for (i=0; i < NELEM(lfun_names); i++) { lfun_strings[i] = make_shared_static_string(lfun_names[i], strlen(lfun_names[i]), eightbit); SET_SVAL(id, T_INT, NUMBER_NUMBER, integer, i); SET_SVAL(key, T_STRING, 0, string, lfun_strings[i]); mapping_insert(lfun_ids, &key, &id); SET_SVAL(val, T_TYPE, 0, type, make_pike_type(raw_lfun_types[i])); mapping_insert(lfun_types, &key, &val);
-
+
+
if (id == LFUN__DESTRUCT) {
+
/* Special case for lfun::destroy(). */
+
SET_SVAL(key, T_STRING, 0, string, compat_lfun_destroy_string);
+
/* FIXME: Adjust the type to be __deprecated__? */
+
mapping_insert(lfun_types, &key, &val);
free_type(val.u.type);
-
+
+
SET_SVAL(id, T_INT, NUMBER_NUMBER, integer, i);
+
mapping_insert(lfun_ids, &key, &id);
+
} else {
+
free_type(val.u.type);
}
-
+
}
lfun_getter_type_string = make_pike_type(tFuncV(tNone, tVoid, tMix)); lfun_setter_type_string = make_pike_type(tFuncV(tZero, tVoid, tVoid)); low_init_pike_compiler(); enter_compiler(NULL, 0); exit_compiler(); }