/** \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;
*
* \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;
}
*
* \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();
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;
+}