X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=blob.c;h=f0133c3b5d53b7c916f1662b158ac5073a74af8f;hp=6f10f0a2a02e7bb4ccbbebe7307bad007386bccf;hb=702d72b58b6378c4cdb37cbb709fd1d351571123;hpb=8ea8abb73199b32fdd7afdf8825afa42ed8de244 diff --git a/blob.c b/blob.c index 6f10f0a2..f0133c3b 100644 --- a/blob.c +++ b/blob.c @@ -64,6 +64,24 @@ static struct osl_column_description blob_cols[] = { } }; +/** 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); @@ -622,7 +640,6 @@ static int blob_open(struct osl_table **table, #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;\