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.243 2002/12/30 15:06:50 grubba Exp $ + // $Id: master.pike.in,v 1.244 2003/01/01 17:29:26 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:62:   int compat_major=-1;      //!   int compat_minor=-1;         // --- Functions begin here.      #define Stat _static_modules.files.Stat   #define capitalize(X) (upper_case((X)[..0])+(X)[1..]) + #define write(X) _static_modules.files()->_stdout->write(X)      //! @appears error   //! Throws an error. A more readable version of the code   //! @tt{throw( ({ sprintf(f, @@args), backtrace() }) )@}.   void error(string f, mixed ... args) {    array b = backtrace();    if (sizeof(args)) f = sprintf(f, @args);    throw( ({ f, b[..sizeof(b)-2] }) );   }   
pike.git/lib/master.pike.in:1587:      //! The backend_thread() function is useful to determine if you are   //! the backend thread - important when doing async/sync protocols.   //! This method is only available if thread_create is present.   object backend_thread()   {    return _backend_thread;   }   #endif    +    //! This function is called when all the driver is done with all setup   //! of modules, efuns, tables etc. etc. and is ready to start executing   //! _real_ programs. It receives the arguments not meant for the driver   //! and an array containing the environment variables on the same form as   //! a C program receives them.   void _main(array(string) orig_argv, array(string) env)   {    array(string) argv=copy_value(orig_argv);    int i,debug,trace,run_tool;    object tmp;
pike.git/lib/master.pike.in:1838:    random_seed(time() ^ (getpid()<<8));    argv = tmp->get_args(argv,1);    if(trace) predef::trace(trace);    mixed ret;    if(currentversion <= Version(7,4))    compile_string(    "mixed create(int argc, array(string) argv,array(string) env){"+    opts[1]+";}")(sizeof(argv),argv,env);    else    ret = compile_string( +  "#define NOT(X) !(X)\n" +  "#define CHAR(X) 'X'\n"    "mixed run(int argc, array(string) argv,"    "mapping(string:string) env){"+    opts[1]+";}")()->run(sizeof(argv),argv,getenv()); -  +  if(stringp(ret)) { +  write(ret); +  if(ret[-1]!='\n') write("\n"); +  }    if(!intp(ret) || ret<0) ret=0;    exit(ret);       case "preprocess": -  _static_modules.files()->_stdout->write(cpp(master_read_file(opts[1]), -  opts[1])); +  write(cpp(master_read_file(opts[1]),opts[1]));    exit(0);    }    }       argv = tmp->get_args(argv,1);    }       mixed main_resolv(array syms) {    mixed v = resolv(syms[0]);    foreach(syms[1..], string sym)    if(v) v = v[sym];    if(!v)    _error("Could not resolv %s\n", syms*".");    return v;    };       switch (postparseaction)    {    case "features": -  _static_modules.files()->_stdout-> +     write( main_resolv( "Tools.Install.features"/"." )()*"\n"+"\n" );    exit(0);       case "info": -  function w=_static_modules.files()->_stdout->write; -  w("Software......Pike\n" +  write("Software......Pike\n"    "Version......."+version()+"\n"    "WWW...........http://pike.ida.liu.se/\n" -  "\n"); -  -  w("pike binary..."+_pike_file_name+"\n"); -  w( format_paths() + "\n"); -  -  w("Features......"+ +  "\n" +  "pike binary..."+_pike_file_name+"\n"+ +  format_paths() + "\n" +  "Features......"+    main_resolv( "Tools.Install.features"/"." )()*"\n "+    "\n");    exit(0);    }       random_seed(time() ^ (getpid()<<8));       if(sizeof(argv)==1)    {    if(run_tool) {