pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || 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: builtin.cmod,v 1.180 2006/03/11 17:20:47 grubba Exp $ + || $Id: builtin.cmod,v 1.181 2006/03/11 17:46:21 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin.cmod:1932:    *! a string, with more than one replace string. The replace strings    *! are given to the create method as a @i{from@} and @i{to@} array    *! and are then analyzed. The @expr{`()@} is then called with a    *! string and the replace rules in the Replace object will be    *! applied. The Replace object is used internally by the Pike    *! optimizer and need not be used manually.    */   PIKECLASS multi_string_replace   {    CVAR struct replace_many_context ctx; +  /* NOTE: from and to are only kept for _encode()'s use. */    CVAR struct array *from;    CVAR struct array *to;       /*! @decl void create(array(string)|mapping(string:string)|void from, @    *! array(string)|string|void to)    */    PIKEFUN void create(array(string)|mapping(string:string)|void from_arg,    array(string)|string|void to_arg)    {    int i;
pike.git/src/builtin.cmod:2015:       pop_n_elems(args);    push_int(0);    }       /*! @decl string `()(string str)    */    PIKEFUN string `()(string str)    {    if (!THIS->ctx.v) { -  add_ref(str); -  RETURN str; +  /* The result is already on the stack in the correct place... */ +  return;    }       RETURN execute_replace_many(&THIS->ctx, str);    }       /*! @decl array(array(string)) _encode()    */    PIKEFUN array(array(string)) _encode()    {    if (THIS->from) {