projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Strlist filter.
[apps/pfixtools.git]
/
common
/
array.h
diff --git
a/common/array.h
b/common/array.h
index
6cb7619
..
f1c6925
100644
(file)
--- a/
common/array.h
+++ b/
common/array.h
@@
-46,35
+46,40
@@
ssize_t len; \
ssize_t size; \
}
ssize_t len; \
ssize_t size; \
}
-#define ARRAY(Type) \
-
typedef PRIV_ARRAY(Type) Type ## _array_t;
\
+
+
#define PARRAY(Type)
\
typedef PRIV_ARRAY(Type*) Type ## _ptr_array_t; \
typedef PRIV_ARRAY(Type*) Type ## _ptr_array_t; \
- \
- static inline Type ## _array_t *Type ## _array_new(void) \
+ static inline Type ## _ptr_array_t *Type ## _ptr_array_new(void) \
{ \
{ \
- return p_new(Type ## _
array_t, 1);
\
+ return p_new(Type ## _
ptr_array_t, 1);
\
} \
\
} \
\
- static inline void Type ## _
array_delete(Type ## _array_t **array)
\
+ static inline void Type ## _
ptr_array_delete(Type ## _ptr_array_t **array)
\
{ \
if (*array) { \
array_wipe(**array); \
p_delete(array); \
} \
{ \
if (*array) { \
array_wipe(**array); \
p_delete(array); \
} \
- } \
+ }
+
+#define ARRAY(Type) \
+ typedef PRIV_ARRAY(Type) Type ## _array_t; \
\
\
- static inline Type ## _
ptr_array_t *Type ## _ptr_array_new(void)
\
+ static inline Type ## _
array_t *Type ## _array_new(void)
\
{ \
{ \
- return p_new(Type ## _
ptr_array_t, 1);
\
+ return p_new(Type ## _
array_t, 1);
\
} \
\
} \
\
- static inline void Type ## _
ptr_array_delete(Type ## _ptr_array_t **array)
\
+ static inline void Type ## _
array_delete(Type ## _array_t **array)
\
{ \
if (*array) { \
array_wipe(**array); \
p_delete(array); \
} \
{ \
if (*array) { \
array_wipe(**array); \
p_delete(array); \
} \
- }
+ } \
+ \
+ PARRAY(Type)
+
#define A(Type) Type ## _array_t
#define PA(Type) Type ## _ptr_array_t
#define A(Type) Type ## _array_t
#define PA(Type) Type ## _ptr_array_t
@@
-145,6
+150,7
@@
ARRAY(char)
ARRAY(int)
ARRAY(char)
ARRAY(int)
+ARRAY(bool)
ARRAY(uint32_t)
#endif
ARRAY(uint32_t)
#endif