-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.h
More file actions
23 lines (20 loc) · 768 Bytes
/
script.h
File metadata and controls
23 lines (20 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* scripting support functions */
int scriptopen(char* prog, char *arg1, char *arg2, char *msg);
int scriptclose();
int scriptfeed(char *msg);
int scriptread(char *buf, int n, int timeout);
/*
* scriptopen(): called with full path to executable
* returns 1 on success, 0 on failure
*
* scriptfeed(): may be called as many times as needed
* with lines in msg to be sent to stdin of script process
* returns 1 on success, 0 on failure.
*
* scriptread(): called with a buffer to hold the stdout
* from measurement script. Will only return the first
* line of stdout. If timeout argument is nonzero, then
* a time limit of <timeout> seconds is set after which
* subprocess is killed and 0 returned. Returns 1 on
* success.
*/