pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:5: Inside #if constant(__builtin.TraceProcess)
  #if constant(__builtin.TraceProcess)   constant TraceProcess = __builtin.TraceProcess;   #endif      //! Slightly polished version of @[create_process].   //! @seealso   //! @[create_process]   class Process   {    inherit create_process; -  static function(Process:void) read_cb; -  static function(Process:void) timeout_cb; +  protected function(Process:void) read_cb; +  protected function(Process:void) timeout_cb;       //! @param args    //! Either a command line array, as the command_args    //! argument to @[create_process()], or a string that    //! will be splitted into a command line array by    //! calling @[split_quoted_string()] in an operating    //! system dependant mode.    //! @param m    //! In addition to the modifiers that @[create_process] accepts,    //! this object also accepts
pike.git/lib/modules/Process.pmod:29:    //! This callback is called when there is data to be read    //! from the process.    //! @member function(Process:void) "timeout_callback"    //! This callback is called if the process times out.    //! @member int "timeout"    //! The time it takes for the process to time out. Default is    //! 15 seconds.    //! @endmapping    //! @seealso    //! @[create_process], @[split_quoted_string] -  static void create( string|array(string) args, void|mapping(string:mixed) m ) +  protected void create( string|array(string) args, void|mapping(string:mixed) m )    {    if( stringp( args ) ) {    args = split_quoted_string( [string]args   #ifdef __NT__    ,1   #endif /* __NT__ */    );    }    if( !m )    ::create( [array(string)]args );
pike.git/lib/modules/Process.pmod:51:    ::create( [array(string)]args, [mapping(string:mixed)]m );       if(read_cb=m->read_callback)    call_out(watcher, 0.1);       if( (timeout_cb=m->timeout_callback) || m->timeout )    call_out(killer, m->timeout||15);    }    }    -  static void destroy() { +  protected void destroy() {    remove_call_out(watcher);    remove_call_out(killer);    }    -  static void watcher() { +  protected void watcher() {    // It was another sigchld, but not one from our process.    if(::status()==0)    call_out(watcher, 0.1);    else {    remove_call_out(killer);    if(read_cb) read_cb(this);    }    }    -  static void killer() { +  protected void killer() {    remove_call_out(watcher);   #if constant(kill)    ::kill(signum("SIGKILL"));   #endif    if(timeout_cb) timeout_cb(this);    }   }      // FIXME: Should probably be located elsewhere.   string locate_binary(array(string) path, string name)
pike.git/lib/modules/Process.pmod:90:    foreach(path, dir)    {    string fname = dir + "/" + name;    if ((info = file_stat(fname))    && (info[0] & 0111))    return fname;    }    return 0;   }    - static array(string) runpike; + protected array(string) runpike;      //! Spawn a new pike process similar to the current.   //!   //! @param argv   //! Arguments for the new process.   //!   //! @param options   //! Process creation options. See @[Process.Process] for details.   //!   //! @seealso
pike.git/lib/modules/Process.pmod:244: Inside #if constant(exece)
   path=[string]getenv("PATH");       foreach(path ? path/":" : ({}) , path)    if(file_stat(path=combine_path(path,file)))    return exece(path, foo, [mapping(string:string)]getenv());    }    return 69;   }   #endif    - static array(string) search_path_entries=0; + protected array(string) search_path_entries=0;      //!   string search_path(string command)   {    if (command=="" || command[0]=='/') return command;       if (!search_path_entries)    {    array(string) e=(getenv("PATH")||"")/":"-({""});   
pike.git/lib/modules/Process.pmod:449:   //! @seealso   //! @[system], @[spawn]      Stdio.FILE|string popen(string s, string|void mode) {    if(mode)    return fpopen(s,mode);    else    return fpopen(s)->read();   }    - static Stdio.FILE fpopen(string s, string|void mode) + protected Stdio.FILE fpopen(string s, string|void mode)   {    Stdio.FILE f = Stdio.FILE();    if (!f) error("Popen failed. (couldn't create file)\n");       Stdio.File p = f->pipe();    if(!p) error("Popen failed. (couldn't create pipe)\n");       if (mode == "w")    spawn(s, p, 0, 0, /*destruct, f*/);    else
pike.git/lib/modules/Process.pmod:614: Inside #if undefined(__NT__) and #if constant(fork) && constant(exece)
   {    return pid->wait();    }       // void set_done_callback(function foo,mixed ... args);    // int result();    // array rusage();   }   #endif   #endif +