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.360 2004/07/14 14:04:33 grubba Exp $ + // $Id: master.pike.in,v 1.361 2004/09/06 20:40:37 mast 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:576:    return replace(path,"\\","/");   #endif   }      //! Mapping containing the cache of currently compiled files.   //!   //! This mapping currently has the following structure:   //! @mapping   //! @member program filename   //! @endmapping - //! The filename path seperator is / on both NT and UNIX. + //! The filename path separator is / on both NT and UNIX.   //!   //! @note - //! As a special case the current master program is available - //! under the name @expr{"/master"@}. + //! Special cases: The current master program is available under the + //! name @expr{"/master"@}, and the program containing the @[main] + //! function under @expr{"/main"@}.   mapping(string:program|NoValue) programs=(["/master":this_program]);      mapping (program:object|NoValue) objects=([    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
pike.git/lib/master.pike.in:2667:    };       if (err) {    if( !file_stat(argv[0]) )    exit(1, "Could not find file %O.\n", argv[0]);    if( !file_stat(argv[0])->isreg )    exit(1, "File %O is not a regular file.\n", argv[0]);    error( "Pike: Failed to compile script:\n"    "%s\n", stringp(err[0])?err[0]:describe_backtrace(err) );    } +  +  // Don't list the program with its real path in the programs +  // mapping, so that reverse lookups (typically by the codec) +  // always find the canonical "/main" instead. +  programs[argv[0]] = no_value;    }    -  +  programs["/main"] = prog; +     if(!prog)    error("Pike: Couldn't find script to execute\n(%O)\n", argv[0]);      #if constant(_debug)    if(debug) _debug(debug);   #endif    if(trace) trace = predef::trace(trace);    mixed ret;    mixed err = catch {    // The main reason for this catch is actually to get a new call
pike.git/lib/master.pike.in:3709:   } while (0)   #else   # define DEC_MSG(X...) do {} while (0)   # define DEC_RETURN(val) do return (val); while (0)   #endif      class Encoder   //! @appears Pike.Encoder   //!   //! Codec for use with @[encode_value]. It understands all the - //! standard references to builtin functions and pike modules. + //! standard references to builtin functions, pike modules, and the + //! main program script.   //!   //! The format of the produced identifiers are documented here to   //! allow extension of this class:   //!   //! The produced names are either strings or arrays. The string   //! variant specifies the thing to look up according to the first   //! character:   //!   //! 'c' Look up in all_constants().   //! 's' Look up in _static_modules.