glib-aux: add NM_STRV_EMPTY() helper

NM_PTRARRAY_EMPTY(char*) gives a "char *const*" pointer,
which is often not useful where a strv array is needed.
Add a helper macro.
This commit is contained in:
Thomas Haller
2021-05-07 23:07:14 +02:00
parent b5c5b2443d
commit 62027350f7

View File

@@ -522,6 +522,7 @@ gboolean nm_utils_memeqzero(gconstpointer data, gsize length);
extern const void *const _NM_PTRARRAY_EMPTY[1];
#define NM_PTRARRAY_EMPTY(type) ((type const *) _NM_PTRARRAY_EMPTY)
#define NM_STRV_EMPTY() ((char **) _NM_PTRARRAY_EMPTY)
static inline void
_nm_utils_strbuf_init(char *buf, gsize len, char **p_buf_ptr, gsize *p_buf_len)