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; \
- \
- 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); \
} \
- } \
+ }
+
+#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); \
} \
- }
+ } \
+ \
+ PARRAY(Type)
+
#define A(Type) Type ## _array_t
#define PA(Type) Type ## _ptr_array_t
} while (0)
#define array_lock(array) \
- !(mlock((array).data, (array).len * sizeof(*(array).data)) != 0)
+ (mlock((array).data, (array).len * sizeof(*(array).data)) == 0)
#define array_unlock(array) \
(void)munlock((array).data, (array).len * sizeof(*(array).data))
ARRAY(char)
ARRAY(int)
+ARRAY(bool)
ARRAY(uint32_t)
+PARRAY(void)
+
#endif