forked from fantaisie-software/purebasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshellout.h
More file actions
33 lines (25 loc) · 711 Bytes
/
shellout.h
File metadata and controls
33 lines (25 loc) · 711 Bytes
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
#ifndef MBA_SHELLOUT_H
#define MBA_SHELLOUT_H
/* shellout - execute programs in a pty shell programmatically
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <termios.h>
#define SHO_FLAGS_INTERACT 0x0001
#define SHO_FLAGS_ISATTY 0x0100
struct sho {
int flags;
pid_t pid;
int ptym;
struct termios t0;
};
struct sho *sho_open(const unsigned char *shname, const unsigned char *ps1, int flags);
int sho_close(struct sho *sh);
int sho_expect(struct sho *sh, const unsigned char *pv[], int pn, unsigned char *dst, size_t dn, int timeout);
int sho_loop(struct sho *sh, const unsigned char *pv[], int pn, int timeout);
#ifdef __cplusplus
}
#endif
#endif /* MBA_SHELLOUT_H */