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.308 2003/10/30 22:19:26 bill Exp $ + // $Id: master.pike.in,v 1.309 2003/11/12 15:45:57 grubba 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:938:   //! Alias for @[sizeof].   //! @deprecated sizeof      //! @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    */ - void create() + static void create()   {    object o = this_object();       foreach(master_efuns, string e)    if (o[e])    add_constant(e, o[e]);    else    error("Function %O is missing from master.pike.\n", e);       add_constant("strlen", sizeof);
pike.git/lib/master.pike.in:1386:       // NOTE: Uses the empty mapping as the default fallback    // for simplified code.    joinnode|mapping(mixed:int(0..0)) fallback_module = ([]);       string _sprintf(int as)    {    return as=='O' && sprintf("master()->joinnode(%O)",joined_modules);    }    -  void create(array(object|mapping) _joined_modules, +  static void create(array(object|mapping) _joined_modules,    object|void _compilation_handler,    joinnode|void _fallback_module)    {    joined_modules = _joined_modules;    compilation_handler = _compilation_handler;    fallback_module = _fallback_module || ([]);    resolv_debug ("joinnode(%O) created\n", joined_modules);    }       void add_path(string path)    {    path = combine_path(getcwd(), path);    dirnode node = fc[path] ||    (fc[path] = dirnode(path, compilation_handler));    if (sizeof(joined_modules) &&    joined_modules[0] == node) return;    joined_modules = ({ node }) + (joined_modules - ({ node })); -  +  // FIXME: Propagate!    }       void rem_path(string path)    {    path = combine_path(getcwd(), path);    joined_modules = filter(joined_modules,    lambda(dirnode node) {    return !objectp(node) ||    !node->is_resolv_dirnode ||    (node->dirname != path);    }); -  +  // FIXME: What about the cache? +  // FIXME: Propagate!    }       static mixed ind(string index)    {    resolv_debug ("joinnode(%O)->ind(%O)\n", joined_modules, index);    INC_RESOLV_MSG_DEPTH();       array(mixed) res = ({});    foreach(joined_modules, object|mapping o)    {
pike.git/lib/master.pike.in:1729:       //! The complete module search path    array(string) pike_module_path=({});       //! The complete include search path    array(string) pike_include_path=({});       //! The complete program search path    array(string) pike_program_path=({});    -  mapping(string:string) predefines = ([]); +  mapping(string:string) predefines = master()->initial_predefines;    string ver;       //! If we fail to resolv, try the fallback.    //!    //! Typical configuration:    //! @pre{0.6->7.0->7.2->7.4->master@}    CompatResolver fallback_resolver;       //! The CompatResolver is initialized with a value that can be    //! casted into a "%d.%d" string, e.g. a version object.    //!    //! It can also optionally be initialized with a fallback resolver. -  void create(mixed version, CompatResolver|void fallback_resolver) +  static void create(mixed version, CompatResolver|void fallback_resolver)    {    resolv_debug("CompatResolver(%O, %O)\n", version, fallback_resolver);    ver=(string)version;   #if 0    if (version) {    root_module->symbol = ver + "::";    }   #endif    if (CompatResolver::fallback_resolver = fallback_resolver) {    root_module->fallback_module = fallback_resolver->root_module;
pike.git/lib/master.pike.in:3722:    }       mixed encode_object(object x)    {    DEC_MSG ("encode_object (%O)\n", x);    if(!x->_encode)    error ("Cannot encode object %O without _encode function.\n", x);    DEC_RETURN (([function]x->_encode)());    }    -  void create (void|mixed encoded) +  static void create (void|mixed encoded)    //! Creates an encoder instance. If @[encoded] is specified, it's    //! encoded instead of being reverse resolved to a name. That's    //! necessary to encode programs.    {    this_program::encoded = encoded;       foreach (all_constants(); string var; mixed val)    rev_constants[val] = "c" + var;       rev_static_modules =
pike.git/lib/master.pike.in:3922:   }      class Codec   //! @[Encoder] and @[Decoder] rolled into one. This is for mainly   //! compatibility; there's typically no use combining encoding and   //! decoding into the same object.   {    inherit Encoder;    inherit Decoder;    -  void create (void|mixed encoded) +  static void create (void|mixed encoded)    //! The optional argument is the thing to encode; it's passed on to    //! @[Encoder].    {    Encoder::create (encoded);    }   }      // The master acts as the default codec.   inherit Codec;   
pike.git/lib/master.pike.in:3944:   //! Contains version information about a Pike version.   class Version   {       //! The major and minor parts of the version.    int major;    int minor;       //! @decl void create(int major, int minor)    //! Set the version in the object. -  void create(int maj, int min) +  static void create(int maj, int min)    {    if(maj==-1) maj = __REAL_MAJOR__;    if(min==-1) min = __REAL_MINOR__;    major = maj;    minor = min;    }      #define CMP(X) ((major - ([object]X)->major) || (minor - ([object]X)->minor))       //! Methods define so that version objects