Replace struct table_info by struct afs_table.
[paraslash.git] / attribute.c
index e0e0bd867d6fc5e1de8259d21693800332798f38..48f108c7fe8be8a96ac6b4d77b7d7737bb46db1c 100644 (file)
@@ -7,9 +7,9 @@
 /** \file attribute.c Attribute handling functions. */
 #include "para.h"
 #include "error.h"
 /** \file attribute.c Attribute handling functions. */
 #include "para.h"
 #include "error.h"
+#include "string.h"
 #include "afh.h"
 #include "afs.h"
 #include "afh.h"
 #include "afs.h"
-#include "string.h"
 #include "net.h"
 
 static struct osl_table *attribute_table;
 #include "net.h"
 
 static struct osl_table *attribute_table;
@@ -532,9 +532,9 @@ err:
  *
  * \sa osl_close_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;
 }
 
        attribute_table = NULL;
 }
 
@@ -548,13 +548,12 @@ void attribute_shutdown(enum osl_close_flags flags)
  *
  * \sa osl_open_table().
  */
  *
  * \sa osl_open_table().
  */
-int attribute_init(struct table_info *ti, const char *db)
+static int attribute_open(const char *dir)
 {
        int ret;
 
 {
        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();
        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;
 }
                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;
+}