+ ret = send_standard_callback_request(argc - 1, argv + 1, com_addatt_callback,
+ &result);
+ if (!ret)
+ return 1;
+ if (ret < 0)
+ return ret;
+ if (!result.data || !result.size)
+ return 1;
+ ret = send_va_buffer(fd, "%s", (char *) result.data);
+ free(result.data);
+ return ret;
+}
+
+struct remove_attribute_action_data {
+ struct para_buffer pb;
+ int num_removed;
+ uint64_t mask_of_removed_atts;
+};
+
+static int remove_attribute(struct osl_table *table, struct osl_row *row,
+ const char *name, void *data)
+{
+ struct remove_attribute_action_data *raad = data;
+ unsigned char bitnum;
+ int ret;
+
+ ret = get_attribute_bitnum_by_name(name, &bitnum);
+ if (ret < 0) {
+ para_printf(&raad->pb, "%s: %s\n", name, PARA_STRERROR(-ret));
+ return 1;
+ }
+ ret = osl_del_row(table, row);
+ if (ret < 0) {
+ para_printf(&raad->pb, "%s: %s\n", name, PARA_STRERROR(-ret));
+ return 1;
+ }
+ para_printf(&raad->pb, "removed %s\n", name);
+ raad->num_removed++;
+ raad->mask_of_removed_atts |= (1 << bitnum);
+ return 1;