Skip to content
Snippets Groups Projects
Commit 5207bb2a authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

new function: low_clone()

Rev: src/object.c:1.13
Rev: src/object.h:1.8
parent db3e1385
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
||| See the files COPYING and DISCLAIMER for more information. ||| See the files COPYING and DISCLAIMER for more information.
\*/ \*/
#include "global.h" #include "global.h"
RCSID("$Id: object.c,v 1.12 1997/01/27 01:22:56 hubbe Exp $"); RCSID("$Id: object.c,v 1.13 1997/02/07 01:33:03 hubbe Exp $");
#include "object.h" #include "object.h"
#include "dynamic_buffer.h" #include "dynamic_buffer.h"
#include "interpret.h" #include "interpret.h"
...@@ -33,7 +33,7 @@ void setup_fake_object() ...@@ -33,7 +33,7 @@ void setup_fake_object()
fake_object.refs=0xffffff; fake_object.refs=0xffffff;
} }
static struct object *low_clone(struct program *p) struct object *low_clone(struct program *p)
{ {
int e; int e;
struct object *o; struct object *o;
...@@ -103,14 +103,18 @@ static struct object *low_clone(struct program *p) ...@@ -103,14 +103,18 @@ static struct object *low_clone(struct program *p)
return o; return o;
} }
struct object *clone(struct program *p, int args) static void init_object(struct object *o, int args)
{ {
struct object *o=low_clone(p);
apply_lfun(o,LFUN___INIT,0); apply_lfun(o,LFUN___INIT,0);
pop_stack(); pop_stack();
apply_lfun(o,LFUN_CREATE,args); apply_lfun(o,LFUN_CREATE,args);
pop_stack(); pop_stack();
}
struct object *clone(struct program *p, int args)
{
struct object *o=low_clone(p);
init_object(o,args);
return o; return o;
} }
......
...@@ -38,6 +38,7 @@ extern struct program *master_program; ...@@ -38,6 +38,7 @@ extern struct program *master_program;
/* Prototypes begin here */ /* Prototypes begin here */
void setup_fake_object(); void setup_fake_object();
struct object *low_clone(struct program *p);
struct object *clone(struct program *p, int args); struct object *clone(struct program *p, int args);
struct object *get_master(); struct object *get_master();
struct object *master(); struct object *master();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment