34 lines
663 B
C
34 lines
663 B
C
#ifndef ASL_CAPTURE_H
|
|
#define ASL_CAPTURE_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
/* Execution mode */
|
|
typedef enum {
|
|
ASL_CAPTURE_PIPE = 0,
|
|
ASL_CAPTURE_PTY = 1
|
|
} asl_capture_mode_t;
|
|
|
|
/* Result of execution */
|
|
typedef struct {
|
|
int exit_code; /* valid if term_signal == 0 */
|
|
int term_signal; /* 0 if exited normally */
|
|
} asl_capture_result_t;
|
|
|
|
/*
|
|
* Run a command under capture.
|
|
*
|
|
* argv must be NULL-terminated and suitable for execvp().
|
|
* result must not be NULL.
|
|
*
|
|
* Returns 0 on success, -1 on internal error.
|
|
*/
|
|
int asl_capture_run(
|
|
asl_capture_mode_t mode,
|
|
char **argv,
|
|
asl_capture_result_t *result
|
|
);
|
|
|
|
#endif /* ASL_CAPTURE_H */
|
|
|