Use an enum for DMAP types

This commit is contained in:
Julien BLACHE 2010-02-08 14:35:29 +01:00
parent 42dd7ddd00
commit d4fb2091c8
2 changed files with 13 additions and 11 deletions

View File

@ -4,16 +4,18 @@
#include <event.h> #include <event.h>
#define DMAP_TYPE_BYTE 0x01 enum dmap_type
#define DMAP_TYPE_UBYTE 0x02 {
#define DMAP_TYPE_SHORT 0x03 DMAP_TYPE_BYTE = 0x01,
#define DMAP_TYPE_INT 0x05 DMAP_TYPE_UBYTE = 0x02,
#define DMAP_TYPE_LONG 0x07 DMAP_TYPE_SHORT = 0x03,
#define DMAP_TYPE_STRING 0x09 DMAP_TYPE_INT = 0x05,
#define DMAP_TYPE_DATE 0x0a DMAP_TYPE_LONG = 0x07,
#define DMAP_TYPE_VERSION 0x0b DMAP_TYPE_STRING = 0x09,
#define DMAP_TYPE_LIST 0x0c DMAP_TYPE_DATE = 0x0a,
DMAP_TYPE_VERSION = 0x0b,
DMAP_TYPE_LIST = 0x0c,
};
void void
dmap_add_container(struct evbuffer *evbuf, char *tag, int len); dmap_add_container(struct evbuffer *evbuf, char *tag, int len);

View File

@ -67,7 +67,7 @@ struct daap_update_request {
struct dmap_field_map { struct dmap_field_map {
uint32_t hash; uint32_t hash;
short type; enum dmap_type type;
char *tag; char *tag;
char *desc; char *desc;
ssize_t mfi_offset; ssize_t mfi_offset;