X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=attribute.c;h=48f108c7fe8be8a96ac6b4d77b7d7737bb46db1c;hp=e0e0bd867d6fc5e1de8259d21693800332798f38;hb=53d503ce;hpb=cc18590c9eeba5caef75e7d7ac495ac3dbf58c69 diff --git a/attribute.c b/attribute.c index e0e0bd86..48f108c7 100644 --- a/attribute.c +++ b/attribute.c @@ -7,9 +7,9 @@ /** \file attribute.c Attribute handling functions. */ #include "para.h" #include "error.h" +#include "string.h" #include "afh.h" #include "afs.h" -#include "string.h" #include "net.h" static struct osl_table *attribute_table; @@ -532,9 +532,9 @@ err: * * \sa osl_close_table(). */ -void attribute_shutdown(enum osl_close_flags flags) +void attribute_close(void) { - osl_close_table(attribute_table, flags); + osl_close_table(attribute_table, OSL_MARK_CLEAN); attribute_table = NULL; } @@ -548,13 +548,12 @@ void attribute_shutdown(enum osl_close_flags flags) * * \sa osl_open_table(). */ -int attribute_init(struct table_info *ti, const char *db) +static int attribute_open(const char *dir) { int ret; - attribute_table_desc.dir = db; - ti->desc = &attribute_table_desc; - ret = osl_open_table(ti->desc, &attribute_table); + attribute_table_desc.dir = dir; + ret = osl_open_table(&attribute_table_desc, &attribute_table); greatest_att_bitnum = -1; /* no atts available */ if (ret >= 0) { find_greatest_att_bitnum(); @@ -565,3 +564,18 @@ int attribute_init(struct table_info *ti, const char *db) return 1; return ret; } + +static int attribute_create(const char *dir) +{ + attribute_table_desc.dir = dir; + return osl_create_table(&attribute_table_desc); +} + + +void attribute_init(struct afs_table *t) +{ + t->name = attribute_table_desc.name; + t->open = attribute_open; + t->close = attribute_close; + t->create = attribute_create; +}