-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmg_os.h
More file actions
31 lines (26 loc) · 1.19 KB
/
mg_os.h
File metadata and controls
31 lines (26 loc) · 1.19 KB
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
struct file {
int is_directory;
time_t modification_time;
int64_t size;
FILE *fp;
const char *membuf; // Non-NULL if file data is in memory
};
#define STRUCT_FILE_INITIALIZER {0, 0, 0, NULL, NULL}
//// These functions are implemented in mg_file.c
REPLACE_STATIC int is_file_in_memory(struct mg_connection *conn, const char *path,
struct file *filep);
REPLACE_STATIC int is_file_opened(const struct file *filep);
REPLACE_STATIC int mg_fopen(struct mg_connection *conn, const char *path,
const char *mode, struct file *filep);
REPLACE_STATIC void mg_fclose(struct file *filep);
REPLACE_STATIC void fclose_on_exec(struct file *filep);
//// These functions are implemented in mg_win32.c and mg_unix.c
REPLACE_STATIC int mg_stat(struct mg_connection *conn, const char *path,
struct file *filep);
#ifndef NO_CGI
REPLACE_STATIC pid_t spawn_process(struct mg_connection *conn, const char *prog,
char *envblk, char *envp[], int fd_stdin,
int fd_stdout, const char *dir);
#endif
REPLACE_STATIC int set_non_blocking_mode(SOCKET sock);
REPLACE_STATIC int mg_mkdir(const char *path, int mode);