annotate include/common.h @ 79:8f90d5addda9 v2.0

*: refactor... basically everything! The Win32 GUI version is now unicode-friendly. HOWEVER, ANSI still very much works. you can configure which version to use through `-DUNICODE=0/1` in CFLAGS. the CLI is also friendlier and uses a more sane interface as well. note: the command line flags (which were optional before) are now required. Unicode filenames will not work on Windows because Windows sucks.
author Paper <paper@paper.us.eu.org>
date Wed, 20 Mar 2024 17:06:26 -0400
parents fcd4b9fe957b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
79
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
1 #ifndef msvpvf_common_h
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
2 #define msvpvf_common_h
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
3
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
4 #include <stdio.h>
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
5 #include <stdint.h>
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
6
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
7 #ifndef ARRAYSIZE
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
8 #define ARRAYSIZE(x) \
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
9 (sizeof(x)/sizeof((x)[0]))
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
10 #endif
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
11
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
12 enum types {
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
13 TYPES_UNKNOWN = 0,
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
14 TYPES_VF,
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
15 TYPES_VEG
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
16 };
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
17
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
18 int set_file_information(FILE* target, uint8_t version, enum types type);
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
19 int get_file_information(FILE* input, uint8_t* version, enum types* type);
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
20
8f90d5addda9 *: refactor... basically everything!
Paper <paper@paper.us.eu.org>
parents: 58
diff changeset
21 #endif /* msvpvf_common_h */