Skip to content

Commit

Permalink
fs ls
Browse files Browse the repository at this point in the history
  • Loading branch information
scaprile committed Dec 1, 2023
1 parent dbc7b5e commit 7f8cdf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mongoose.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,9 @@ enum { MG_FS_READ = 1, MG_FS_WRITE = 2, MG_FS_DIR = 4 };
// stat(), write(), read() calls.
struct mg_fs {
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 (*cl)(void *fd); // Close file
size_t (*rd)(void *fd, void *buf, size_t len); // Read file
Expand Down
4 changes: 3 additions & 1 deletion src/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ enum { MG_FS_READ = 1, MG_FS_WRITE = 2, MG_FS_DIR = 4 };
// stat(), write(), read() calls.
struct mg_fs {
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 (*cl)(void *fd); // Close file
size_t (*rd)(void *fd, void *buf, size_t len); // Read file
Expand Down

0 comments on commit 7f8cdf1

Please sign in to comment.