Make error_msg() display errors at init time
[cmus.git] / ape.h
blobecdb72176593c3731132e9d4bba0ab17958aa7df
1 /*
2 * Copyright 2007 Johannes Weißl
3 */
5 #ifndef _APE_H
6 #define _APE_H
8 #include <inttypes.h>
9 #include <stdlib.h>
11 struct ape_header {
12 /* 1000 or 2000 (1.0, 2.0) */
13 uint32_t version;
15 /* tag size (header + tags, excluding footer) */
16 uint32_t size;
18 /* number of items */
19 uint32_t count;
21 /* global flags for each tag
22 * there are also private flags for every tag
23 * NOTE: 0 for version 1.0 (1000)
25 uint32_t flags;
28 /* ape flags */
29 #define AF_IS_UTF8(f) (((f) & 6) == 0)
30 #define AF_IS_FOOTER(f) (((f) & (1 << 29)) == 0)
32 struct apetag {
33 char *buf;
34 int pos;
35 struct ape_header header;
38 #define APETAG(name) struct apetag name = { .buf = NULL, .pos = 0, }
40 extern int ape_read_tags(struct apetag *ape, int fd, int slow);
41 extern char *ape_get_comment(struct apetag *ape, char **val);
43 static inline void ape_free(struct apetag *ape)
45 free(ape->buf);
48 #endif