Added magic file type detection
This commit is contained in:
21
src/cache.h
21
src/cache.h
@ -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
|
||||
|
Reference in New Issue
Block a user