|
Revision 1666, 1.8 kB
(checked in by ensc, 4 years ago)
|
added support for plain-style char** args
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifndef H_UTIL_VSERVER_LIB_INTERNAL_COMMAND_H |
|---|
| 20 |
#define H_UTIL_VSERVER_LIB_INTERNAL_COMMAND_H |
|---|
| 21 |
|
|---|
| 22 |
#include <ensc_vector/vector.h> |
|---|
| 23 |
#include <sys/resource.h> |
|---|
| 24 |
#include <sys/wait.h> |
|---|
| 25 |
#include <stdbool.h> |
|---|
| 26 |
|
|---|
| 27 |
struct Command |
|---|
| 28 |
{ |
|---|
| 29 |
char const * filename; |
|---|
| 30 |
union { |
|---|
| 31 |
struct Vector v; |
|---|
| 32 |
char const ** d; |
|---|
| 33 |
} params; |
|---|
| 34 |
pid_t pid; |
|---|
| 35 |
int rc; |
|---|
| 36 |
int err; |
|---|
| 37 |
struct rusage rusage; |
|---|
| 38 |
|
|---|
| 39 |
enum { parNONE, parVEC, parDATA } params_style_; |
|---|
| 40 |
}; |
|---|
| 41 |
|
|---|
| 42 |
void Command_init(struct Command *); |
|---|
| 43 |
void Command_free(struct Command *); |
|---|
| 44 |
void Command_reset(struct Command *); |
|---|
| 45 |
bool Command_exec(struct Command *, bool do_fork); |
|---|
| 46 |
void Command_appendParameter(struct Command *, char const *); |
|---|
| 47 |
void Command_setParams(struct Command *, char const **); |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
bool Command_wait(struct Command *, bool do_block); |
|---|
| 55 |
|
|---|
| 56 |
#endif // H_UTIL_VSERVER_LIB_INTERNAL_COMMAND_H |
|---|