diff options
| author | Franklin Wei <git@fwei.tk> | 2016-05-19 16:47:06 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-05-19 16:47:06 -0400 |
| commit | cb8af6e7bf5f6e70fc9722d36448213c719e83c8 (patch) | |
| tree | ec9f93d6e1256d62a49fb628d8d7a3a931b58330 /src/util.h | |
| parent | 7f3ba14388a586a946d721a71eb3a9862f7f6c02 (diff) | |
| download | netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.zip netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.tar.gz netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.tar.bz2 netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.tar.xz | |
implement more of dunnet
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -23,6 +23,11 @@ #define WSPACE " \t\r\n" +/* convenience macros */ +#define ARRAYLEN(x) (sizeof(x)/sizeof(x[0])) +#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MIN(a,b) (((a)<(b))?(a):(b)) + /* utility functions */ void __attribute__((noreturn,format(printf,1,2))) error(const char *fmt, ...); void __attribute__((format(printf,4,5))) debugf_real(const char*, int, const char*, const char *fmt, ...); @@ -48,6 +53,9 @@ uint64_t read_uint64(int fd); void write_size(int fd, size_t); size_t read_size(int fd); +void write_int(int fd, int i); +int read_int(int fd); + bool is_vowel(char c); size_t strlcat(char *dst, const char *src, size_t siz); |