pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c: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.c,v 1.
582
2004/12/19
14
:
47
:
12
grubba Exp $
+
|| $Id: program.c,v 1.
583
2004/12/19
16
:
43
:
38
grubba Exp $
*/ #include "global.h" #include "program.h" #include "object.h" #include "dynamic_buffer.h" #include "pike_types.h" #include "stralloc.h" #include "las.h" #include "lex.h"
pike.git/src/program.c:4283:
return n2; } } } run_time_type=compile_type_to_runtime_type(type); switch(run_time_type) { #ifdef AUTO_BIGNUM
-
#if 0
-
case T_OBJECT:
-
/* This is to allow room for integers in variables declared as
-
* 'object', however, this could be changed in the future to only
-
* make room for integers if the variable was declared as
-
* 'object(Gmp.mpz)' /Hubbe
-
*/
-
#endif
+
case T_INT: #endif
-
+
case T_OBJECT:
+
/* Make place for the object subtype. */
case T_FUNCTION: case T_PROGRAM: run_time_type = T_MIXED; } n=low_define_variable(name,type,flags, low_add_storage(sizeof_variable(run_time_type), alignof_variable(run_time_type),0), run_time_type);
pike.git/src/program.c:7067:
struct svalue s; start_new_program(); ADD_FUNCTION("`()", placeholder_index, tFuncV(tNone,tMix,tObj), 0); ADD_FUNCTION("`[]", placeholder_index, tFunc(tMix,tObj), 0); ADD_FUNCTION("_sprintf", placeholder_sprintf, tFunc(tInt tOr(tMapping,tVoid),tStr), 0); placeholder_program=end_program(); placeholder_object=fast_clone_object(placeholder_program); s.type=T_OBJECT;
+
s.subtype = 0;
s.u.object=placeholder_object; low_add_constant("__placeholder_object",&s); debug_malloc_touch(placeholder_object); } } void cleanup_program(void) { size_t e;
pike.git/src/program.c:7563:
switch(s->type) { case T_OBJECT: { struct program *p = s->u.object->prog; int call_fun; if (!p) return 0; #if 0
+
p = p->inherits[s->subtype].prog;
if ((call_fun = FIND_LFUN(p, LFUN_CALL)) >= 0) { /* Get the program from the return type. */ struct identifier *id = ID_FROM_INT(p, call_fun); /* FIXME: do it. */ return 0; } #endif push_svalue(s); f_object_program(1); p=program_from_svalue(Pike_sp-1);
pike.git/src/program.c:7998:
STACK_LEVEL_CHECK(1); if(compat_handler) { free_object(compat_handler); compat_handler = NULL; } if((Pike_sp[-1].type == T_OBJECT) && (Pike_sp[-1].u.object->prog)) {
+
if (Pike_sp[-1].subtype) {
+
/* FIXME: */
+
Pike_error("Subtyped compat handlers are not supported yet.\n");
+
}
compat_handler = dmalloc_touch(struct object *, Pike_sp[-1].u.object); dmalloc_touch_svalue(Pike_sp-1); Pike_sp--; } else { pop_stack(); } if (safe_apply_handler ("get_default_module", error_handler, compat_handler, 0, BIT_MAPPING|BIT_OBJECT|BIT_ZERO)) { if(Pike_sp[-1].type == T_INT)