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.437 2008/06/06 21:50:14 grubba Exp $ + // $Id: master.pike.in,v 1.438 2008/06/06 22:29:46 grubba 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:169:    string combine_path_with_cwd(string path);   #ifdef FILE_STAT_CACHE    extern int invalidate_time;    extern mapping(string:multiset(string)) dir_cache;    local array(mixed) master_file_stat(string x)    {    Stat st = global::master_file_stat(x);    return st && (array)st;    }   #endif -  mapping (string:array(string)) environment; -  mixed getenv(string|void s); -  void putenv(string var, string val); +  +  //! Mapping containing the environment variables. +  //! +  //! The mapping currently has the following structure: +  //! @mapping +  //! @member array(string) index +  //! Note that the index is @[lower_case()]'d on NT. +  //! @array +  //! @elem string varname +  //! Variable name with case intact. +  //! @elem string value +  //! Variable value. +  //! @endarray +  //! @endmapping +  //! +  //! @note +  //! This mapping should not be accessed directly; use @[getenv()] +  //! and @[putenv()] instead. This mapping is not publicly +  //! accessible in pikes newer than 7.6. +  //! +  //! @note +  //! This mapping is not compatible with @[Process.create_process()]; +  //! use the mapping returned from calling @[getenv()] without arguments +  //! instead. +  //! +  //! @bugs +  //! This mapping is not the real environment; it is just a copy of +  //! the environment made at startup. +  local mapping(string:array(string)) environment; +  +  local string|mapping(string:string) getenv(string|void s) +  { +  if(!s) return [mapping(string:string)]aggregate_mapping( @(values(environment)*({}) ) ); + #ifdef __NT__ +  s = lower_case(s); + #endif +  return environment[s] && environment[s][1]; +  } +  +  local void putenv(string varname, string|void value) +  { +  // Try to update the real enviroment too, but ignore errors since +  // the fake environment could accommodate wide strings, strings +  // with NULs etc. +  catch {Builtin._putenv (varname, value);}; +  string index = varname; + #ifdef __NT__ +  index = lower_case(varname); +  if (environment[index] && environment[index][0]) +  varname = environment[index][0]; + #endif +  if (value) { +  environment[index] = ({ varname, value }); +  } else { +  m_delete(environment, index); +  } +  } +     void add_include_path(string tmp);    void remove_include_path(string tmp);    void add_module_path(string tmp);    void remove_module_path(string tmp);    void add_program_path(string tmp);    void remove_program_path(string tmp);    mapping(string:program|NoValue) programs;   #if constant(_static_modules.Builtin.mutex)    extern object compilation_mutex;   #endif
pike.git/lib/master.pike.in:591:    Pike_7_6_compat_handler = global::get_compilation_handler(7, 6);    }    return Pike_7_6_compat_handler->resolv(identifier, current_file);    }    array get_backtrace (object|array err);    object get_compat_master(int major, int minor)    {    if ((major == 7) && (minor > 2)) return Pike_7_4_master::this;    return Pike_7_4_master::get_compat_master(major, minor);    } -  -  //! Mapping containing the environment variables. -  //! -  //! The mapping currently has the following structure: -  //! @mapping -  //! @member array(string) index -  //! Note that the index is @[lower_case()]'d on NT. -  //! @array -  //! @elem string varname -  //! Variable name with case intact. -  //! @elem string value -  //! Variable value. -  //! @endarray -  //! @endmapping -  //! -  //! @note -  //! This mapping should not be accessed directly; use @[getenv()] -  //! and @[putenv()] instead. This mapping is not publicly -  //! accessible in pikes newer than 7.6. -  //! -  //! @note -  //! This mapping is not compatible with @[Process.create_process()]; -  //! use the mapping returned from calling @[getenv()] without arguments -  //! instead. -  //! -  //! @bugs -  //! This mapping is not the real environment; it is just a copy of -  //! the environment made at startup. -  local mapping(string:array(string)) environment; -  -  local string|mapping(string:string) getenv(string|void s) -  { -  if(!s) return [mapping(string:string)]aggregate_mapping( @(values(environment)*({}) ) ); - #ifdef __NT__ -  s = lower_case(s); - #endif -  return environment[s] && environment[s][1]; +    }    -  local void putenv(string varname, string|void value) -  { -  // Try to update the real enviroment too, but ignore errors since -  // the fake environment could accommodate wide strings, strings -  // with NULs etc. -  catch {Builtin._putenv (varname, value);}; -  string index = varname; - #ifdef __NT__ -  index = lower_case(varname); -  if (environment[index] && environment[index][0]) -  varname = environment[index][0]; - #endif -  if (value) { -  environment[index] = ({ varname, value }); -  } else { -  m_delete(environment, index); -  } -  } - } -  +    //! Namespaces for compat masters.   //!   //! This inherit is used to provide compatibility namespaces   //! for @[get_compat_master()].   //!   //! @seealso   //! @[get_compat_master()]   static inherit Pike_7_6_master;      //! @appears error
pike.git/lib/master.pike.in:5452:    case 'O': return "master()";    }   }      //! Return a master object compatible with the specified version of Pike.   //!   //! This function is used to implement the various compatibility versions   //! of @[master()].   //!   //! @seealso - //! @[get_compat_handler()], @[master()] + //! @[get_compilation_handler()], @[master()]   local object get_compat_master(int major, int minor)   {    if ((major > 7) || ((major == 7) && (minor > 6))) return this;    if ((major == 7) && (minor > 4)) return Pike_7_6_master::this;    return Pike_7_6_master::get_compat_master(major, minor);   }