This commit is contained in:
Sergio R. Caprile 2023-12-01 20:43:39 -03:00
parent dbc7b5e70b
commit 7f8cdf1e79
2 changed files with 6 additions and 2 deletions

View File

@ -988,7 +988,9 @@ enum { MG_FS_READ = 1, MG_FS_WRITE = 2, MG_FS_DIR = 4 };
// stat(), write(), read() calls. // stat(), write(), read() calls.
struct mg_fs { struct mg_fs {
int (*st)(const char *path, size_t *size, time_t *mtime); // stat file int (*st)(const char *path, size_t *size, time_t *mtime); // stat file
void (*ls)(const char *path, void (*fn)(const char *, void *), void *); void (*ls)(const char *path, void (*fn)(const char *, void *),
void *); // List directory entries: call fn(file_name, fn_data)
// for each directory entry
void *(*op)(const char *path, int flags); // Open file void *(*op)(const char *path, int flags); // Open file
void (*cl)(void *fd); // Close file void (*cl)(void *fd); // Close file
size_t (*rd)(void *fd, void *buf, size_t len); // Read file size_t (*rd)(void *fd, void *buf, size_t len); // Read file

View File

@ -14,7 +14,9 @@ enum { MG_FS_READ = 1, MG_FS_WRITE = 2, MG_FS_DIR = 4 };
// stat(), write(), read() calls. // stat(), write(), read() calls.
struct mg_fs { struct mg_fs {
int (*st)(const char *path, size_t *size, time_t *mtime); // stat file int (*st)(const char *path, size_t *size, time_t *mtime); // stat file
void (*ls)(const char *path, void (*fn)(const char *, void *), void *); void (*ls)(const char *path, void (*fn)(const char *, void *),
void *); // List directory entries: call fn(file_name, fn_data)
// for each directory entry
void *(*op)(const char *path, int flags); // Open file void *(*op)(const char *path, int flags); // Open file
void (*cl)(void *fd); // Close file void (*cl)(void *fd); // Close file
size_t (*rd)(void *fd, void *buf, size_t len); // Read file size_t (*rd)(void *fd, void *buf, size_t len); // Read file