summaryrefslogtreecommitdiff
path: root/src/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/header.c')
-rw-r--r--src/header.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/header.c b/src/header.c
index 6389817..82a181c 100644
--- a/src/header.c
+++ b/src/header.c
@@ -24,8 +24,18 @@
#include "header.h"
#include "io.h"
-static bool is_xp3(struct header *h);
-static bool is_supported(struct header *h);
+
+/* Checks that the header contains the correct magic number. */
+static bool is_xp3(struct header *h) {
+ return !memcmp(h->magic, XP3_MAGIC, 11);
+}
+
+
+/* Checks that the archive's version is supported, and that it is marked
+ as compatible with the KiriKiriZ engine. */
+static bool is_supported(struct header *h) {
+ return h->version == 1 && h->flags & 0x80;
+}
/* Reads from the given stream into a newly allocated header structure.
@@ -36,7 +46,7 @@ struct header *read_header(struct stream *s) {
if (h == NULL) return NULL;
/* The header structure can't be read into directly because of
- potential alignment issues. */
+ alignment issues. */
stream_read(h->magic, s, 11);
stream_read(&h->info_offset, s, sizeof(uint64_t));
stream_read(&h->version, s, sizeof(uint32_t));
@@ -50,16 +60,3 @@ struct header *read_header(struct stream *s) {
}
return h;
}
-
-
-/* Checks that the header contains the correct magic number. */
-static bool is_xp3(struct header *h) {
- return !memcmp(h->magic, XP3_MAGIC, 11);
-}
-
-
-/* Checks that the archive's version is supported, and that it is marked
- as compatible with the KiriKiriZ engine. */
-static bool is_supported(struct header *h) {
- return h->version == 1 && h->flags & 0x80;
-}