X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=blob.c;h=44159a6fecf7f16f7fd9548003f2b3df90a77367;hp=126cab43e6a9aa3a37248dbede7ad50d62daadc1;hb=d5538ff0dd9f6531a1a319b49c32bd72597fb2c3;hpb=1e89a35b86480c4bbcb143e88417707e15217f1a diff --git a/blob.c b/blob.c index 126cab43..44159a6f 100644 --- a/blob.c +++ b/blob.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 Andre Noll + * Copyright (C) 2007-2010 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -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); @@ -581,7 +599,7 @@ static int blob_get_name_and_def_by_row(struct osl_table *table, /** 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; \ @@ -589,7 +607,7 @@ static int blob_get_name_and_def_by_row(struct osl_table *table, /** 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); \ @@ -611,7 +629,7 @@ static int blob_open(struct osl_table **table, } #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); \