]> Pileus Git - lackey/blobdiff - src/util.h
Add size function, update ical/week
[lackey] / src / util.h
index 98fb33285a8b40c242703b93843c5e3d52329c93..25e6d8d753d8169621e36a4a806cf7c4b47ea8d1 100644 (file)
 /* Macros */
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
+#define CLAMP(x,l,h) MIN(MAX(x,l),h)
 #define ROUND(x) ((int)((x)+0.5))
 #define N_ELEMENTS(x) (sizeof(x)/sizeof((x)[0]))
 
 /* Debug functions */
 void util_init(void);
 
+/* Misc functions */
+char *sdup(const char *str);
+
 /* Debug functions */
 #ifdef DEBUG
 int debug(char *fmt, ...);