pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:69:   #endif      //! @decl constant out_of_date_warning = 1   //! Should Pike complain about out of date compiled files.   //! 1 means yes and 0 means no. Controlled by the OUT_OF_DATE_WARNING   //! define.      //! If not zero compilation warnings will be written out on stderr.   int want_warnings = PIKE_WARNINGS;    + //! Major pike version to emulate.   //! -  + //! This is typically set via the option @expr{"-V"@}. + //! + //! @seealso + //! @[compat_minor]   int compat_major=-1;    -  + //! Minor pike version to emulate.   //! -  + //! This is typically set via the option @expr{"-V"@}. + //! + //! @seealso + //! @[compat_major]   int compat_minor=-1;    -  + //! Show compilation warnings from compilation of @[cpp()] + //! @expr{#if constant()@} expressions.   //! -  + //! This is typically set via the option @expr{"--picky-cpp"@}.   int show_if_constant_errors = 0;      int is_pike_master = 0;   // This integer variable should exist in any object that aspires to be   // the master. It gets set to 1 when the master is installed, and is   // therefore set in any object that is or has been the master. That   // makes the Encoder class encode references to the master and all   // ex-masters as references to the current master object.      mapping(string:object) fs_map = ([]);
pike.git/lib/master.pike.in:677:    source_cache[ret] = source;   #ifdef RECUR_COMPILE_DEBUG    DEC_MSG_DEPTH();    werror ("%*s<<< compile_string %O\n", GET_MSG_DEPTH, "", filename);   #endif    return ret;   }      //! @endnamespace    + //! Read a file from the master filesystem.   //! -  + //! The master filesystem defaults to the system filesystem, + //! but additional mountpoints may be added via + //! @[add_filesystem_handler()]. + //! + //! All file I/O performed by the @[MasterObject] is performed + //! via this function and its related functions. + //! + //! @seealso + //! @[add_filesystem_handler()], @[find_handler_for_path()], + //! @[master_get_dir()], @[master_file_stat()]   string master_read_file(string file)   {    string x = find_handler_for_path(file);    if(x)    {    object h = fs_map[x];    file = file[sizeof(x)+1..];       if(h = h->open(fakeroot(file),"r") )    {
pike.git/lib/master.pike.in:830:   //! @param mountpoint   //! the location in the filesystem to mount the handler   //!   //! @param filesystem   //! a filesystem object that will handle requests for the given mountpoint.   //!   //! @example   //! master()->add_filesystem_handler("/foo/bar.zip", Filesystem.Zip("/foo/bar.zip"));   //! master()->add_module_path("/foo/bar.zip/lib");   //! + //! @seealso + //! @[find_handler_for_path()]   mixed add_filesystem_handler(string mountpoint, object /*Filesystem.Base*/ filesystem)   {    mixed rv = fs_map[mountpoint];    fs_map[mountpoint] = filesystem;    return rv;   }    -  + //! Return the mountpoint for the filesystem handler handling the + //! @[file] (if any). + //! + //! @seealso + //! @[add_filesystem_handler()]   string find_handler_for_path(string file)   {   // TODO: maybe some caching would be worthwhile here. maybe.       foreach(reverse(sort(indices(fs_map))); int x; string path)    {    string p = path;    if(p[-1] != '/') p+="/";    if(file[-1] != '/') file+="/";    if(has_prefix(file, p))
pike.git/lib/master.pike.in:2986:    if(mappingp(v))    v = joinify(v);    if(res[n])    res[n] = joinnode(({res[n], v}), 0, 0, n);    else    res[n] = v;    }    return res;    }    +  //! Return the default module for the @[CompatResolver].    //! -  +  //! This is the mapping that corresponds to the @[predef::] +  //! name space for the compatibility level, and is the +  //! value returned by @[all_constants()] for the same.    mapping get_default_module()    {    resolv_debug ("%O->get_default_module()\n", this);       /* This is an ugly kluge to avoid an infinite recursion. The    * infinite recursion occurs because this function is called for    * every file when the compat_major/minor is set. This kluge    * could cause problems with threads if the compiler was    * threaded. -Hubbe    */
pike.git/lib/master.pike.in:3053:    lambda(mixed x) {    return objectp(x) && x->is_resolv_dirnode;    }) }),    current_handler,    root_module->fallback_module,    "predef::");       return node;    }    -  //! +  //! Look up @[identifier] in the root module.    mixed resolv_base(string identifier, string|void current_file,    object|void current_handler)    {    // werror("Resolv_base(%O)\n",identifier);    return get_root_module(current_handler)[identifier];    }       //! Same as @[resolv], but throws an error instead of returning    //! @[UNDEFINED] if the resolv failed.    mixed resolv_or_error(string identifier, string|void current_file,    void|object current_handler)    {    mixed res = resolv(identifier, current_file, current_handler);    if(undefinedp(res)) error("Could not resolve %s.\n", identifier);    return res;    }    -  +  //! Resolve the @[identifier] expression.    //! -  +  //! @returns +  //! Returns the value of the @[identifier] if it exists, +  //! and @[UNDEFINED] otherwise.    mixed resolv(string identifier, string|void current_file,    object|void current_handler)    {    resolv_debug("resolv(%O, %O)\n",identifier, current_file);    INC_RESOLV_MSG_DEPTH();       // FIXME: Support having the cache in the handler?    if( no_resolv[ identifier ] ) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug("resolv(%O, %O) => excluded\n",identifier, current_file);
pike.git/lib/master.pike.in:4399:    return res + ind[i] + ".";    }    }    };    }       // We're really out of luck here...    return res + (describe_program(parent_fun)||"unknown_program") + "()->";   }    - //! + //! Function called by @expr{sprintf("%O")@} for objects that don't + //! have an @[lfun::_sprintf()], or have one that returns @expr{UNDEFINED}.   string describe_object(object o)   {    string s;    if(undefinedp (o)) return 0; // Destructed.       // Handled by the search of all_constants() below.    // if (o == _static_modules) return "_static_modules";       program|function(mixed...:void|object) parent_fun = object_program(o);   
pike.git/lib/master.pike.in:4442:    if ((s = programs_reverse_lookup (parent_fun)) &&    (s=program_path_to_name(s, "", "", "()")))    return s;    /* Try identifying the program. */    if(( s=describe_program(parent_fun) ))    return s+"()";       return 0;   }    - //! + //! Function called by @expr{sprintf("%O")@} for programs.   string describe_program(program|function p)   {    string s;    if(!p) return 0;       if (p == object_program (_static_modules))    return "object_program(_static_modules)";       if(programp(p) &&    (s = programs_reverse_lookup ([program] p)) &&
pike.git/lib/master.pike.in:4469:    return describe_module(tmp) + s;    }    }       if(s=Builtin.program_defined(p))    return BASENAME(s);       return search(all_constants(), p);   }    - //! + //! Function called by @[describe_backtrace()] to describe + //! functions in the backtrace.   string describe_function (function f)   {    if (!f) return 0;       string name;       if (name = search(all_constants(), f)) return name;       if(string s = programs_reverse_lookup (f))    {