]> git.itanic.dy.fi Git - glucose/blob - utils.h
Factor out misc functions into utils.[ch] files
[glucose] / utils.h
1 #ifndef _UTILS_H
2 #define _UTILS_H
3
4 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
5
6 static inline int is_printable(const unsigned char c)
7 {
8         return c >= 0x20 && c < 0x80;
9 }
10
11 int datalen(const unsigned char *data);
12 void print_hex(const unsigned char *data, int len);
13 void print_ascii(const unsigned char *data, int len);
14
15 #endif