diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-05-29 14:24:31 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-05-29 14:24:31 +0200 |
| commit | 13b65f01132c41be9ab8d9f92c2c5ca605c366d8 (patch) | |
| tree | 74bd5b4dee779e4600d416adf4abcd4f621addab /src/util.h | |
| parent | 62d99253144a14648c4da1c2a60c01e7b06ef02c (diff) | |
| download | enowars5-service-stldoctor-13b65f01132c41be9ab8d9f92c2c5ca605c366d8.tar.gz enowars5-service-stldoctor-13b65f01132c41be9ab8d9f92c2c5ca605c366d8.zip | |
changed repo structure and commited releease files such that default docker-compose worklow commands work in testvm
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..c0e9064 --- /dev/null +++ b/src/util.h @@ -0,0 +1,38 @@ +#ifndef UTIL_H +#define UTIL_H + +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <stdio.h> +#include <errno.h> + +#define ARRSIZE(x) (sizeof(x)/sizeof((x)[0])) +#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#define MAX(x,y) ((x) < (y) ? (y) : (x)) + +#define NULLFREE(p) do { free(p); p = NULL; } while (0) + +#define MHASHLEN 40 + +enum { FAIL = 0, OK = 1 }; + +void* checkp(void *p); +void* die(const char *fmtstr, ...); +char* aprintf(const char *fmtstr, ...); + +const char* mhash(const char *filename, int len); +int checkalph(const char *str, const char *alph); + +void freadstr(FILE *f, char **dst); +void fputstr(FILE *f, char *s); + +const char* ask(const char *fmtstr, ...); +void dump(const char *filepath); +int strpfcmp(const char *prefix, const char *str); + +float fle32toh(float v); + +extern int echo; + +#endif /* UTIL_H */ |
