Add scripts

This commit is contained in:
kuben
2019-11-03 14:28:22 +01:00
parent fc0ee648e0
commit a58cdb6355
9 changed files with 1620 additions and 0 deletions

25
scripts/health/utils.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef UTILS_H
#define UTILS_H
#include <sys/types.h>
#include <string.h>
size_t utf8len(const char *s);
typedef struct {
const char *str;
const size_t bytes;
size_t chars;
} ustring;
#define NEW_USTRING(string) {.str = string, .bytes = strlen(string)}//; varname.chars=utf8len(string)}
#define INIT_USTRING(varname) (varname).chars = utf8len(varname.str)
long long pretty_bytes_to_num(char* buf);
int pretty_bytes(char* buf, long long bytes);
void debug(const char *format, ...);
void indent (int i);
void indent_debug (int i);
#endif