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.320 2003/12/19 20:47:01 marcus Exp $ + // $Id: master.pike.in,v 1.321 2004/01/08 12:13:06 nilsson 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:549:   //!   //! This mapping currently has the following structure:   //! @mapping   //! @member program filename   //! @endmapping   //! The filename path seperator is / on both NT and UNIX.   //!   //! @note   //! As a special case the current master program is available   //! under the name @expr{"/master"@}. - mapping(string:program|NoValue) programs=(["/master":object_program(this_object())]); + mapping(string:program|NoValue) programs=(["/master":this_program]);      mapping (program:object|NoValue) objects=([ -  object_program(this_object()):this_object(), +  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   // except in *_reverse_lookup(). no_value is used for entries that   // should be considered removed.      constant no_value = (<>);
pike.git/lib/master.pike.in:1017:      //! @decl int write(string fmt, mixed ... args)   //! @appears write   //! Writes a string on stdout. Works just like @[Stdio.File.write]   //! on @[Stdio.stdout].      /* Note that create is called before add_precompiled_program    */   static void create()   { -  object o = this_object(); -  +     foreach(master_efuns, string e) -  if (o[e]) -  add_constant(e, o[e]); +  if (this[e]) +  add_constant(e, this[e]);    else    error("Function %O is missing from master.pike.\n", e);       add_constant("strlen", sizeof);    add_constant("write", Files()->_stdout->write);      #define CO(X) add_constant(#X,Builtin.__backend->X)    CO(call_out);    CO(_do_call_outs);    CO(find_call_out);
pike.git/lib/master.pike.in:1157:       // FIXME: Warn here?    return 0;    }       static void create(string d, object|void h)    {    resolv_debug ("dirnode(%O,%O) created\n",d,h);    dirname=d;    compilation_handler=h; -  fc[dirname]=this_object(); +  fc[dirname]=this;    if(has_suffix(FIX_CASE(dirname),".pmod")) { -  fc[dirname[..sizeof(dirname)-6]]=this_object(); +  fc[dirname[..sizeof(dirname)-6]]=this;    }    array(string) files = sort(get_dir(d)||({}));    if (!sizeof(d)) return;    array(string) bases = map(files, base_from_filename);    files = filter(files, bases);    bases = filter(bases, bases);    resolv_debug("dirnode(%O,%O) got %d files.\n",    d, h, sizeof(bases));    if (!sizeof(files)) return;   
pike.git/lib/master.pike.in:2848:    }       string describe_multiset (multiset m, int maxlen)    {    if(!sizeof(m)) return "(<>)";    else return "multiset["+sizeof(m)+"]";    }       string describe (mixed m, int maxlen)    { +  catch {    if (stringp (ident[m])) return [string]ident[m];    else if (intp (ident[m]) && ident[m] > 1)    ident[m] = "@" + identcount++; -  +  };       string res;    if (catch (res=sprintf("%t",m)))    res = "object"; // Object with a broken _sprintf(), probably.    switch(res)    {    case "int":    case "float":    return (string)m;    case "string":
pike.git/lib/master.pike.in:4148:    //! Methods define so that version objects    //! can be compared and ordered.    int `<(mixed v) { return objectp(v) && CMP(v) < 0; }    int `>(mixed v) { return objectp(v) && CMP(v) > 0; }    int `==(mixed v) { return objectp(v) && CMP(v)== 0; }    int _hash() { return major * 4711 + minor ; }       string _sprintf(int t) {    switch(t) {    case 's': return sprintf("%d.%d",major,minor); -  case 'O': return sprintf("%O(%s)", this_program, this_object()); +  case 'O': return sprintf("%O(%s)", this_program, this);    }    }       //! The version object can be casted into a string.    mixed cast(string type)    {    switch(type)    {    case "string":    return sprintf("%d.%d",major,minor);
pike.git/lib/master.pike.in:4241:    compat_handler_cache[v]=0;    return 0;    }       /* Same as available[0] */    if(ret=compat_handler_cache[available[0]])    return compat_handler_cache[v]=ret;   #endif       // The root resolver is this object. -  ret = this_object(); +  ret = this;       foreach(reverse(available), Version tmp)    {    CompatResolver compat_handler = compat_handler_cache[tmp];    if (!compat_handler) {    // Create a new compat handler, that    // falls back to the successor version.    if (tmp <= Version(0, 6)) {    compat_handler = Pike06Resolver(tmp, ret);    } else {