aboutsummaryrefslogtreecommitdiff
path: root/capture.h
blob: 64bb55fc44ec6ca230bdc6978c05363b6027c860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "ppport.h"

#include <stdlib.h>
#include <runcap/runcap.h>

struct line_closure
{
	char *str;
	size_t len;
	size_t size;
	SV *cv;
};

struct capture {
	struct runcap rc;
	int flags;
	struct line_closure closure[2];
	SV *program;
};

typedef struct capture *POSIX__Run__Capture;
typedef char** ARGV;

ARGV XS_unpack_ARGV(SV *sv);
void XS_pack_ARGV(SV *const sv, ARGV argv);

struct capture *capture_new(SV *pn, ARGV argv, unsigned timeout, SV *cb[2]);
void capture_DESTROY(struct capture *rc);
char *capture_next_line(struct capture *rc, int fd);
int capture_run(struct capture *cp);
void capture_set_argv_ref(struct capture *cp, ARGV av);

Return to:

Send suggestions and report system problems to the System administrator.