X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=c63ab47106866dd5caa9e99062377c742b999a68;hp=5112affacdcd29ebcaf51b82eb9d6980035d5f88;hb=53d503ce;hpb=cc18590c9eeba5caef75e7d7ac495ac3dbf58c69 diff --git a/aft.c b/aft.c index 5112affa..c63ab471 100644 --- a/aft.c +++ b/aft.c @@ -8,12 +8,12 @@ #include "para.h" #include "error.h" +#include "string.h" #include #include #include "afh.h" #include "afs.h" #include "net.h" -#include "string.h" #include "vss.h" static struct osl_table *audio_file_table; @@ -2182,29 +2182,27 @@ int aft_check_callback(__a_unused const struct osl_object *query, struct osl_obj * * \sa osl_close_table(). */ -void aft_shutdown(enum osl_close_flags flags) +static void aft_close(void) { - osl_close_table(audio_file_table, flags); + osl_close_table(audio_file_table, OSL_MARK_CLEAN); audio_file_table = NULL; } /** * Open the audio file table. * - * \param ti Gets initialized by this function. - * \param db The database directory. + * \param dir The database directory. * - * \return Positive on success, negative on errors. + * \return Standard. * * \sa osl_open_table(). */ -int aft_init(struct table_info *ti, const char *db) +static int aft_open(const char *dir) { int ret; - audio_file_table_desc.dir = db; - ti->desc = &audio_file_table_desc; - ret = osl_open_table(ti->desc, &audio_file_table); + audio_file_table_desc.dir = dir; + ret = osl_open_table(&audio_file_table_desc, &audio_file_table); if (ret >= 0) { unsigned num; osl_get_num_rows(audio_file_table, &num); @@ -2217,3 +2215,17 @@ int aft_init(struct table_info *ti, const char *db) return 1; return ret; } + +static int aft_create(const char *dir) +{ + audio_file_table_desc.dir = dir; + return osl_create_table(&audio_file_table_desc); +} + +void aft_init(struct afs_table *t) +{ + t->name = audio_file_table_desc.name; + t->open = aft_open; + t->close = aft_close; + t->create = aft_create; +}