]> git.sur5r.net Git - i3/i3/blobdiff - include/libi3.h
move sstrdup, scalloc, smalloc, srealloc to libi3, improve error messages
[i3/i3] / include / libi3.h
index 3883ba82b9de0e7477beb9f8d4515b012f93d92b..a675d11ed41139db7944b581f3d5cfb44ef0acdc 100644 (file)
  */
 char *socket_path_from_x11();
 
+/**
+ * Safe-wrapper around malloc which exits if malloc returns NULL (meaning that
+ * there is no more memory available)
+ *
+ */
+void *smalloc(size_t size);
+
+/**
+ * Safe-wrapper around calloc which exits if malloc returns NULL (meaning that
+ * there is no more memory available)
+ *
+ */
+void *scalloc(size_t size);
+
+/**
+ * Safe-wrapper around realloc which exits if realloc returns NULL (meaning
+ * that there is no more memory available).
+ *
+ */
+void *srealloc(void *ptr, size_t size);
+
+/**
+ * Safe-wrapper around strdup which exits if malloc returns NULL (meaning that
+ * there is no more memory available)
+ *
+ */
+char *sstrdup(const char *str);
+
 #endif