-
Notifications
You must be signed in to change notification settings - Fork 0
/
packed_fs.c
51 lines (43 loc) · 3.75 KB
/
packed_fs.c
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// DO NOT EDIT. This file is generated
#include <stddef.h>
#include <string.h>
#include <time.h>
#if defined(__cplusplus)
extern "C" {
#endif
const char *mg_unlist(size_t no);
const char *mg_unpack(const char *, size_t *, time_t *);
#if defined(__cplusplus)
}
#endif
static const unsigned char v1[] = {31,139,8,0,0,0,0,0,0,19,69,80,59,114,132,48,12,237,247,20,138,234,0,73,151,194,230,20,185,128,177,197,90,89,127,24,91,44,225,246,25,76,72,42,141,222,111,158,164,94,92,182,178,47,4,94,98,24,111,234,26,100,220,120,3,80,145,196,128,245,166,84,18,141,171,204,221,7,194,240,79,37,19,73,227,147,105,91,114,17,4,155,147,80,18,141,27,59,241,218,209,147,45,117,109,121,5,78,44,108,66,87,173,9,164,223,251,183,43,42,112,122,64,161,160,177,202,30,168,122,34,65,240,133,230,95,164,183,181,54,177,26,206,106,106,202,110,111,94,78,203,42,112,220,160,209,122,178,143,41,127,35,176,211,88,55,22,235,15,155,10,102,162,0,115,46,127,232,248,153,239,247,64,106,104,212,17,124,38,170,106,11,47,87,96,204,110,13,132,80,139,213,24,13,167,254,171,226,168,134,83,212,234,180,135,253,0,122,54,30,2,72,1,0,0,0};
static const unsigned char v2[] = {31,139,8,0,0,0,0,0,0,19,77,203,65,10,194,48,16,133,225,125,79,49,187,164,32,233,1,138,27,193,133,199,8,51,211,36,24,103,196,78,27,68,122,119,177,221,184,123,240,191,175,21,33,109,65,165,106,36,56,195,180,8,90,81,241,61,124,58,0,82,92,30,44,22,18,219,181,242,111,94,222,55,242,110,110,197,48,187,62,168,96,142,146,248,223,242,122,104,0,84,153,181,114,168,154,188,51,77,169,50,28,127,114,39,224,53,88,124,37,182,128,153,241,206,212,143,187,154,216,48,123,23,159,101,168,76,195,225,220,30,183,177,219,198,238,11,63,113,56,186,182,0,0,0,0};
static const unsigned char v3[] = {31,139,8,0,0,0,0,0,0,19,117,146,193,106,195,48,12,134,207,241,83,24,198,232,202,200,154,174,244,16,135,189,199,96,236,224,216,74,162,213,181,131,173,116,13,165,239,62,156,38,77,75,217,77,50,191,164,239,151,140,182,237,232,139,250,22,62,84,3,106,87,186,227,247,137,37,13,96,221,144,224,89,193,146,95,212,212,92,194,3,6,44,209,32,245,130,55,168,53,216,130,157,25,51,178,4,195,79,44,81,157,15,206,11,222,58,180,4,190,96,9,193,145,82,180,26,44,9,158,230,121,158,183,199,185,231,123,150,13,233,52,110,61,230,165,84,187,218,187,206,106,193,107,15,125,193,18,141,161,53,178,23,188,52,78,237,162,198,121,13,62,245,82,99,23,230,210,214,5,36,116,86,112,15,70,18,30,96,70,20,178,34,240,3,168,179,52,32,45,22,119,53,178,12,206,116,4,145,220,181,130,111,135,158,6,42,154,226,145,60,191,7,207,31,185,159,170,170,122,196,28,133,228,165,157,102,102,111,155,48,48,98,188,133,24,206,0,154,191,242,235,90,239,218,150,82,203,237,246,255,130,217,228,5,91,73,163,94,214,89,246,204,211,104,97,57,77,175,156,223,11,62,132,70,18,124,190,164,81,180,188,221,150,138,235,155,251,141,214,215,155,193,195,153,177,213,138,43,136,135,70,91,179,210,233,62,170,174,135,170,12,68,171,63,93,32,172,250,244,186,242,75,73,193,18,105,176,182,41,18,236,195,205,235,205,95,56,52,113,204,31,118,95,95,164,163,2,0,0,0};
static const struct packed_file {
const char *name;
const unsigned char *data;
size_t size;
time_t mtime;
} packed_files[] = {
{"/web_root/index.html.gz", v1, sizeof(v1), 0},
{"/web_root/main.js.gz", v2, sizeof(v2), 0},
{"/web_root/style.css.gz", v3, sizeof(v3), 0},
{NULL, NULL, 0, 0}
};
static int scmp(const char *a, const char *b) {
while (*a && (*a == *b)) a++, b++;
return *(const unsigned char *) a - *(const unsigned char *) b;
}
const char *mg_unlist(size_t no) {
return packed_files[no].name;
}
const char *mg_unpack(const char *name, size_t *size, time_t *mtime) {
const struct packed_file *p;
for (p = packed_files; p->name != NULL; p++) {
if (scmp(p->name, name) != 0) continue;
if (size != NULL) *size = p->size - 1;
if (mtime != NULL) *mtime = p->mtime;
return (const char *) p->data;
}
return NULL;
};