aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcathook <cat.hook31894@gmail.com>2013-11-25 00:35:55 +0800
committercathook <cat.hook31894@gmail.com>2013-11-25 00:35:55 +0800
commita95b870df24dc01ebaa3e7def25ae2fd716c779f (patch)
tree7cf6eccc80dffa7e7d1b724401a2fad383ffe28e
parent5ab3c0eef78e23d6433d6bd1cd4141a12922cb45 (diff)
downloadctl-a95b870df24dc01ebaa3e7def25ae2fd716c779f.tar.gz
ctl-a95b870df24dc01ebaa3e7def25ae2fd716c779f.tar.zst
ctl-a95b870df24dc01ebaa3e7def25ae2fd716c779f.zip
change header file
-rw-r--r--include/utility.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/utility.h b/include/utility.h
index 673d10b..2e4330d 100644
--- a/include/utility.h
+++ b/include/utility.h
@@ -34,6 +34,7 @@
/* ctl_malloc like malloc(), but will exit on error */
/* ctl_realloc like realloc(), but will exit on erro */
/* ctl_die print some message and exit() */
+/* ctl_swap swap two elements with given type */
/* */
/**********************************************************/
@@ -100,4 +101,6 @@ pvoid ctl_malloc (size_t size);
pvoid ctl_realloc(pvoid *ptr, size_t size);
void ctl_die (ErrorType e);
+#define ctl_swap(X,Y,Z) do{X zzzztmp=(Y);(Y)=(Z);(Z)=zzzztmp;}while(0)
+
#endif /* __utility_h__ */