diff --git a/CMakeLists.txt b/CMakeLists.txt
index 095e11f..e87d805 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,5 +15,5 @@ add_executable(cmoeditor editor.c)
target_link_libraries(cmoe spb)
target_link_libraries(cmoeditor spb)
-INSTALL(TARGETS cmoe RUNTIME DESTINATION bin)
+#INSTALL(TARGETS cmoe RUNTIME DESTINATION bin)
INSTALL(TARGETS cmoeditor RUNTIME DESTINATION bin)
diff --git a/assets/favicon.png b/assets/favicon.png
new file mode 100644
index 0000000..3f9e9a8
Binary files /dev/null and b/assets/favicon.png differ
diff --git a/assets/index.html b/assets/index.html
index 5548432..fe08c0a 100644
--- a/assets/index.html
+++ b/assets/index.html
@@ -29,6 +29,8 @@
Just use the query parameters theme
, like this: /cmoe?name=yourname&theme=mb
+ asoul(asl)
+
moebooru(mb)
moebooru-h(mbh)
@@ -71,6 +73,7 @@
+
diff --git a/assets/theme/gelbooru-h/0.png b/assets/theme/gelbooru-h/0.png
deleted file mode 100644
index 695b5a4..0000000
Binary files a/assets/theme/gelbooru-h/0.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/1.png b/assets/theme/gelbooru-h/1.png
deleted file mode 100644
index cca7eb3..0000000
Binary files a/assets/theme/gelbooru-h/1.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/2.png b/assets/theme/gelbooru-h/2.png
deleted file mode 100644
index b1bab7a..0000000
Binary files a/assets/theme/gelbooru-h/2.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/3.png b/assets/theme/gelbooru-h/3.png
deleted file mode 100644
index f5a5671..0000000
Binary files a/assets/theme/gelbooru-h/3.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/4.png b/assets/theme/gelbooru-h/4.png
deleted file mode 100644
index 4707d9e..0000000
Binary files a/assets/theme/gelbooru-h/4.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/5.png b/assets/theme/gelbooru-h/5.png
deleted file mode 100644
index b925607..0000000
Binary files a/assets/theme/gelbooru-h/5.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/6.png b/assets/theme/gelbooru-h/6.png
deleted file mode 100644
index ce30385..0000000
Binary files a/assets/theme/gelbooru-h/6.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/7.png b/assets/theme/gelbooru-h/7.png
deleted file mode 100644
index b2e7bcc..0000000
Binary files a/assets/theme/gelbooru-h/7.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/8.png b/assets/theme/gelbooru-h/8.png
deleted file mode 100644
index 213df99..0000000
Binary files a/assets/theme/gelbooru-h/8.png and /dev/null differ
diff --git a/assets/theme/gelbooru-h/9.png b/assets/theme/gelbooru-h/9.png
deleted file mode 100644
index edf3d51..0000000
Binary files a/assets/theme/gelbooru-h/9.png and /dev/null differ
diff --git a/assets/theme/gelbooru/0.gif b/assets/theme/gelbooru/0.gif
deleted file mode 100644
index 6c348e5..0000000
Binary files a/assets/theme/gelbooru/0.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/1.gif b/assets/theme/gelbooru/1.gif
deleted file mode 100644
index 1c33ee3..0000000
Binary files a/assets/theme/gelbooru/1.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/2.gif b/assets/theme/gelbooru/2.gif
deleted file mode 100644
index e6df16c..0000000
Binary files a/assets/theme/gelbooru/2.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/3.gif b/assets/theme/gelbooru/3.gif
deleted file mode 100644
index 3ee1bcd..0000000
Binary files a/assets/theme/gelbooru/3.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/4.gif b/assets/theme/gelbooru/4.gif
deleted file mode 100644
index aabf121..0000000
Binary files a/assets/theme/gelbooru/4.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/5.gif b/assets/theme/gelbooru/5.gif
deleted file mode 100644
index 46f4940..0000000
Binary files a/assets/theme/gelbooru/5.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/6.gif b/assets/theme/gelbooru/6.gif
deleted file mode 100644
index cd316a0..0000000
Binary files a/assets/theme/gelbooru/6.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/7.gif b/assets/theme/gelbooru/7.gif
deleted file mode 100644
index 6019a72..0000000
Binary files a/assets/theme/gelbooru/7.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/8.gif b/assets/theme/gelbooru/8.gif
deleted file mode 100644
index 9baa78f..0000000
Binary files a/assets/theme/gelbooru/8.gif and /dev/null differ
diff --git a/assets/theme/gelbooru/9.gif b/assets/theme/gelbooru/9.gif
deleted file mode 100644
index 1e3f85f..0000000
Binary files a/assets/theme/gelbooru/9.gif and /dev/null differ
diff --git a/assets/theme/moebooru-h/0.png b/assets/theme/moebooru-h/0.png
deleted file mode 100644
index 28fc599..0000000
Binary files a/assets/theme/moebooru-h/0.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/1.png b/assets/theme/moebooru-h/1.png
deleted file mode 100644
index 38289ea..0000000
Binary files a/assets/theme/moebooru-h/1.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/2.png b/assets/theme/moebooru-h/2.png
deleted file mode 100644
index cd59c1d..0000000
Binary files a/assets/theme/moebooru-h/2.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/3.png b/assets/theme/moebooru-h/3.png
deleted file mode 100644
index af847d0..0000000
Binary files a/assets/theme/moebooru-h/3.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/4.png b/assets/theme/moebooru-h/4.png
deleted file mode 100644
index 77f31bd..0000000
Binary files a/assets/theme/moebooru-h/4.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/5.png b/assets/theme/moebooru-h/5.png
deleted file mode 100644
index 2aab6a5..0000000
Binary files a/assets/theme/moebooru-h/5.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/6.png b/assets/theme/moebooru-h/6.png
deleted file mode 100644
index f66dbd2..0000000
Binary files a/assets/theme/moebooru-h/6.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/7.png b/assets/theme/moebooru-h/7.png
deleted file mode 100644
index 40cf378..0000000
Binary files a/assets/theme/moebooru-h/7.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/8.png b/assets/theme/moebooru-h/8.png
deleted file mode 100644
index 5c5d2dd..0000000
Binary files a/assets/theme/moebooru-h/8.png and /dev/null differ
diff --git a/assets/theme/moebooru-h/9.png b/assets/theme/moebooru-h/9.png
deleted file mode 100644
index 40978b8..0000000
Binary files a/assets/theme/moebooru-h/9.png and /dev/null differ
diff --git a/assets/theme/moebooru/0.gif b/assets/theme/moebooru/0.gif
deleted file mode 100644
index 385282d..0000000
Binary files a/assets/theme/moebooru/0.gif and /dev/null differ
diff --git a/assets/theme/moebooru/1.gif b/assets/theme/moebooru/1.gif
deleted file mode 100644
index 183fabe..0000000
Binary files a/assets/theme/moebooru/1.gif and /dev/null differ
diff --git a/assets/theme/moebooru/2.gif b/assets/theme/moebooru/2.gif
deleted file mode 100644
index 53459fb..0000000
Binary files a/assets/theme/moebooru/2.gif and /dev/null differ
diff --git a/assets/theme/moebooru/3.gif b/assets/theme/moebooru/3.gif
deleted file mode 100644
index ea0398f..0000000
Binary files a/assets/theme/moebooru/3.gif and /dev/null differ
diff --git a/assets/theme/moebooru/4.gif b/assets/theme/moebooru/4.gif
deleted file mode 100644
index fa0db17..0000000
Binary files a/assets/theme/moebooru/4.gif and /dev/null differ
diff --git a/assets/theme/moebooru/5.gif b/assets/theme/moebooru/5.gif
deleted file mode 100644
index 348f202..0000000
Binary files a/assets/theme/moebooru/5.gif and /dev/null differ
diff --git a/assets/theme/moebooru/6.gif b/assets/theme/moebooru/6.gif
deleted file mode 100644
index a84ab8c..0000000
Binary files a/assets/theme/moebooru/6.gif and /dev/null differ
diff --git a/assets/theme/moebooru/7.gif b/assets/theme/moebooru/7.gif
deleted file mode 100644
index 784e7d0..0000000
Binary files a/assets/theme/moebooru/7.gif and /dev/null differ
diff --git a/assets/theme/moebooru/8.gif b/assets/theme/moebooru/8.gif
deleted file mode 100644
index ffc3b4a..0000000
Binary files a/assets/theme/moebooru/8.gif and /dev/null differ
diff --git a/assets/theme/moebooru/9.gif b/assets/theme/moebooru/9.gif
deleted file mode 100644
index 4b866c5..0000000
Binary files a/assets/theme/moebooru/9.gif and /dev/null differ
diff --git a/assets/theme/rule34/0.gif b/assets/theme/rule34/0.gif
deleted file mode 100644
index 3512b00..0000000
Binary files a/assets/theme/rule34/0.gif and /dev/null differ
diff --git a/assets/theme/rule34/1.gif b/assets/theme/rule34/1.gif
deleted file mode 100644
index b292edd..0000000
Binary files a/assets/theme/rule34/1.gif and /dev/null differ
diff --git a/assets/theme/rule34/2.gif b/assets/theme/rule34/2.gif
deleted file mode 100644
index 6d3a68a..0000000
Binary files a/assets/theme/rule34/2.gif and /dev/null differ
diff --git a/assets/theme/rule34/3.gif b/assets/theme/rule34/3.gif
deleted file mode 100644
index 1b91cb3..0000000
Binary files a/assets/theme/rule34/3.gif and /dev/null differ
diff --git a/assets/theme/rule34/4.gif b/assets/theme/rule34/4.gif
deleted file mode 100644
index 7dec2c2..0000000
Binary files a/assets/theme/rule34/4.gif and /dev/null differ
diff --git a/assets/theme/rule34/5.gif b/assets/theme/rule34/5.gif
deleted file mode 100644
index e89449d..0000000
Binary files a/assets/theme/rule34/5.gif and /dev/null differ
diff --git a/assets/theme/rule34/6.gif b/assets/theme/rule34/6.gif
deleted file mode 100644
index 3869b82..0000000
Binary files a/assets/theme/rule34/6.gif and /dev/null differ
diff --git a/assets/theme/rule34/7.gif b/assets/theme/rule34/7.gif
deleted file mode 100644
index 5b29513..0000000
Binary files a/assets/theme/rule34/7.gif and /dev/null differ
diff --git a/assets/theme/rule34/8.gif b/assets/theme/rule34/8.gif
deleted file mode 100644
index e75867a..0000000
Binary files a/assets/theme/rule34/8.gif and /dev/null differ
diff --git a/assets/theme/rule34/9.gif b/assets/theme/rule34/9.gif
deleted file mode 100644
index 1c59260..0000000
Binary files a/assets/theme/rule34/9.gif and /dev/null differ
diff --git a/cmoe.c b/cmoe.c
index 188517f..5ab3292 100644
--- a/cmoe.c
+++ b/cmoe.c
@@ -90,10 +90,7 @@ static inline uint32_t get_content_len(int isbig, uint16_t* len_type, char* cnts
}
#define has_next(fp, ch) ((ch=getc(fp)),(feof(fp)?0:(ungetc(ch,fp),1)))
-#define set_type(name, t, l) if (!strcmp(theme, name)) {\
- theme_type = (char**)t;\
- len_type = (uint16_t*)l;\
- }
+#define cmp_and_set_type(t) if (!strcmp(theme, #t)) { theme_type = (char**)t; len_type = (uint16_t*)t##l; }
static void return_count(FILE* fp, char* name, char* theme) {
int ch, exist = 0, user_exist = 0;
char buf[sizeof(simple_pb_t)+sizeof(counter_t)];
@@ -120,10 +117,11 @@ static void return_count(FILE* fp, char* name, char* theme) {
char** theme_type = (char**)mb;
uint16_t* len_type = (uint16_t*)mbl;
if (theme) {
- set_type("mbh", mbh, mbhl) else
- set_type("r34", r34, r34l) else
- set_type("gb", gb, gbl) else
- set_type("gbh", gbh, gbhl)
+ cmp_and_set_type(mbh) else
+ cmp_and_set_type(r34) else
+ cmp_and_set_type(gb) else
+ cmp_and_set_type(gbh) else
+ cmp_and_set_type(asl)
isbig = (theme_type == (char**)gb || theme_type == (char**)gbh);
}
int w, h;
diff --git a/cmoe.h b/cmoe.h
index c45a404..0409f4e 100644
--- a/cmoe.h
+++ b/cmoe.h
@@ -16,8 +16,8 @@ typedef struct counter_t counter_t;
#define H400 "HTTP/1.0 400 BAD REQUEST\r\nContent-Type: text/html\r\n\r\n%s\r\n"
#define H404 "HTTP/1.0 404 NOT FOUND\r\nContent-Type: text/html\r\n\r\n
Not Found\r\n%s\r\n\r\n"
#define H500 "HTTP/1.0 500 Internal Server Error\r\nContent-Type: text/html\r\n\r\n
%s\r\n"
-const char* types[] = {H400, H404, H500};
-const uint8_t typel[] = {59, 111, 69};
+const static char* types[] = {H400, H404, H500};
+const static uint8_t typel[] = {59, 111, 69};
enum errcode_enum_t {HTTP400, HTTP404, HTTP500};
typedef enum errcode_enum_t errcode_enum_t;
@@ -25,32 +25,26 @@ typedef enum errcode_enum_t errcode_enum_t;
#define CONTENT_LEN "Content-Length: %d\r\n"
#define CACHE_CTRL "Cache-Control: max-age=0, no-cache, no-store, must-revalidate\r\n"
-const uint16_t mbl[] = {1442, 1254, 1406, 1322, 1418, 1706, 1582, 1546, 1478, 1418};
-const uint16_t mbhl[] = {930, 1050, 1162, 1058, 1114, 1446, 1082, 1374, 1242, 1126};
-const uint16_t r34l[] = {13806, 8958, 9438, 14678, 13246, 12682, 11310, 11054, 1818, 6874};
-const uint16_t gbl[] = {2550, 2302, 2450, 2494, 2298, 3042, 2886, 2754, 2574, 2550};
-const uint16_t gbhl[] = {1550, 1702, 1870, 1778, 1618, 2370, 1830, 2234, 1914, 1878};
-
#define W_SMALL 45
#define H_SMALL 100
#define W_BIG 68
#define H_BIG 150
-const char svg_small[] =
+const static char svg_small[] =
"