Move *_offsetof() macro definitions to db.h

This commit is contained in:
Julien BLACHE
2009-06-11 23:17:17 +02:00
parent 1f92052409
commit e1c0b6d4b7
5 changed files with 11 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
#define __DB_H__
#include <time.h>
#include <stddef.h>
#include <stdint.h>
#include <sqlite3.h>
@@ -105,6 +105,8 @@ struct media_file_info {
char *album_artist;
};
#define mfi_offsetof(field) offsetof(struct media_file_info, field)
struct playlist_info {
uint32_t id; /* integer id (miid) */
char *title; /* playlist name as displayed in iTunes (minm) */
@@ -117,6 +119,8 @@ struct playlist_info {
uint32_t index; /* index of playlist for paths with multiple playlists */
};
#define pli_offsetof(field) offsetof(struct playlist_info, field)
struct db_playlist_info {
char *id;
char *title;
@@ -129,6 +133,8 @@ struct db_playlist_info {
char *index;
};
#define dbpli_offsetof(field) offsetof(struct db_playlist_info, field)
struct db_media_file_info {
char *id;
char *path;
@@ -174,6 +180,8 @@ struct db_media_file_info {
char *album_artist;
};
#define dbmfi_offsetof(field) offsetof(struct db_media_file_info, field)
struct watch_info {
int wd;
char *path;
@@ -181,6 +189,8 @@ struct watch_info {
int libidx;
};
#define wi_offsetof(field) offsetof(struct watch_info, field)
struct watch_enum {
uint32_t cookie;
char *match;