pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // 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: master.pike.in,v 1.340 2004/04/11 15:56:26 grubba Exp $ + // $Id: master.pike.in,v 1.341 2004/04/17 15:18:52 marcus Exp $      #pike __REAL_VERSION__   //#pragma strict_types      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif   
pike.git/lib/master.pike.in:79:   int compat_major=-1;      //!   int compat_minor=-1;         // --- Functions begin here.      // Have to access some stuff without going through the resolver.   private constant Builtin = _static_modules.Builtin; - private constant Files = _static_modules.___files; + private constant Files = _static_modules.files;      #define Stat Files.Stat   #define capitalize(X) (upper_case((X)[..0])+(X)[1..])   #define write(X ...) (Files()->_stdout->write(X))   #define trim_all_whites(X) (Builtin()->string_trim_all_whites (X))      #ifdef RESOLV_DEBUG      #if constant (thread_local)   static object resolv_msg_depth = thread_local();
pike.git/lib/master.pike.in:1323:    if (set_module) module = ret;    if(mixed tmp=ret->_module_value) ret=tmp;    DEC_RESOLV_MSG_DEPTH();    resolv_debug("dirnode(%O)->ind(%O) => found submodule %O:%O\n",    dirname, index, fname, ret);    return ret;    }    } else {    resolv_debug("dirnode(%O)->ind(%O) casting (program)%O\n",    dirname, index, fname); -  program ret; +  program|object ret;    if (ret = low_cast_to_program(fname, 0, compilation_handler)) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug("dirnode(%O)->ind(%O) => found subprogram %O:%O\n",    dirname, index, fname, ret); -  + #if constant(load_module) +  if (has_suffix(fname, ".so")) { +  // This is compatible with 7.4 behaviour. +  if (!ret->_module_value) +  ret = ret(); +  if(mixed tmp=ret->_module_value) ret=tmp; +  } + #endif    return ret;    }    }    resolv_debug("dirnode(%O)->ind(%O) => failure for file %O\n",    dirname, index, fname);    }       resolv_debug("dirnode(%O)->ind(%O) => UNDEFINED\n",    dirname, index);    return UNDEFINED;
pike.git/lib/master.pike.in:1827:   }   #endif /* 0 */         multiset no_resolv = (<>);      //!   class CompatResolver   {    //! Actual resolver -  joinnode root_module = joinnode(({predef::_static_modules})); +  joinnode root_module = joinnode(({instantiate_static_modules(predef::_static_modules)}));       //! Lookup from handler module to corresponding root_module.    mapping(object:joinnode) handler_root_modules = ([]);       //! The pike system module path, not including any set by the user.    array(string) system_module_path=({});       //! The complete module search path    array(string) pike_module_path=({});   
pike.git/lib/master.pike.in:1978:    {    m_delete (predefines, name);    }       //! Returns a mapping with the current predefines.    mapping get_predefines()    {    return predefines;    }    +  //! Instantiate static modules in the same way that dynamic modules +  //! are instantiated. +  static mapping(string:mixed) instantiate_static_modules(object|mapping static_modules) +  { +  mapping(string:mixed) res = ([]); +  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; +  mapping(string:mixed) level = res; +  string pfx; +  while(2 == sscanf(name, "%s/%s", pfx, name)) +  level = (level[pfx] || (level[pfx] = ([]))); +  level[name] = val; +  } +  return res; +  } +     //!    mapping get_default_module()    {    /* This is an ugly kluge to avoid an infinite recursion.    * The infinite recursion occurs because this function is    * called for every file when the compat_major/minor is set.    * This kluge could cause problems with threads if the    * compiler was threaded. -Hubbe    */    int saved_compat_minor=compat_minor;
pike.git/lib/master.pike.in:2027:    // Check for _static_modules.    mixed static_modules = _static_modules;    if (current_handler->get_default_module) {    mapping(string:mixed) default_module =    current_handler->get_default_module();    if (default_module) {    static_modules = default_module["_static_modules"] || ([]);    }    }    -  node = joinnode(({ static_modules, +  node = joinnode(({ instantiate_static_modules(static_modules),    // Copy relevant stuff from the root module.    @filter(root_module->joined_modules,    lambda(mixed x) {    return objectp(x) && x->is_resolv_dirnode;    }) }),    current_handler,    root_module->fallback_module);       // FIXME: Is this needed?    // Kluge to get _static_modules to work at top level.