From 41e434bf50c5f835e638cd561a901a0f1b8c923c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sat, 6 Sep 1997 15:50:08 +0200 Subject: [PATCH] Added efun master(), which always returns the current master-object. Rev: src/builtin_functions.c:1.42 --- src/builtin_functions.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index fa428171b5..54e0ebd01d 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.41 1997/08/30 18:35:22 grubba Exp $"); +RCSID("$Id: builtin_functions.c,v 1.42 1997/09/06 13:50:08 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -1690,6 +1690,13 @@ void f_replace_master(INT32 args) pop_n_elems(args); } +void f_master(INT32 args) +{ + pop_n_elems(args); + master_object->refs++; + push_object(master_object); +} + #ifdef HAVE_GETHRVTIME #include <sys/time.h> @@ -1760,6 +1767,7 @@ void init_builtin_efuns(void) add_efun("_refs",f__refs,"function(function|string|array|mapping|multiset|object|program:int)",OPT_EXTERNAL_DEPEND); add_efun("replace_master",f_replace_master,"function(object:void)",OPT_SIDE_EFFECT); + add_efun("master",f_master,"function(:object)",OPT_TRY_OPTIMIZE); add_efun("add_constant",f_add_constant,"function(string,void|mixed:void)",OPT_SIDE_EFFECT); add_efun("aggregate",f_aggregate,"function(mixed ...:mixed *)",OPT_TRY_OPTIMIZE); add_efun("aggregate_multiset",f_aggregate_multiset,"function(mixed ...:multiset)",OPT_TRY_OPTIMIZE); -- GitLab