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.413 2008/03/20 15:03:07 grubba Exp $ + // $Id: master.pike.in,v 1.414 2008/03/26 22:31:04 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:80:      //!   int compat_minor=-1;      //!   int show_if_constant_errors = 0;      // --- Functions begin here.      // Have to access some stuff without going through the resolver. - private constant Builtin = _static_modules.Builtin; + private object(_static_modules.Builtin) Builtin = _static_modules.Builtin();   private constant Files = _static_modules.files;      #define Stat Files.Stat   #define capitalize(X) (upper_case((X)[..0])+(X)[1..]) - #define trim_all_whites(X) (Builtin()->string_trim_all_whites (X)) + #define trim_all_whites(X) (Builtin.string_trim_all_whites (X))      private function write = Files()->_stdout->write;   private function werror = Files()->_stderr->write;      #ifdef RESOLV_DEBUG      #if constant (thread_local)   static object resolv_msg_depth = thread_local();   // NOTE: May be used before __INIT has completed.   #define GET_RESOLV_MSG_DEPTH (resolv_msg_depth && resolv_msg_depth->get())
pike.git/lib/master.pike.in:717:    if (sizeof (args)) msg = sprintf (msg, @args);    msg = trim_all_whites (msg);    if (handler && handler->compile_warning)    handler->compile_warning (file, 0, msg);    else    compile_warning (file, 0, msg);   }      #if constant(_static_modules.Builtin.mutex)   #define THREADED - Builtin.mutex compilation_mutex = Builtin()->mutex(); + _static_modules.Builtin.mutex compilation_mutex = Builtin.mutex();   #endif      #ifdef __NT__   #define FIX_CASE(X) lower_case(X)   #else   #define FIX_CASE(X) (X)   #endif /* __NT__ */      static string base_from_filename(string fname)   {
pike.git/lib/master.pike.in:764:   //! @param mod   //! The module we are looking for.   //!   //! @returns   //! An array of strings with filenames.   //! (one for each file in a joinnode, or just one otherwise)   array(string) module_defined(object|program mod)   {    array files = ({});    if (programp(mod)) -  return ({ Builtin()->program_defined([program]mod) }); +  return ({ Builtin.program_defined([program]mod) });       array mods;    if (mod->is_resolv_joinnode)    mods = mod->joined_modules;    else    mods = ({ mod });       foreach (mods;; object mod)    {    if (mod->is_resolv_dirnode) -  files += ({ Builtin()->program_defined(object_program(mod->module)) }); +  files += ({ Builtin.program_defined(object_program(mod->module)) });    else -  files += ({ Builtin()->program_defined(object_program(mod)) }); +  files += ({ Builtin.program_defined(object_program(mod)) });    }    return files;   }      //! Enable caching of sources from compile_string()   void enable_source_cache()   {    if (!source_cache)    source_cache = ([]);   }
pike.git/lib/master.pike.in:827:    }          if (prog && !documentation[prog] && doc_extractor)    {    string source;    if (source_cache && source_cache[prog])    source = source_cache[prog];    else    { -  array sourceref = array_sscanf(Builtin()->program_defined(prog), +  array sourceref = array_sscanf(Builtin.program_defined(prog),    "%s%[:]%[0-9]");    source = master_read_file(sourceref[0]);    if (sizeof(sourceref[1]) && sizeof(sourceref[2]))    {    if (programp(prog))    child = ((describe_program(prog)||"")/".")[-1];    }    }       if (source)
pike.git/lib/master.pike.in:1105:   }      program low_cast_to_program(string pname,    string current_file,    object|void handler,    void|int mkobj)   {    string ext;    string nname;    -  // werror("low_cast_to_program(%O, %O, %O, %O)\n", -  // pname, current_file, handler, mkobj); +  //werror("low_cast_to_program(%O, %O, %O, %O)\n", +  // pname, current_file, handler, mkobj);       if(sscanf(reverse(BASENAME(pname)),"%s.%s",ext, nname))    {    ext="."+reverse(ext);    pname=pname[..<sizeof(ext)];    }    else {    ext="";    }   
pike.git/lib/master.pike.in:1477:    base,    base, base, base,    base,    paths[1]);    }    }    }   }      #else /* !0 */ +  + static object Unicode; +    //! Module node representing a single directory.   //!   //! @seealso   //! @[joinnode]   class dirnode   {    string dirname;    object|void compilation_handler;    constant is_resolv_dirnode = 1;    // objectp() is intentionally not used on the module object, to
pike.git/lib/master.pike.in:1504:   #else   #define FIX_CASE(X) (X)   #endif /* __NT__ */       static string base_from_filename(string fname)    {    string low_name = FIX_CASE(fname);    catch {    // FIXME: Warn on failure?    low_name = utf8_to_string(low_name); -  // FIXME: MacOS X/HFS uses decomposed Unicode by default. -  // Use Unicode.normalize(low_name, "NFC") to fix. +  if (Builtin.string_width(low_name)) { +  // We might need to normalize the string (cf MacOS X). +  +  // Load the Unicode module if it hasn't already been loaded. +  if (!Unicode) { +  Unicode = resolv("Unicode"); +  } +  low_name = Unicode.normalize(low_name, "NFC"); +  }    };    if (has_prefix(low_name, ".#")) return 0;    if (has_suffix(low_name, ".pike") ||    has_suffix(low_name, ".pmod")) {    return fname[..<5];    }    if (has_suffix(low_name, ".so")) {    return fname[..<3];    }    return 0;
pike.git/lib/master.pike.in:2642:   //! and an array containing the environment variables on the same form as   //! a C program receives them.   void _main(array(string) orig_argv, array(string) env)   {    array(string) argv=copy_value(orig_argv);    int debug,trace,run_tool;    object tmp;    string postparseaction=0;       predefines = initial_predefines = -  Builtin()->_take_over_initial_predefines(); +  Builtin._take_over_initial_predefines();    _pike_file_name = orig_argv[0];   #if constant(thread_create)    _backend_thread = this_thread();   #endif       foreach(env, string a)    if( sscanf(a, "%s=%s", a, string b)==2 ) {   #ifdef __NT__    if(a=="") {    sscanf(b, "%s=%s", a, b);
pike.git/lib/master.pike.in:3697:    (s=program_path_to_name(s, "object_program(", ")", "")))    return s;       if(object|program tmp=(function_object(p) || function_program(p))) {    if(s = function_name(p))    {    return describe_module(tmp) + s;    }    }    -  if(s=Builtin()->program_defined(p)) +  if(s=Builtin.program_defined(p))    return BASENAME(s);       return 0;   }      //!   string describe_function (function f)   {    if (!f) return 0;