}
};
+/** Define an osl table description for a blob table. */
+#define DEFINE_BLOB_TABLE_DESC(table_name) \
+ struct osl_table_description table_name ## _table_desc = { \
+ .name = #table_name, \
+ .num_columns = NUM_BLOB_COLUMNS, \
+ .flags = OSL_LARGE_TABLE, \
+ .column_descriptions = blob_cols \
+ };
+
+/** Define a pointer to an osl blob table with a canonical name. */
+#define DEFINE_BLOB_TABLE_PTR(table_name) struct osl_table *table_name ## _table;
+
+
+/** Define a blob table. */
+#define INIT_BLOB_TABLE(table_name) \
+ DEFINE_BLOB_TABLE_DESC(table_name); \
+ DEFINE_BLOB_TABLE_PTR(table_name);
+
/** \cond doxygen isn't smart enough to recognize these */
INIT_BLOB_TABLE(lyrics);
INIT_BLOB_TABLE(images);
/** Define the \p close function for this blob type. */
#define DEFINE_BLOB_CLOSE(table_name) \
- void table_name ## _close(void) \
+ static void table_name ## _close(void) \
{ \
osl_close_table(table_name ## _table, OSL_MARK_CLEAN); \
table_name ## _table = NULL; \
/** Define the \p create function for this blob type. */
#define DEFINE_BLOB_CREATE(table_name) \
- int table_name ## _create(const char *dir) \
+ static int table_name ## _create(const char *dir) \
{ \
table_name ## _table_desc.dir = dir; \
return osl_create_table(&table_name ## _table_desc); \
}
#define DEFINE_BLOB_OPEN(table_name) \
- int table_name ## _open(const char *dir) \
+ static int table_name ## _open(const char *dir) \
{ \
return blob_open(&table_name ## _table, \
&table_name ## _table_desc, dir); \
#define DEFINE_BLOB_INIT(table_name) \
void table_name ## _init(struct afs_table *t) \
{ \
- t->name = table_name ## _table_desc.name; \
t->open = table_name ## _open; \
t->close = table_name ## _close; \
t->create = table_name ## _create;\