#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
