aboutsummaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'object.h')
-rw-r--r--object.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/object.h b/object.h
index 97d384b80..0d39ff4f9 100644
--- a/object.h
+++ b/object.h
@@ -85,6 +85,17 @@ int object_list_contains(struct object_list *list, struct object *obj);
/* Object array handling .. */
void add_object_array(struct object *obj, const char *name, struct object_array *array);
void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode);
+
+typedef int (*object_array_each_func_t)(struct object_array_entry *, void *);
+
+/*
+ * Apply want to each entry in array, retaining only the entries for
+ * which the function returns true. Preserve the order of the entries
+ * that are retained.
+ */
+void object_array_filter(struct object_array *array,
+ object_array_each_func_t want, void *cb_data);
+
void object_array_remove_duplicates(struct object_array *);
void clear_object_flags(unsigned flags);