chiark
/
gitweb
/
~ian
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
util.h etc.: Provide MAX_RAW and MIN_RAW; etc.
[secnet.git]
/
util.h
diff --git
a/util.h
b/util.h
index b44b911189ee0d2e28c8b8df8ffcea91ef987fc1..a5a82a431e8eed383e24b6d55f122ac2ea779154 100644
(file)
--- a/
util.h
+++ b/
util.h
@@
-161,6
+161,9
@@
async_linebuf_read(struct pollfd *pfd, struct buffer_if *buf,
#define MAX(a,b) MINMAX((a),(b),>)
#define MIN(a,b) MINMAX((a),(b),<)
+#define MAX_RAW(a,b) ((a)>(b)?(a):(b))
+#define MIN_RAW(a,b) ((a)<(b)?(a):(b))
+
static inline bool_t iswouldblock(int e)
{ return e==EWOULDBLOCK || e==EAGAIN; }