pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.177 2001/11/12 13:38:04 mast Exp $ +  * $Id: master.pike.in,v 1.178 2001/11/13 15:46:22 tomas Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:290:    file=lower_case(file);   #endif    if(d && !d[file]) return 0;       return predef::file_stat(x);   }   #else   #define master_file_stat file_stat   #endif    - mapping (string:string) environment=([]); + mapping (string:array(string)) environment=([]);       -  +    //! @decl string getenv(string varname)   //! @decl mapping(string:string) getenv()   //! @appears getenv   //! - //! When called with no arguments, a mapping with all current envrionment + //! When called with no arguments, a mapping with all current environment   //! variables will be returned.   //!   //! If the @[varname] argument has been given, the value of the environment   //! variable with the name @[varname] will be returned. If no such   //! environment variable exists, @tt{0@} (zero) will be returned.   //! -  + //! On NT the environment variable name is case insensitive. + //!   string|mapping(string:string) getenv(string|void s)   { -  if(!s) return environment + ([]); -  return environment[s]; +  if(!s) return aggregate_mapping( @(values(environment)*({}) ) ); + #ifdef __NT__ +  s = lower_case(s); + #endif +  return environment[s] && environment[s][1];   }         //! @appears compile_file   //! Compile the Pike code contained in the file @[filename] into a program.   //!   //! This function will compile the file @[filename] to a Pike program that can   //! later be instantiated. It is the same as doing   //! @code{@[compile_string](@[Stdio.read_file](@[filename]), @[filename])@}.   //!
pike.git/lib/master.pike.in:371:   string getenv(string s)   {    if(!s) return environment + ([]);    return environment[s];   }   #endif /* 0 */      //! @appears putenv   //! Sets the environment variable @[varname] to @[value].   //! + //! On NT the environment variable name is case insensitive. + //!   //! @seealso   //! @[getenv()]   //!   void putenv(string varname, string value)   { -  environment[varname] = value; +  string index = varname; + #ifdef __NT__ +  index = lower_case(varname); +  if (environment[index] && environment[index][0]) +  varname = environment[index][0]; + #endif +  environment[index] = ({ varname, value });   }      //! @appears normalize_path   //! Replaces "\" with "/" if runing on MS Windows. It is   //! adviced to use @[system.normalize_path] instead.   string normalize_path( string path )   {   #ifndef __NT__    return path;   #else
pike.git/lib/master.pike.in:1454:       foreach(env,a)    {    if(sscanf(a,"%s=%s",a,b))    {    if(a=="") // Special hack for NT    {    sscanf(b,"%s=%s",a,b);    a="="+a;    } -  environment[a]=b; +  putenv(a, b);    }else{    werror("Broken environment var %s\n",a);    }    }            #ifndef NOT_INSTALLED    q=(getenv("PIKE_INCLUDE_PATH")||"")/":"-({""});    for(i=sizeof(q)-1;i>=0;i--) add_include_path(q[i]);