diff include/common.h @ 88:af4ed765c1ac

*: add IUP GUI a lot simpler than win32, but I assume there's more going on in the background that I don't know about :)
author Paper <paper@tflc.us>
date Mon, 14 Jul 2025 02:39:24 -0400
parents 8f90d5addda9
children
line wrap: on
line diff
--- a/include/common.h	Mon Jul 15 01:35:03 2024 -0400
+++ b/include/common.h	Mon Jul 14 02:39:24 2025 -0400
@@ -3,11 +3,12 @@
 
 #include <stdio.h>
 #include <stdint.h>
+#include <stddef.h> /* size_t */
+#include <stdarg.h>
 
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(x) \
+/* windows clobbers ARRAYSIZE() */
+#define ARRAY_SIZE(x) \
 	(sizeof(x)/sizeof((x)[0]))
-#endif
 
 enum types {
 	TYPES_UNKNOWN = 0,
@@ -15,7 +16,18 @@
 	TYPES_VEG
 };
 
+extern const char *type_names[];
+
 int set_file_information(FILE* target, uint8_t version, enum types type);
 int get_file_information(FILE* input, uint8_t* version, enum types* type);
+int copy_file(FILE *source, FILE *target);
+
+/* simple malloc -> memcpy (memdup ?) */
+char *str_ndup(const char *str, size_t sz);
+/* str_ndup(str, strlen(str)) */
+char *str_dup(const char *str);
+
+char *msvpvf_vasprintf(const char *format, va_list ap);
+char *msvpvf_asprintf(const char *format, ...);
 
 #endif /* msvpvf_common_h */