mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-02 13:20:51 +00:00
Revert "Make packed fs always available, and manually settable"
This commit is contained in:
1 parent
b852e0f8c3
commit
bb37f72a63
83 files changed
+8051
-288
No files matched your search
+11
-17
@@ -9,25 +9,19 @@ struct packed_file {
|
||||
size_t pos;
|
||||
};
|
||||
|
||||
const struct mg_mem_file *mg_mem_files;
|
||||
|
||||
static int mg_scmp(const char *a, const char *b) {
|
||||
while (*a && (*a == *b)) a++, b++;
|
||||
return *(const unsigned char *) a - *(const unsigned char *) b;
|
||||
}
|
||||
static const char *mg_unlist(size_t no) {
|
||||
return mg_mem_files == NULL ? NULL : mg_mem_files[no].path;
|
||||
}
|
||||
static const char *mg_unpack(const char *path, size_t *size, time_t *mtime) {
|
||||
const struct mg_mem_file *p;
|
||||
for (p = mg_mem_files; p != NULL && p->path != NULL; p++) {
|
||||
if (mg_scmp(p->path, path) != 0) continue;
|
||||
if (size != NULL) *size = p->size;
|
||||
if (mtime != NULL) *mtime = p->mtime;
|
||||
return (const char *) p->data;
|
||||
}
|
||||
#if MG_ENABLE_PACKED_FS
|
||||
#else
|
||||
const char *mg_unpack(const char *path, size_t *size, time_t *mtime) {
|
||||
if (size != NULL) *size = 0;
|
||||
if (mtime != NULL) *mtime = 0;
|
||||
(void) path;
|
||||
return NULL;
|
||||
}
|
||||
const char *mg_unlist(size_t no) {
|
||||
(void) no;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct mg_str mg_unpacked(const char *path) {
|
||||
size_t len = 0;
|
||||
|
||||
Reference in new issue
Block a user