agendafs

A filesystem for your calendar.

git clone git://mccd.space/agendafs

util.h (520B)

      1 #ifndef UTIL_H
      2 #define UTIL_H
      3 
      4 #include <stdbool.h>
      5 #include <stdlib.h>
      6 
      7 #ifdef DEBUG
      8 #define LOG(fmt, ...)                                                          \
      9 	fprintf(stderr, "[%s:%d] " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
     10 #else
     11 #define LOG(fmt, ...)
     12 #endif
     13 
     14 void *
     15 reallocarray(void *, size_t, size_t);
     16 void *
     17 xreallocarray(void *, size_t, size_t);
     18 void *
     19 xmalloc(size_t);
     20 void *
     21 xcalloc(size_t, size_t);
     22 char *
     23 xstrdup(const char *s);
     24 bool
     25 starts_with_str(const char *str, const char *prefix);
     26 #endif