util.h revision 6091827530d6dd43479d6709fb6e9f745c11e900
/*-*- Mode: C; c-basic-offset: 8 -*-*/
#ifndef fooutilhfoo
#define fooutilhfoo
#include <inttypes.h>
#include <time.h>
#include <stdbool.h>
#define USEC_PER_SEC 1000000ULL
#define NSEC_PER_USEC 1000ULL
static inline const char* yes_no(bool b) {
return b ? "yes" : "no";
}
static inline const char* strempty(const char *s) {
return s ? s : "";
}
static inline const char* strnull(const char *s) {
return s ? s : "(null)";
}
bool startswith(const char *s, const char *prefix);
int nointr_close(int fd);
#endif