1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00
Files
stedolan-jq/util.h
Nicolas Williams 8aecf82bfe WriteFile() on WIN32 when stdout isatty (fix #824)
Use WriteFile() and bypass stdio IFF stdout isatty and we're on Windows.
2015-06-22 20:47:47 -05:00

33 lines
619 B
C

#ifndef UTIL_H
#define UTIL_H
#include "jv.h"
#ifndef HAVE_MKSTEMP
int mkstemp(char *template);
#endif
jv expand_path(jv);
jv get_home(void);
jv jq_realpath(jv);
void priv_fwrite(const char *, size_t, FILE *, int);
const void *_jq_memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
#ifndef MIN
#define MIN(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#endif
#ifndef MAX
#define MAX(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#endif
#endif /* UTIL_H */