summaryrefslogtreecommitdiff
path: root/alf/alf.h
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-25 21:45:01 +0100
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-25 21:45:01 +0100
commit55211af76164fe6c39249c14be47363d35a4db0f (patch)
tree417d9e8805c52d6421798331bea59993e7f1fa1a /alf/alf.h
parent02d94ecd62e11e28ba87451c392cc6b633bb5c56 (diff)
add memory allocation functions
Diffstat (limited to 'alf/alf.h')
-rw-r--r--alf/alf.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/alf/alf.h b/alf/alf.h
index 38e3b0b..f5e3b26 100644
--- a/alf/alf.h
+++ b/alf/alf.h
@@ -89,6 +89,18 @@ ALF_CreateApplication(HINSTANCE hInstance);
void
ALF_TeardownApplication(ALFAPP app);
+void *
+ALF_Alloc(SIZE_T nmemb, SIZE_T size);
+
+void *
+ALF_ReAlloc(void *ptr, SIZE_T nmemb, SIZE_T size);
+
+#define ALF_New(type, count) ((type *)ALF_Alloc((count), sizeof(type)))
+#define ALF_ReNew(ptr, type, count) ((type *)ALF_ReAlloc(ptr, (count), sizeof(type)))
+
+void
+ALF_Free(const void *p);
+
LPTSTR
ALF_RegisterWindowClass(ALFAPP app, const ALFWindowClassParams *params);
@@ -180,10 +192,10 @@ ALF_SetText(HWND hwnd, const TCHAR *text);
void
ALF_SetWidgetText(HWND parent, WORD id, const TCHAR *text);
-TCHAR * // free with HeapFree
+TCHAR * // free with ALF_Free
ALF_Text(HWND hwnd);
-TCHAR * // free with HeapFree
+TCHAR * // free with ALF_Free
ALF_WidgetText(HWND parent, WORD id);
DWORD
@@ -236,7 +248,7 @@ ALF_ComboBoxInsertString(HWND combo, int index, const TCHAR *text);
void
ALF_ComboBoxRemoveString(HWND combo, int index);
-TCHAR * // free with HeapFree
+TCHAR * // free with ALF_Free
ALF_ComboBoxStringForIndex(HWND combo, int index);
int
@@ -245,7 +257,7 @@ ALF_ComboBoxCurrentIndex(HWND combo);
void
ALF_ComboBoxSetCurrentIndex(HWND combo, int index);
-TCHAR * // free with HeapFree
+TCHAR * // free with ALF_Free
ALF_ComboBoxCurrentText(HWND combo);
void