]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - attribute.c
time.c: Add GPL header and improve documentation.
[paraslash.git] / attribute.c
index 86fc36d7615f2f7f702126015eb8176540fcce37..f33987271d7b5352c03a9eddbf8438da8cbe505f 100644 (file)
@@ -37,8 +37,7 @@ static struct osl_column_description att_cols[] = {
        }
 };
 
-static const struct osl_table_description attribute_table_desc = {
-       .dir = DATABASE_DIR,
+static struct osl_table_description attribute_table_desc = {
        .name = "attributes",
        .num_columns = NUM_ATT_COLUMNS,
        .flags = 0,
@@ -107,7 +106,7 @@ static int log_attribute(struct osl_row *row, void *private_data)
 }
 
 /* FIXME: Need callback */
-int com_lsatt(int fd, int argc, const char **argv)
+int com_lsatt(int fd, int argc, char * const * const argv)
 {
        struct private_laa_data pld = {.fd = fd, .flags = 0};
        int i;
@@ -174,7 +173,8 @@ static int com_setatt_callback(const struct osl_object *query,
        }
        if (!add_mask && !del_mask)
                return -E_ATTR_SYNTAX;
-       PARA_DEBUG_LOG("masks: %llx:%llx\n", add_mask, del_mask);
+       PARA_DEBUG_LOG("masks: %llx:%llx\n",(long long unsigned)add_mask,
+               (long long unsigned)del_mask);
        for (; p < (char *)query->data + query->size; p += len + 1) { /* TODO: fnmatch */
                struct afs_info old_afsi, new_afsi;
                struct osl_row *aft_row;
@@ -200,7 +200,7 @@ static int com_setatt_callback(const struct osl_object *query,
        return 1;
 }
 
-int com_setatt(__a_unused int fd, int argc, const char **argv)
+int com_setatt(__a_unused int fd, int argc, char * const * const argv)
 {
        if (argc < 2)
                return -E_ATTR_SYNTAX;
@@ -276,7 +276,7 @@ static int com_addatt_callback(const struct osl_object *query,
        return mood_reload();
 }
 
-int com_addatt(__a_unused int fd, int argc, const char **argv)
+int com_addatt(__a_unused int fd, int argc, char * const * const argv)
 {
        if (argc < 2)
                return -E_ATTR_SYNTAX;
@@ -311,7 +311,7 @@ static int com_rmatt_callback(const struct osl_object *query,
        return mood_reload();
 }
 
-int com_rmatt(__a_unused int fd, int argc, const char **argv)
+int com_rmatt(__a_unused int fd, int argc, char * const * const argv)
 {
        if (argc < 2)
                return -E_ATTR_SYNTAX;
@@ -377,12 +377,14 @@ err:
 void attribute_shutdown(enum osl_close_flags flags)
 {
        osl_close_table(attribute_table, flags);
+       attribute_table = NULL;
 }
 
-int attribute_init(struct table_info *ti)
+int attribute_init(struct table_info *ti, const char *db)
 {
        int ret;
 
+       attribute_table_desc.dir = db;
        ti->desc = &attribute_table_desc;
        ret = osl_open_table(ti->desc, &ti->table);
        greatest_att_bitnum = -1; /* no atts available */