summaryrefslogtreecommitdiff
path: root/usr.bin/make/garray.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/make/garray.h')
-rw-r--r--usr.bin/make/garray.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.bin/make/garray.h b/usr.bin/make/garray.h
index 7cc3562b4b4..91d085e26f7 100644
--- a/usr.bin/make/garray.h
+++ b/usr.bin/make/garray.h
@@ -2,7 +2,7 @@
#define GARRAY_H
/* $OpenPackages$ */
-/* $OpenBSD: garray.h,v 1.3 2007/09/17 10:12:35 espie Exp $ */
+/* $OpenBSD: garray.h,v 1.4 2007/12/01 15:14:34 espie Exp $ */
/* Growable array implementation */
/*
@@ -60,6 +60,21 @@ do { \
(l)->a[(l)->n++] = (gn); \
} while (0)
+#define Array_Push(l, gn) Array_AtEnd(l, gn)
+
+#define Array_Pop(l) \
+ ((l)->n > 0 ? (l)->a[--(l)->n] : NULL)
+
+#define Array_PushNew(l, gn) \
+do { \
+ unsigned int i; \
+ for (i = 0; i < (l)->n; i++) \
+ if ((l)->a[i] == (gn)) \
+ break; \
+ if (i == (l)->n) \
+ Array_Push(l, gn); \
+} while (0)
+
#define Array_Find(l, func, v) \
do { \
unsigned int i; \