pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:3191:    //! @[add_program_path()]    //!    void remove_program_path(string tmp)    {    tmp=normalize_path(combine_path_with_cwd(tmp));    pike_program_path-=({tmp});    }       //! Add a define (without arguments) which will be implicitly    //! defined in @[cpp] calls. -  void add_predefine (string name, string value) +  void add_predefine (string name, mixed value)    {    predefines[name] = value;    }       //! Remove a define from the set that are implicitly defined in    //! @[cpp] calls.    void remove_predefine (string name)    {    m_delete (predefines, name);    }       //! Returns a mapping with the current predefines.    mapping get_predefines()    {    return predefines;    }    -  +  string evaluate_define(string def, string arguments) +  { +  mixed val = arguments ? predefines[def+"()"] : predefines[def]; +  if( callablep(val) ) +  { +  object C = resolv("Parser.C"); +  array args; +  if( arguments ) +  args = map( +  map(C.group(C.split(arguments))/({","}),C.simple_reconstitute), +  resolv("String.trim_all_whites")); +  else +  args = ({}); +  +  val = val( @args ); +  } +  return (string)val; +  } +     //! Instantiate static modules in the same way that dynamic modules    //! are instantiated.    protected mapping(string:mixed) instantiate_static_modules(object|mapping static_modules)    {    mapping(string:mixed) res = ([]), joins = ([]);    foreach(indices(static_modules), string name) {    mixed val = static_modules[name];    if (!val->_module_value)    val = val();    if(mixed tmp=val->_module_value) val=tmp;