-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathio.h
33 lines (26 loc) · 773 Bytes
/
io.h
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 IO_H
#define IO_H
/* fopen() wrapper */
FILE *fileopen(char *filename, char *mode);
FILE *shopen(char *cmd, char *mode);
char *parse_filename(char *filename);
/* Load 'fp' in the global list */
void io_load_file(FILE *fp);
/* Write the global list to 'filename' */
void io_write_file(char *filename);
/* getline() wrapper */
ssize_t io_read_line(char **line, size_t *linecap, FILE *fp, char *prompt);
/* printf() wrapper */
int io_write_line(FILE *fp, const char *fmt, ...);
/* args */
extern _Bool opt_restricted;
extern _Bool opt_silent;
extern _Bool opt_extended;
extern _Bool opt_history;
extern _Bool opt_readline;
/*
* returns optind i.e. index of the first argument
* in argv that is not an option
*/
int parse_args(int argc, char **argv);
#endif