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.441 2008/06/07 16:16:39 grubba Exp $ + // $Id: master.pike.in,v 1.442 2008/06/10 12:39:44 mast 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:1008:    environment[lower_case (var)] = val;   }   #endif      //! @decl string getenv (string varname, void|int force_update)   //! @decl mapping(string:string) getenv (void|int force_update)   //!   //! Queries the environment variables. The first variant returns the   //! value of a specific variable or zero if it doesn't exist in the   //! environment. The second variant returns the whole environment as a - //! mapping. Destructive opreations on the mapping will not affect the + //! mapping. Destructive operations on the mapping will not affect the   //! internal environment representation.   //!   //! A cached copy of the real environment is kept to make this   //! function quicker. If the optional flag @[force_update] is nonzero   //! then the real environment is queried and the cache is updated from   //! it. That can be necessary if the environment changes through other   //! means than @[putenv], typically from a C-level library.   //!   //! Variable names and values cannot be wide strings nor contain   //! @expr{'\0'@} characters. Variable names also cannot contain   //! @expr{'='@} characters.   //!   //! @note   //! On NT the environment variable name is case insensitive.   //!   //! @seealso   //! @[putenv()] - string|mapping(string:string) getenv (void|int|string var, + string|mapping(string:string) getenv (void|int|string varname,    void|int force_update)   {    // Variants doesn't seem to work well yet. -  if (stringp (var)) { +  if (stringp (varname)) {    if (!environment || force_update) {   #ifdef __NT__    set_lc_env (Builtin._getenv());   #else    environment = Builtin._getenv();   #endif    // Kill the compat environment if forced.    compat_environment = compat_environment_copy = 0;    }   
pike.git/lib/master.pike.in:1057:    if (!equal(res = compat_environment[var], compat_environment_copy[var])) {    // Something has messed with the compat environment mapping.    putenv(var, res && res[1]);    }    }       return environment[var];    }       else { -  force_update = var; +  force_update = varname;       mapping(string:string) res;       if (force_update) {    res = Builtin._getenv();   #ifdef __NT__    set_lc_env (res);   #else    environment = res + ([]);   #endif
pike.git/lib/master.pike.in:1105:    }       return res;    }   }      void putenv (string varname, void|string value)   //! Sets the environment variable @[varname] to @[value].   //!   //! If @[value] is omitted or zero, the environment variable - //! @[varname] will be removed. + //! @[varname] is removed.   //!   //! @[varname] and @[value] cannot be wide strings nor contain   //! @expr{'\0'@} characters. @[varname] also cannot contain   //! @expr{'='@} characters.   //!   //! @note   //! On NT the environment variable name is case insensitive.   //!   //! @seealso   //! @[getenv()]
pike.git/lib/master.pike.in:3375:    {    switch(opts[0])    {    case "dumpversion":    write("%d.%d.%d\n", __REAL_MAJOR__, __REAL_MINOR__, __REAL_BUILD__);    exit(0);       case "version":    werror(version() + " Copyright © 1994-2008 Linköping University\n"    "Pike comes with ABSOLUTELY NO WARRANTY; This is free software and you are\n" -  "welcome to redistribute it under certain conditions; Read the files\n" +  "welcome to redistribute it under certain conditions; read the files\n"    "COPYING and COPYRIGHT in the Pike distribution for more details.\n");    exit(0);       case "help":    werror( main_resolv("Tools.MasterHelp")->do_help(opts[1]) );    exit(0);       case "features":    postparseaction="features";    break;