diff options
author | 2011-09-27 18:37:22 +0000 | |
---|---|---|
committer | 2011-09-27 18:37:22 +0000 | |
commit | 0e1c701519303d513ec57c2f7cceb49f9fcb5d55 (patch) | |
tree | 60f47bbbdf98d19b8d9281b16c1ebcfff50ce454 /xfuncs.h | |
parent | constify the return of scanelf_file_{sections,sym} (diff) | |
download | pax-utils-0e1c701519303d513ec57c2f7cceb49f9fcb5d55.tar.gz pax-utils-0e1c701519303d513ec57c2f7cceb49f9fcb5d55.tar.bz2 pax-utils-0e1c701519303d513ec57c2f7cceb49f9fcb5d55.zip |
allow people to search for multiple libraries (-N) or data sections (-k)
Diffstat (limited to 'xfuncs.h')
-rw-r--r-- | xfuncs.h | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* * Copyright 2003-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/xfuncs.h,v 1.4 2009/12/03 04:15:54 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/xfuncs.h,v 1.5 2011/09/27 18:37:22 vapier Exp $ * * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> @@ -18,4 +18,19 @@ void xstrncat(char **dst, const char *src, size_t *curr_len, size_t n); #define xstrcat(dst,src,curr_len) xstrncat(dst,src,curr_len,0) void xchrcat(char **dst, const char append, size_t *curr_len); +void *xmemdup(const void *src, size_t n); + +typedef struct { + void **eles; + size_t num; +} array_t; +void xarraypush(array_t *array, const void *ele, size_t ele_len); +void xarrayfree(array_t *array); +#define xrealloc_array(ptr, size, ele_size) xrealloc(ptr, (size) * (ele_size)) +#define array_for_each(arr, n, ele) \ + for (n = 0, ele = arr->eles[n]; n < arr->num; ++n, ele = arr->eles[n]) +#define array_init_decl { .eles = NULL, .num = 0, } +#define array_cnt(arr) (arr)->num +char *array_flatten_str(array_t *array); + #endif |