}
return 1;
}
-
-/**
- * Dummy event handler for the images table.
- *
- * \param event Unused.
- * \param pb Unused.
- * \param data Unused.
- *
- * \return The images table does not honor events, so this handler always
- * returns success.
- */
-__a_const int images_event_handler(__a_unused enum afs_events event,
- __a_unused struct para_buffer *pb, __a_unused void *data)
-{
- return 1;
-}
-
-/**
- * Dummy event handler for the lyrics table.
- *
- * \param event Unused.
- * \param pb Unused.
- * \param data Unused.
- *
- * \return The lyrics table does not honor events, so this handler always
- * returns success.
- */
-__a_const int lyrics_event_handler(__a_unused enum afs_events event,
- __a_unused struct para_buffer *pb, __a_unused void *data)
-{
- return 1;
-}
}
/** Blob tables map integers to blobs. */
-#define DEFINE_BLOB_AFS_TABLE_OPS(table_name) \
+#define DEFINE_BLOB_AFS_TABLE_OPS(table_name, ehandler) \
const struct afs_table_operations table_name ## _ops = { \
.open = table_name ## _open, \
.close = table_name ## _close, \
.create = table_name ## _create, \
- .event_handler = table_name ##_event_handler, \
+ .event_handler = ehandler, \
};
/** Define all functions for this blob type. */
-#define DEFINE_BLOB_FUNCTIONS(table_name, short_name, c_short_name) \
+#define DEFINE_BLOB_FUNCTIONS(table_name, short_name, c_short_name, ehandler) \
DEFINE_BLOB_OPEN(table_name) \
DEFINE_BLOB_CLOSE(table_name) \
DEFINE_BLOB_CREATE(table_name) \
- DEFINE_BLOB_AFS_TABLE_OPS(table_name) \
+ DEFINE_BLOB_AFS_TABLE_OPS(table_name, ehandler) \
DEFINE_BLOB_COMMAND(ls, LS, table_name, short_name, c_short_name) \
DEFINE_BLOB_COMMAND(cat, CAT, table_name, short_name, c_short_name) \
DEFINE_BLOB_COMMAND(add, ADD, table_name, short_name, c_short_name) \
/* doxygen isn't smart enough to recognize these */
/** \cond blob_function */
-DEFINE_BLOB_FUNCTIONS(lyrics, lyr, LYR);
-DEFINE_BLOB_FUNCTIONS(images, img, IMG);
-DEFINE_BLOB_FUNCTIONS(moods, mood, MOOD);
-DEFINE_BLOB_FUNCTIONS(playlists, pl, PL);
+DEFINE_BLOB_FUNCTIONS(lyrics, lyr, LYR, NULL);
+DEFINE_BLOB_FUNCTIONS(images, img, IMG, NULL);
+DEFINE_BLOB_FUNCTIONS(moods, mood, MOOD, moods_event_handler);
+DEFINE_BLOB_FUNCTIONS(playlists, pl, PL, playlists_event_handler);
/** \endcond blob_function */