pike.git/
src/
program.c
Branch:
Tag:
Non-build tags
All tags
No tags
2000-08-28
2000-08-28 19:35:04 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
5582a83ac3d17ec81311249e157fa24bf362b2e4 (
64
lines) (+
22
/-
42
)
[
Show
|
Annotate
]
Branch:
7.9
cut away the dead meat...
Rev: src/program.c:1.267
5:
\*/ /**/ #include "global.h"
-
RCSID("$Id: program.c,v 1.
266
2000/08/
24
13
:
58
:
24
grubba
Exp $");
+
RCSID("$Id: program.c,v 1.
267
2000/08/
28
19
:
35
:
04
hubbe
Exp $");
#include "program.h" #include "object.h" #include "dynamic_buffer.h"
1728:
/* * make this program inherit another program */
-
static
void
really_
low_inherit(struct program *p,
+
void low_inherit(struct program *p,
struct object *parent, int parent_identifier, int parent_offset, INT32 flags,
-
struct pike_string *name
,
-
int parent_identifier_offset
)
+
struct pike_string *name)
{ int e; ptrdiff_t inherit_offset, storage_offset;
1931:
} }
-
void low_inherit(struct program *p,
-
struct object *parent,
-
int parent_identifier,
-
int parent_offset,
-
INT32 flags,
-
struct pike_string *name)
-
{
-
really_low_inherit(p,parent,parent_identifier,parent_offset,flags,name,0);
-
}
-
-
+
PMOD_EXPORT void do_inherit(struct svalue *s, INT32 flags, struct pike_string *name) { struct program *p=program_from_svalue(s);
-
really_
low_inherit(p,
+
low_inherit(p,
s->type == T_FUNCTION ? s->u.object : 0, s->type == T_FUNCTION ? s->subtype : -1, 0, flags,
-
name
,
-
Pike_compiler->new_program->num_identifiers
);
+
name);
} void compiler_do_inherit(node *n,
1962:
{ struct program *p; struct identifier *i;
-
INT32 numid=-1, offset=0
,parentoff=0
;
;
+
INT32 numid=-1, offset=0;
if(!n) {
1975:
p=Pike_compiler->new_program; offset=0; numid=n->u.id.number;
-
parentoff=Pike_compiler->new_program->num_identifiers;
+
goto continue_inherit; case F_EXTERNAL: { struct program_state *state = Pike_compiler;
-
offset = 0;
/* FIXME: Should this be zero or 1? */
+
offset = 0;
while (state && (state->new_program->id != n->u.integer.a)) { state = state->previous; offset++;
1993:
} p = state->new_program; numid = n->u.integer.b;
-
if(offset==-1)
-
{
-
parentoff=Pike_compiler->new_program->num_identifiers;
-
}else{
-
parentoff=~INHERIT_FROM_INT(p,numid)->identifier_level;
+
}
-
}
+
continue_inherit:
2021:
return; }
-
really_
low_inherit(p,
+
low_inherit(p,
0, numid, offset+42, flags,
-
name
,
-
parentoff
);
+
name);
break; default: