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.317 2003/12/18 23:00:35 marcus Exp $ + // $Id: master.pike.in,v 1.318 2003/12/18 23:23:39 marcus Exp $      #pike __REAL_VERSION__      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif      // --- Some configurable parameters
pike.git/lib/master.pike.in:351:    current_path=0;    return predef::cd(s);   }      string getcwd()   {    return current_path || (current_path=predef::getcwd());   }   #endif // GETCWD_CACHE    - string combine_path_with_cwd(string path) + string combine_path_with_cwd(string ... paths)   { -  return combine_path(IS_ABSOLUTE_PATH(path)?"":getcwd(),path); +  return combine_path(IS_ABSOLUTE_PATH(paths[0])?"":getcwd(),@paths);   }      #ifdef FILE_STAT_CACHE      #define FILE_STAT_CACHE_TIME 20      int invalidate_time;   mapping(string:multiset(string)) dir_cache = ([]);      Stat master_file_stat(string x)
pike.git/lib/master.pike.in:877:    }   }      program low_cast_to_program(string pname,    string current_file,    object|void handler,    void|int mkobj)   {    string ext;    string nname; -  array(string) tmp=EXPLODE_PATH(pname); +        // werror("low_cast_to_program(%O, %O, %O, %O)\n",    // pname, current_file, handler, mkobj);    -  if(sscanf(reverse(tmp[-1]),"%s.%s",ext, nname)) +  if(sscanf(reverse(BASENAME(pname)),"%s.%s",ext, nname))    {    ext="."+reverse(ext); -  tmp[-1]=reverse(nname); -  pname=tmp*"/"; +  pname=pname[..sizeof(pname)-sizeof(ext)-1];    }    else {    ext="";    }       if(IS_ABSOLUTE_PATH(pname))    {    program|NoValue prog = programs[pname];    if (programp (prog)) return prog;    pname=combine_path("",pname);
pike.git/lib/master.pike.in:1638:       void _decode (array(object) joined_modules)    {    this_program::joined_modules = joined_modules;    }   };      joinnode handle_import(string path, string|void current_file,    object|void current_handler)   { -  array(string) tmp; +    #ifdef __amigaos__    if(path == ".")    path = "";   #endif    if(current_file)    { -  tmp=EXPLODE_PATH(current_file); -  tmp[-1] = path; -  path=combine_path_with_cwd( tmp*"/"); +  path = combine_path_with_cwd(dirname(current_file), path);    } else {    path = combine_path_with_cwd(path);    }       // FIXME: Need caching!!!   #if 0    // FIXME: This caching strategy could be improved,    // since it ignores module_nodes from the    // ordinary module tree.   
pike.git/lib/master.pike.in:1740:    }       DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => not found\n", fullname);    return fc[fullname] = 0;   }      #if 0   mixed handle_import(string what, string|void current_file, object|void handler)   { -  array(string) tmp; +     string path;    if(current_file)    { -  tmp=EXPLODE_PATH(current_file); -  tmp[-1]=what; -  path=combine_path_with_cwd( tmp*"/"); +  path = combine_path_with_cwd(dirname(current_file), what);    } else {    path = combine_path_with_cwd(what);    }      #if 0    // If we can't cache the dirnode when we got a handler, then    // findmodule has to be broken too. Good caching is necessary for    // module dumping. /mast    if (handler) {    resolv_debug ("handle_import(%O, %O, %O) => new dirnode with handler\n",
pike.git/lib/master.pike.in:2078:       //! This function is called whenever an #include directive is encountered    //! it receives the argument for #include and should return the file name    //! of the file to include    string handle_include(string f,    string current_file,    int local_include)    {    if(local_include)    { -  array(string) tmp=EXPLODE_PATH(current_file); -  tmp[-1]=f; -  return combine_path_with_cwd(tmp*"/"); +  return combine_path_with_cwd(dirname(current_file), f);    }    else    {    foreach(pike_include_path, string path)    {    path=combine_path(path,f);    if(master_file_stat(fakeroot(path)))    return path;    }    if (fallback_resolver) {
pike.git/lib/master.pike.in:3194:    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)) -  return EXPLODE_PATH(s)[-1]; +  return BASENAME(s);       return 0;   }      //!   string describe_function (function f)   {    if (!f) return 0;       string name;       if(string s = programs_reverse_lookup (f))    {    if(has_suffix(s, ".pmod")) -  name = EXPLODE_PATH(s[..sizeof(s)-6])[-1]; +  name = BASENAME(s[..sizeof(s)-6]);    else    name = trim_file_name(s);    }    else    if (catch (name = function_name (f))) name = "function";       object o = function_object([function(mixed...:void|mixed)]f);    if(object_program (o)) { // Check if it's an object in a way that    // (hopefully) doesn't call any functions    // in it (neither `== nor `!).