Added magic file type detection

This commit is contained in:
2020-12-19 22:09:03 +01:00
parent f6ac55adaf
commit f0338209f5
8 changed files with 52 additions and 10 deletions

View File

@ -6,3 +6,26 @@
*/
#include "cache.h"
#include "uri.h"
int magic_init() {
magic = magic_open(MAGIC_MIME);
magic_load(magic, "/usr/share/misc/magic.mgc");
return 0;
}
int cache_init() {
magic_init();
return 0;
}
int uri_cache_init(http_uri *uri) {
if (uri->filename == NULL) {
return -1;
}
return 0;
}