Server is basically working.

Needs a re-design.
This commit is contained in:
2014-08-03 16:18:18 +01:00
parent e8d1e4d7d9
commit 34ef45478e
19 changed files with 671 additions and 265 deletions

39
src/util.h Normal file
View File

@@ -0,0 +1,39 @@
/*
* File: util.h
* Author: sam
*
* Created on 03 August 2014, 13:52
*/
#ifndef UTIL_H
#define UTIL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
typedef struct file_map {
char* map;
size_t size;
} file_map;
void fatal(char* msg);
void warning(bool showPError, char* msg, ...);
void info(char* msg, ...);
char* str_trimwhitespace(char *str);
char** str_splitlines(char *str, size_t *line_count);
char* str_replace(char *str, const char *search, const char *replacement);
file_map* file_map_new(const char* filename);
void file_map_delete(file_map* map);
#ifdef __cplusplus
}
#endif
#endif /* UTIL_H */