farbfeld

suckless image format with conversion tools
git clone git://git.suckless.org/farbfeld
Log | Files | Refs | README | LICENSE

util.h (784B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include <stdint.h>
      3 #include <stdio.h>
      4 
      5 #define LEN(x) (sizeof (x) / sizeof *(x))
      6 
      7 extern char *argv0;
      8 
      9 void warn(const char *, ...);
     10 void die(const char *, ...);
     11 
     12 void ff_read_header(uint32_t *width, uint32_t *height);
     13 void ff_write_header(uint32_t width, uint32_t height);
     14 
     15 int parse_mask(const char *, uint16_t mask[3]);
     16 
     17 int fshut(FILE *, const char *);
     18 
     19 void efread(void *, size_t, size_t, FILE *);
     20 void efwrite(const void *, size_t, size_t, FILE *);
     21 
     22 #undef reallocarray
     23 void *reallocarray(void *, size_t, size_t);
     24 void *ereallocarray(void *optr, size_t nmemb, size_t size);
     25 
     26 #undef strtonum
     27 long long strtonum(const char *, long long, long long, const char **);
     28 long long estrtonum(const char *, long long, long long);