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.452 2008/08/30 21:50:32 marcus Exp $ + // $Id: master.pike.in,v 1.453 2008/08/31 20:19:14 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:112:   #define GET_RESOLV_MSG_DEPTH (resolv_msg_depth && resolv_msg_depth->get())   #define INC_RESOLV_MSG_DEPTH() (resolv_msg_depth && resolv_msg_depth->set (resolv_msg_depth->get() + 1))   #define DEC_RESOLV_MSG_DEPTH() (resolv_msg_depth && resolv_msg_depth->set (resolv_msg_depth->get() - 1))   #else   protected int resolv_msg_depth;   #define GET_RESOLV_MSG_DEPTH resolv_msg_depth   #define INC_RESOLV_MSG_DEPTH() (++resolv_msg_depth)   #define DEC_RESOLV_MSG_DEPTH() (--resolv_msg_depth)   #endif    - void resolv_debug (string fmt, mixed... args) + void resolv_debug (sprintf_format fmt, sprintf_args... args)   {    string pad = " " * GET_RESOLV_MSG_DEPTH;    if (sizeof (args)) fmt = sprintf (fmt, @args);    if (fmt[-1] == '\n')    fmt = pad + replace (fmt[..<1], "\n", "\n" + pad) + "\n";    else    fmt = pad + replace (fmt, "\n", "\n" + pad);    if (!werror) werror = Files()->_stderr->write;    werror (fmt);   }      #else // !RESOLV_DEBUG   #define INC_RESOLV_MSG_DEPTH() 0   #define DEC_RESOLV_MSG_DEPTH() 0   #define resolv_debug(X...) do {} while (0)   #endif // !RESOLV_DEBUG    -  + constant no_value = (<>); + constant NoValue = typeof (no_value); +    // Some API compatibility stuff.      //! Pike 0.6 master compatibility interface.   //!   //! Most of the interface is implemented via mixin.   //!   //! @deprecated predef::MasterObject   //!   //! @seealso   //! @[get_compat_master()], @[master()], @[predef::MasterObject]
pike.git/lib/master.pike.in:596:    return Pike_7_2_compat_handler->resolv(identifier, current_file);    }    void runtime_warning(string where, string what, mixed ... args);    protected int clipped;    protected int canclip;    protected string stupid_describe(mixed m, int maxlen);    protected string stupid_describe_comma_list(array x, int maxlen);    class Describer {};    string describe_function(function f);    class CompatResolver {}; +  int(0..1) asyncp();    class Version {};    extern object currentversion;    extern mapping(object:object) compat_handler_cache;    object get_compilation_handler(int major, int minor); -  +  string _sprintf();    local string _sprintf(int|void t)    {    return UNDEFINED;    }    object get_compat_master(int major, int minor)    {    if ((major > 0) || (minor > 6)) return Pike_7_0_master::this;    return Pike_7_0_master::get_compat_master(major, minor);    }   }
pike.git/lib/master.pike.in:623:   //! Most of the interface is implemented via mixin.   //!   //! @deprecated predef::MasterObject   //!   //! @seealso   //! @[get_compat_master()], @[master()], @[predef::MasterObject]   protected class Pike_7_4_master   {    inherit Pike_7_2_master;    local protected object Pike_7_4_compat_handler; -  void error(string f, mixed ... args); + #ifdef RESOLV_DEBUG +  void resolv_debug (sprintf_format fmt, sprintf_args... args); + #endif +  void error(sprintf_format f, sprintf_args ... args); +  constant no_value = (<>); +  constant NoValue = typeof (no_value); +  string programs_reverse_lookup (program prog); +  program objects_reverse_lookup (object obj); +  string fc_reverse_lookup (object obj); +  // Hide clone() and new(). +  private local __deprecated__ object new(mixed prog, mixed ... args); +  private local __deprecated__(function) clone = new; +  void unregister(program p); +  program low_cast_to_program(string pname, +  string current_file, +  object|void handler, +  void|int mkobj); +  extern string include_prefix;    void add_predefine (string name, string value);    void remove_predefine (string name);    mapping get_predefines(); -  + #if constant(thread_create) +  object backend_thread(); + #endif +  function(string:string) set_trim_file_name_callback(function(string:string) s); +  int compile_exception (array|object trace); +  string program_path_to_name ( string path, +  void|string module_prefix, +  void|string module_suffix, +  void|string object_suffix ); +  string describe_module(object|program mod, array(object)|void ret_obj); +  string describe_program(program|function p); +  class Encoder {}; +  class Decoder {}; +  string _sprintf(int t);    local mixed resolv(string identifier, string|void current_file)    {    if (!Pike_7_4_compat_handler) {    Pike_7_4_compat_handler = global::get_compilation_handler(7, 4);    }    return Pike_7_4_compat_handler->resolv(identifier, current_file);    }    object get_compat_master(int major, int minor)    {    if ((major == 7) && (minor > 0)) return Pike_7_2_master::this;
pike.git/lib/master.pike.in:680:   //! This inherit is used to provide compatibility namespaces   //! for @[get_compat_master()].   //!   //! @seealso   //! @[get_compat_master()]   protected inherit Pike_7_6_master;      //! @appears error   //! Throws an error. A more readable version of the code   //! @expr{throw( ({ sprintf(f, @@args), backtrace() }) )@}. - void error(string f, mixed ... args) { + void error(sprintf_format f, sprintf_args ... args) {    if (sizeof(args)) f = sprintf(f, @args);    throw( ({ f, backtrace()[..<1] }) );   }      // FIXME: Should the pikeroot-things be private?   #ifdef PIKE_FAKEROOT   object o;   string fakeroot(string s)   {    string tmp1=combine_path_with_cwd(s);
pike.git/lib/master.pike.in:1215:    this_program : this,    object_program(_static_modules): _static_modules,   ]);      mapping(string:object|NoValue) fc=([]);      // Note: It's assumed that the mappings above never decrease in size   // unless the reverse mappings above also are updated. no_value should   // otherwise be used for entries that should be considered removed.    - constant no_value = (<>); - constant NoValue = typeof (no_value); -  +    // The reverse mapping for objects isn't only for speed; search()   // doesn't work reliably there since it calls `==.   protected mapping(program:string) rev_programs = ([]);   protected mapping(object:program) rev_objects = ([]);   protected mapping(mixed:string) rev_fc = ([]);      string programs_reverse_lookup (program prog)   //! Returns the path for @[prog] in @[programs], if it got any.   {    // When running with trace, this function can get called
pike.git/lib/master.pike.in:4069:    }    }    }       return ret;    }   }         string program_path_to_name ( string path, -  void|string module_prefix, void|string module_suffix, +  void|string module_prefix, +  void|string module_suffix,    void|string object_suffix )   //! Converts a module path on the form @expr{"Foo.pmod/Bar.pmod"@} or   //! @expr{"/path/to/pike/lib/modules/Foo.pmod/Bar.pmod"@} to a module   //! identifier on the form @expr{"Foo.Bar"@}.   //!   //! If @[module_prefix] or @[module_suffix] are given, they are   //! prepended and appended, respectively, to the returned string if   //! it's a module file (i.e. ends with @expr{".pmod"@} or   //! @expr{".so"@}). If @[object_suffix] is given, it's appended to the   //! returned string if it's an object file (i.e. ends with
pike.git/lib/master.pike.in:5528:    }       // Note: May duplicate the assignment above.    compat_handler_cache[v] = ret;       return ret;   }      string _sprintf(int t)   { -  switch(t) { +  // NOTE: The ||'O' is for Pike 7.2 compat only. +  switch(t||'O') {    case 't': return "master";    case 'O': return "master()";    }   }      //! Return a master object compatible with the specified version of Pike.   //!   //! This function is used to implement the various compatibility versions   //! of @[master()].   //!   //! @seealso   //! @[get_compilation_handler()], @[master()]   local object get_compat_master(int major, int minor)   {    if ((major > 7) || ((major == 7) && (minor > 6))) return this;    if ((major == 7) && (minor > 4)) return Pike_7_6_master::this;    return Pike_7_6_master::get_compat_master(major, minor);   }