summaryrefslogtreecommitdiffstats
path: root/lib/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vector.h')
-rw-r--r--lib/vector.h39
1 files changed, 19 insertions, 20 deletions
diff --git a/lib/vector.h b/lib/vector.h
index ab1d1e6aa..91f7d997d 100644
--- a/lib/vector.h
+++ b/lib/vector.h
@@ -25,11 +25,10 @@
#include "memory.h"
/* struct for vector */
-struct _vector
-{
- unsigned int active; /* number of active slots */
- unsigned int alloced; /* number of allocated slot */
- void **index; /* index to data */
+struct _vector {
+ unsigned int active; /* number of active slots */
+ unsigned int alloced; /* number of allocated slot */
+ void **index; /* index to data */
};
typedef struct _vector *vector;
@@ -39,26 +38,26 @@ typedef struct _vector *vector;
array expression. */
/* Reference slot at given index, caller must ensure slot is active */
#define vector_slot(V,I) ((V)->index[(I)])
-/* Number of active slots.
+/* Number of active slots.
* Note that this differs from vector_count() as it the count returned
* will include any empty slots
*/
#define vector_active(V) ((V)->active)
/* Prototypes. */
-extern vector vector_init (unsigned int size);
-extern void vector_ensure (vector v, unsigned int num);
-extern int vector_empty_slot (vector v);
-extern int vector_set (vector v, void *val);
-extern int vector_set_index (vector v, unsigned int i, void *val);
-extern void vector_unset (vector v, unsigned int i);
-extern void vector_unset_value (vector v, void *val);
-
-extern unsigned int vector_count (vector v);
-extern void vector_free (vector v);
-extern vector vector_copy (vector v);
-
-extern void *vector_lookup (vector, unsigned int);
-extern void *vector_lookup_ensure (vector, unsigned int);
+extern vector vector_init(unsigned int size);
+extern void vector_ensure(vector v, unsigned int num);
+extern int vector_empty_slot(vector v);
+extern int vector_set(vector v, void *val);
+extern int vector_set_index(vector v, unsigned int i, void *val);
+extern void vector_unset(vector v, unsigned int i);
+extern void vector_unset_value(vector v, void *val);
+
+extern unsigned int vector_count(vector v);
+extern void vector_free(vector v);
+extern vector vector_copy(vector v);
+
+extern void *vector_lookup(vector, unsigned int);
+extern void *vector_lookup_ensure(vector, unsigned int);
#endif /* _ZEBRA_VECTOR_H */