Mercurial > msvpvf
comparison 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 |
comparison
equal
deleted
inserted
replaced
87:2e819b84d7c0 | 88:af4ed765c1ac |
---|---|
1 #ifndef msvpvf_common_h | 1 #ifndef msvpvf_common_h |
2 #define msvpvf_common_h | 2 #define msvpvf_common_h |
3 | 3 |
4 #include <stdio.h> | 4 #include <stdio.h> |
5 #include <stdint.h> | 5 #include <stdint.h> |
6 #include <stddef.h> /* size_t */ | |
7 #include <stdarg.h> | |
6 | 8 |
7 #ifndef ARRAYSIZE | 9 /* windows clobbers ARRAYSIZE() */ |
8 #define ARRAYSIZE(x) \ | 10 #define ARRAY_SIZE(x) \ |
9 (sizeof(x)/sizeof((x)[0])) | 11 (sizeof(x)/sizeof((x)[0])) |
10 #endif | |
11 | 12 |
12 enum types { | 13 enum types { |
13 TYPES_UNKNOWN = 0, | 14 TYPES_UNKNOWN = 0, |
14 TYPES_VF, | 15 TYPES_VF, |
15 TYPES_VEG | 16 TYPES_VEG |
16 }; | 17 }; |
17 | 18 |
19 extern const char *type_names[]; | |
20 | |
18 int set_file_information(FILE* target, uint8_t version, enum types type); | 21 int set_file_information(FILE* target, uint8_t version, enum types type); |
19 int get_file_information(FILE* input, uint8_t* version, enum types* type); | 22 int get_file_information(FILE* input, uint8_t* version, enum types* type); |
23 int copy_file(FILE *source, FILE *target); | |
24 | |
25 /* simple malloc -> memcpy (memdup ?) */ | |
26 char *str_ndup(const char *str, size_t sz); | |
27 /* str_ndup(str, strlen(str)) */ | |
28 char *str_dup(const char *str); | |
29 | |
30 char *msvpvf_vasprintf(const char *format, va_list ap); | |
31 char *msvpvf_asprintf(const char *format, ...); | |
20 | 32 |
21 #endif /* msvpvf_common_h */ | 33 #endif /* msvpvf_common_h */ |