forked from lem-project/async-process
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasync-process.h
More file actions
35 lines (29 loc) · 773 Bytes
/
Copy pathasync-process.h
File metadata and controls
35 lines (29 loc) · 773 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
34
35
#ifndef _ASYNC_PROCESS_H_
#define _ASYNC_PROCESS_H_
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#define _GNU_SOURCE
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
struct process {
char buffer[1024*4];
int fd;
char *pty_name;
pid_t pid;
};
struct process* create_process(char *const command[], bool nonblock, const char *path);
void delete_process(struct process *process);
int process_pid(struct process *process);
void process_send_input(struct process *process, const char *string);
const char* process_receive_output(struct process *process);
int process_alive_p(struct process *process);
#endif