2007-07-30 17:25:13 +04:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Evoke, head honcho of everything
|
|
|
|
* Part of Equinox Desktop Environment (EDE).
|
|
|
|
* Copyright (c) 2000-2007 EDE Authors.
|
|
|
|
*
|
|
|
|
* This program is licensed under terms of the
|
|
|
|
* GNU General Public License version 2 or newer.
|
|
|
|
* See COPYING for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SPAWN_H__
|
|
|
|
#define __SPAWN_H__
|
|
|
|
|
2007-08-06 16:39:15 +04:00
|
|
|
#include <unistd.h> // pid_t
|
|
|
|
|
2007-07-30 17:25:13 +04:00
|
|
|
/*
|
|
|
|
* This is little bit modified code from edelib run_program()
|
|
|
|
* so evoke specific stuff can be added. Also, possible option
|
|
|
|
* is that edelib run_program(), at some time, consult evoke
|
|
|
|
* for running programs.
|
|
|
|
*/
|
2007-08-07 15:54:57 +04:00
|
|
|
|
|
|
|
#define SPAWN_OK 0
|
|
|
|
#define SPAWN_FORK_FAILED 1
|
|
|
|
#define SPAWN_EMPTY 2
|
|
|
|
#define SPAWN_EXECVE_FAILED 3
|
2007-08-31 17:41:27 +04:00
|
|
|
#define SPAWN_OPEN_FAILED 4
|
2007-09-24 15:47:42 +04:00
|
|
|
#define SPAWN_PIPE_FAILED 5
|
2007-08-07 15:54:57 +04:00
|
|
|
|
|
|
|
#define SPAWN_CHILD_CRASHED -2
|
|
|
|
#define SPAWN_CHILD_KILLED -3
|
2007-08-06 16:39:15 +04:00
|
|
|
|
|
|
|
typedef void (SignalWatch)(int pid, int status);
|
2007-07-30 17:25:13 +04:00
|
|
|
|
2007-08-31 17:41:27 +04:00
|
|
|
int spawn_program(const char* cmd, SignalWatch* wf = 0, pid_t* child_pid_ret = 0, const char* ofile = 0);
|
2007-08-06 16:39:15 +04:00
|
|
|
int spawn_program_with_core(const char* cmd, SignalWatch* wf = 0, pid_t* child_pid_ret = 0);
|
2007-09-03 16:24:01 +04:00
|
|
|
int spawn_backtrace(const char* gdb_path, const char* program, const char* core, const char* output, const char* script);
|
2007-07-30 17:25:13 +04:00
|
|
|
|
|
|
|
#endif
|