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

@ -8,4 +8,25 @@
#ifndef NECRONDA_SERVER_CACHE_H
#define NECRONDA_SERVER_CACHE_H
#include <magic.h>
magic_t magic;
typedef struct {
char *etag;
char *type;
char *subtype;
char *filename_comp;
struct stat stat;
} meta_data;
typedef struct {
char *filename;
unsigned short filename_len;
meta_data meta;
} cache_entry;
cache_entry cache[FILE_CACHE_SIZE];
int cache_entries = 0;
#endif //NECRONDA_SERVER_CACHE_H