pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1: - /* $Id: master.pike.in,v 1.1 1998/03/28 16:36:56 grubba Exp $ + /* $Id: master.pike.in,v 1.2 1998/04/06 04:34:59 hubbe Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      int is_absolute_path(string p)   {   #ifdef __NT__    p=replace(p,"\\","/");
pike.git/lib/master.pike.in:52:   string *pike_program_path=({});   int want_warnings;      program compile_string(string data, void|string name)   {    return compile(cpp(data,name||"-"));   }      program compile_file(string file)   { -  return compile(cpp(_static_modules.files()->file(file,"r")->read(),file)); +  return compile(cpp(_static_modules.files()->Fd(file,"r")->read(),file));   }         #ifdef GETCWD_CACHE   string current_path;   int cd(string s)   {    current_path=0;    return predef::cd(s);   }
pike.git/lib/master.pike.in:473:   }      /* 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(string *argv, string *env)   { -  int i; +  int i,debug,trace;    object script;    object tmp;    string a,b;    mixed *q;       foreach(env,a) if(sscanf(a,"%s=%s",a,b)) environment[a]=b;    add_constant("getenv",getenv);    add_constant("putenv",putenv);    -  add_constant("write",_static_modules.files()->file("stdout")->write); +  add_constant("write",_static_modules.files()->_stdout->write);       _master_file_name=backtrace()[-1][0];    q=explode_path(_master_file_name);    pike_library_path = combine_path_with_cwd(q[0..sizeof(q)-2] * "/");       add_include_path(pike_library_path+"/include");    add_module_path(pike_library_path+"/modules");       a = replace(pike_library_path+"/", "/lib/", "/share/");    if (a != pike_library_path+"/") {
pike.git/lib/master.pike.in:529:       q=tmp->find_all_options(argv,({    ({"version",tmp->NO_ARG,({"-v","--version"})}),    ({"help",tmp->NO_ARG,({"-h","--help"})}),    ({"execute",tmp->HAS_ARG,({"-e","--execute"})}),    ({"modpath",tmp->HAS_ARG,({"-M","--module-path"})}),    ({"ipath",tmp->HAS_ARG,({"-I","--include-path"})}),    ({"ppath",tmp->HAS_ARG,({"-P","--program-path"})}),    ({"warnings",tmp->NO_ARG,({"-w","--warnings"})}),    ({"ignore",tmp->HAS_ARG,"-ms"}), -  ({"ignore",tmp->MAY_HAVE_ARG,"-Ddatpl",0,1}) +  ({"debug",tmp->MAY_HAVE_ARG,"--debug",0,1}), +  ({"trace",tmp->MAY_HAVE_ARG,"--trace",0,1}), +  ({"ignore",tmp->MAY_HAVE_ARG,"-Dqdatpl",0,1})    }), 1);       /* Parse -M and -I backwards */    for(i=sizeof(q)-1;i>=0;i--)    {    switch(q[i][0])    { -  +  case "debug": +  debug+=(int)q[i][1]; +  break; +  +  case "trace": +  trace+=(int)q[i][1]; +  break; +     case "modpath":    add_module_path(q[i][1]);    break;       case "ipath":    add_include_path(q[i][1]);    break;       case "ppath":    add_program_path(q[i][1]);
pike.git/lib/master.pike.in:622:    program tmp=(program)argv[0];       if(!tmp)    {    werror("Pike: Couldn't find script to execute.\n");    exit(1);    }       object script=tmp();    + #if constant(_debug) +  if(debug) _debug(debug); + #endif +  if(trace) predef::trace(trace);    if(!script->main)    {    werror("Error: "+argv[0]+" has no main().\n");    exit(1);    }       i=script->main(sizeof(argv),argv,env);    if(i >=0) exit(i);   }   
pike.git/lib/master.pike.in:732:    {    cast_to_object(path[0..sizeof(path)-2]+"pre.pike","/");    }    }       return path;   }      string read_include(string f)   { -  return _static_modules->files()->file(f,"r")->read(); +  return _static_modules.files()->Fd(f,"r")->read();   }      // FIXME   string stupid_describe(mixed m)   {    switch(string typ=sprintf("%t",m))    {    case "int":    case "float":    return (string)m;