pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:150:   #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 7.0 master compatibility interface. + //! Pike 7.2 master compatibility interface.   //!   //! Most of the interface is implemented via mixin,   //! or overloading by more recent masters.   //!   //! This interface is used for compatibility with - //! Pike 0.7 through 7.0. + //! Pike 7.2.   //!   //! @deprecated predef::MasterObject   //!   //! @seealso   //! @[get_compat_master()], @[master()], @[predef::MasterObject] - class Pike_7_0_master + protected class Pike_7_2_master   { -  object low_cast_to_object(string oname, string current_file); +     extern array(string) pike_include_path;    extern array(string) pike_module_path;    extern array(string) pike_program_path;   #ifdef GETCWD_CACHE    extern string current_path;    int cd(string s);    string getcwd();   #endif    string combine_path_with_cwd(string path);   #ifdef FILE_STAT_CACHE    extern int invalidate_time;    extern mapping(string:multiset(string)) dir_cache;   #endif -  local array(mixed) master_file_stat(string x) -  { -  Stat st = global::master_file_stat(x); -  return st && (array)st; -  } +        //! @decl mapping(string:array(string)) environment    //!    //! Mapping containing the environment variables.    //!    //! The mapping currently has the following structure:    //! @mapping    //! @member array(string) index    //! Note that the index is @[lower_case()]'d on NT.    //! @array
pike.git/lib/master.pike.in:280:    //! compatibility reasons only.    local __deprecated__ object new(mixed prog, mixed ... args)    {    if(stringp(prog))    prog=cast_to_program(prog,backtrace()[-2][0]);    return prog(@args);    }       void create();    extern mapping(program:object) objects; -  object low_cast_to_object(string oname, string current_file); +     object cast_to_object(string oname, string current_file);    class dirnode {}; -  object findmodule(string fullname); +     extern string _master_file_name;    void _main(array(string) orig_argv, array(string) env);    extern mixed inhibit_compile_errors;    void set_inhibit_compile_errors(mixed f);    string trim_file_name(string s);    void compile_error(string file,int line,string err);    string handle_include(string f, string current_file, int local_include);       int is_absolute_path(string p);    array(string) explode_path(string p);
pike.git/lib/master.pike.in:339:    array(string) query_precompiled_names(string fname);    program cast_to_program(string pname, string current_file,    object|void handler);    void handle_error(array(mixed)|object trace);    program handle_inherit(string pname, string current_file, object|void handler);    mixed handle_import(string what, string|void current_file, object|void handler);    mixed resolv_base(string identifier, string|void current_file);       // FIXME: Not in 7.7!    extern mapping resolv_cache; -  local protected object Pike_7_0_compat_handler; -  local mixed resolv(string identifier, string|void current_file) -  { -  if (!Pike_7_0_compat_handler) { -  Pike_7_0_compat_handler = global::get_compilation_handler(7, 0); -  } -  return Pike_7_0_compat_handler->resolv(identifier, current_file); -  } +     mixed get_inhibit_compile_errors();    string decode_charset(string data, string charset); -  local __deprecated__(int) clipped=0; -  local __deprecated__(int) canclip=0; - #pragma no_deprecation_warnings -  local __deprecated__ string stupid_describe(mixed m, int maxlen) -  { -  string typ; -  if (catch (typ=sprintf("%t",m))) -  typ = "object"; // Object with a broken _sprintf(), probably. -  switch(typ) -  { -  case "int": -  case "float": -  return (string)m; +     -  case "string": -  canclip++; -  if(sizeof(m) < maxlen) -  { -  string t = sprintf("%O", m); -  if (sizeof(t) < (maxlen + 2)) { -  return t; -  } -  t = 0; -  } -  clipped++; -  if(maxlen>10) -  { -  return sprintf("%O+[%d]",m[..maxlen-5],sizeof(m)-(maxlen-5)); -  }else{ -  return "string["+sizeof(m)+"]"; -  } -  -  case "array": -  if(!sizeof(m)) return "({})"; -  if(maxlen<5) -  { -  clipped++; -  return "array["+sizeof(m)+"]"; -  } -  canclip++; -  return "({" + stupid_describe_comma_list(m,maxlen-2) +"})"; -  -  case "mapping": -  if(!sizeof(m)) return "([])"; -  return "mapping["+sizeof(m)+"]"; -  -  case "multiset": -  if(!sizeof(m)) return "(<>)"; -  return "multiset["+sizeof(m)+"]"; -  -  case "function": -  if(string tmp=describe_program(m)) return tmp; -  if(object o=function_object(m)) -  return (describe_object(o)||"")+"->"+function_name(m); -  else { -  string tmp; -  if (catch (tmp = function_name(m))) -  // The function object has probably been destructed. -  return "function"; -  return tmp || "function"; -  } -  -  case "program": -  if(string tmp=describe_program(m)) return tmp; -  return typ; -  -  default: -  if (objectp(m)) -  if(string tmp=describe_object(m)) return tmp; -  return typ; -  } -  } -  local __deprecated__ string stupid_describe_comma_list(array x, int maxlen) -  { -  string ret=""; -  -  if(!sizeof(x)) return ""; -  if(maxlen<0) return ",,,"+sizeof(x); -  -  int clip=min(maxlen/2,sizeof(x)); -  int len=maxlen; -  int done=0; -  -  while(1) -  { -  array(string) z=allocate(clip); -  array(int) isclipped=allocate(clip); -  array(int) clippable=allocate(clip); -  for(int e=0;e<clip;e++) -  { -  clipped=0; -  canclip=0; -  z[e]=stupid_describe(x[e],len); -  isclipped[e]=clipped; -  clippable[e]=canclip; -  } -  -  while(1) -  { -  string ret = z[..clip-1]*","; -  -  if(done || sizeof(ret)<=maxlen+1) -  { -  int tmp=sizeof(x)-clip-1; -  -  clipped=`+(0,@isclipped); -  if(tmp>=0) -  { -  clipped++; -  ret+=",,,"+tmp; -  } -  canclip++; -  return ret; -  } -  -  int last_newlen=len; -  int newlen; -  int clipsuggest; -  while(1) -  { -  int smallsize=0; -  int num_large=0; -  clipsuggest=0; -  -  for(int e=0;e<clip;e++) -  { -  if((sizeof(z[e])>=last_newlen || isclipped[e]) && clippable[e]) -  num_large++; -  else -  smallsize+=sizeof(z[e]); -  -  if(num_large * 15 + smallsize < maxlen) clipsuggest=e+1; -  } -  -  newlen=num_large ? (maxlen-smallsize)/num_large : 0; -  -  if(newlen<8 || newlen >= last_newlen) break; -  last_newlen=newlen; -  } -  -  if(newlen < 8 && clip) -  { -  clip-= (clip/4) || 1; -  if(clip > clipsuggest) clip=clipsuggest; -  }else{ -  len=newlen; -  done++; -  break; -  } -  } -  } -  -  return ret; -  } - #pragma deprecation_warnings -  +     string describe_object(object o);    string describe_backtrace(array(mixed) trace, void|int linewidth);    string describe_error(mixed trace);    -  object get_compat_master(int major, int minor) -  { -  // 0.0 - 7.0 -  if ((major < 7) || ((major == 7) && !minor)) -  return this_program::this; -  return get_compat_master(major, minor); -  } +  // ---    -  /* No missing symbols. */ - } -  - //! Pike 7.2 master compatibility interface. - //! - //! Most of the interface is implemented via mixin, - //! or overloading by more recent masters. - //! - //! This interface is used for compatibility with - //! Pike 7.1 and 7.2. - //! - //! @deprecated predef::MasterObject - //! - //! @seealso - //! @[get_compat_master()], @[master()], @[predef::MasterObject] - protected class Pike_7_2_master - { -  inherit Pike_7_0_master; +    #ifdef PIKE_MODULE_RELOC    string relocate_module(string s);    string unrelocate_module(string s);   #endif    extern int compat_major;    extern int compat_minor;    Stat master_file_stat(string x);    object low_cast_to_object(string oname, string current_file,    object|void current_handler);    object findmodule(string fullname, object|void handler);
pike.git/lib/master.pike.in:572:    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(int|void t);    object get_compat_master(int major, int minor)    { -  if ((major < 7) || ((major == 7) && (minor < 1))) -  return Pike_7_0_master::get_compat_master(major, minor); -  // 7.1 & 7.2 -  if ((major == 7) && (minor < 3)) +  // 0.0 .. 7.2 +  if ((major < 7) || (major == 7) && (minor < 3))    return this_program::this;    return get_compat_master(major, minor);    }       /* No missing symbols. */   }      //! Pike 7.4 master compatibility interface.   //!   //! Most of the interface is implemented via mixin,