pike.git / src / program.c

version» Context lines:

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.489 2003/03/19 19:52:28 nilsson Exp $ + || $Id: program.c,v 1.490 2003/03/27 02:20:24 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.489 2003/03/19 19:52:28 nilsson Exp $"); + RCSID("$Id: program.c,v 1.490 2003/03/27 02:20:24 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:6345:    */   struct program *placeholder_program;   struct object *placeholder_object;      void placeholder_index(INT32 args)   {    pop_n_elems(args);    ref_push_object(Pike_fp->current_object);   }    + static void placeholder_sprintf (INT32 args) + { +  struct pike_string *s; +  +  if (!args || sp[-args].type != T_INT || sp[-args].u.integer != 'O') { +  pop_n_elems (args); +  push_int (0); +  return; +  } +  +  pop_n_elems (args); +  MAKE_CONST_STRING (s, "__placeholder_object"); +  ref_push_string (s); + } +    void init_program(void)   {    int i;    struct svalue key;    struct svalue val;    struct svalue id;    init_program_blocks();       MAKE_CONST_STRING(this_program_string,"this_program");    MAKE_CONST_STRING(this_string,"this");
pike.git/src/program.c:6402:    null_program=end_program();    s.type=T_PROGRAM;    s.u.program=null_program;    low_add_constant("__null_program",&s);    debug_malloc_touch(null_program);    }       {    struct svalue s;    start_new_program(); -  add_function("`()",placeholder_index,"function(mixed...:object)",0); -  add_function("`[]",placeholder_index,"function(mixed:object)",0); +  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.u.object=placeholder_object;    low_add_constant("__placeholder_object",&s);    debug_malloc_touch(placeholder_object);    }   }