91 extern void expandargv
PARAMS((
int *,
char ***));
107 #if !HAVE_DECL_BASENAME
108 #if defined(__GNU_LIBRARY__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__MINGW32__) || defined(HAVE_DECL_BASENAME)
109 extern char *
basename(
const char *);
114 #define basename basename_cannot_be_used_without_a_prototype
180 #define ACONCAT(ACONCAT_PARAMS) \
181 (libiberty_concat_ptr = (char *)alloca(concat_length ACONCAT_PARAMS + 1), \
182 concat_copy2 ACONCAT_PARAMS)
191 #if defined(HAVE_DECL_FFS) && !HAVE_DECL_FFS
306 extern void *
xrealloc(
void *,
size_t);
330 extern unsigned int xcrc32(
const unsigned char *,
int,
unsigned int);
339 #define XALLOCA(T) ((T *)alloca(sizeof(T)))
340 #define XNEW(T) ((T *)xmalloc(sizeof(T)))
341 #define XCNEW(T) ((T *)xcalloc(1, sizeof(T)))
345 #define alloca(x) _alloca(x)
346 #define xmalloc malloc
347 #define xcalloc calloc
348 #define xrealloc realloc
350 #define XALLOCA(T) ((T *)alloca(sizeof(T)))
351 #define XNEW(T) ((T *)xmalloc(sizeof(T)))
352 #define XCNEW(T) ((T *)xcalloc(1, sizeof(T)))
353 #define XDUP(T, P) ((T *)xmemdup((P), sizeof(T), sizeof(T)))
354 #define XDELETE(P) free((void *)(P))
358 #define XALLOCAVEC(T, N) ((T *)alloca(sizeof(T) * (N)))
359 #define XNEWVEC(T, N) ((T *)xmalloc(sizeof(T) * (N)))
360 #define XCNEWVEC(T, N) ((T *)xcalloc((N), sizeof(T)))
361 #define XDUPVEC(T, P, N) ((T *)xmemdup((P), sizeof(T) * (N), sizeof(T) * (N)))
362 #define XRESIZEVEC(T, P, N) ((T *)xrealloc((void *)(P), sizeof(T) * (N)))
363 #define XDELETEVEC(P) free((void *)(P))
367 #define XALLOCAVAR(T, S) ((T *)alloca((S)))
368 #define XNEWVAR(T, S) ((T *)xmalloc((S)))
369 #define XCNEWVAR(T, S) ((T *)xcalloc(1, (S)))
370 #define XDUPVAR(T, P, S1, S2) ((T *)xmemdup((P), (S1), (S2)))
371 #define XRESIZEVAR(T, P, S) ((T *)xrealloc((P), (S)))
375 #define XOBNEW(O, T) ((T *)obstack_alloc((O), sizeof(T)))
376 #define XOBNEWVEC(O, T, N) ((T *)obstack_alloc((O), sizeof(T) * (N)))
377 #define XOBNEWVAR(O, T, S) ((T *)obstack_alloc((O), (S)))
378 #define XOBFINISH(O, T) ((T)obstack_finish((O)))
382 #define _hex_array_size 256
386 #define hex_p(c) (hex_value(c) != _hex_bad)
389 #define hex_value(c) ((unsigned int)_hex_value[(unsigned char)(c)])
394 #define PEX_RECORD_TIMES 0x1
397 #define PEX_USE_PIPES 0x2
400 #define PEX_SAVE_TEMPS 0x4
411 const char *tempbase);
423 #define PEX_SEARCH 0x2
426 #define PEX_SUFFIX 0x4
429 #define PEX_STDERR_TO_STDOUT 0x8
433 #define PEX_BINARY_INPUT 0x10
440 #define PEX_BINARY_OUTPUT 0x20
448 #define PEX_STDERR_TO_PIPE 0x40
452 #define PEX_BINARY_ERROR 0x80
505 const char *executable,
char *
const *
argv,
506 const char *outname,
const char *errname,
520 const char *executable,
524 const char *errname,
int *
err);
531 const char *in_name);
594 char *
const *
argv,
const char *pname,
595 const char *outname,
const char *errname,
604 #define PEXECUTE_FIRST 1
605 #define PEXECUTE_LAST 2
606 #define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
607 #define PEXECUTE_SEARCH 4
608 #define PEXECUTE_VERBOSE 8
612 extern int pexecute(
const char *,
char *
const *,
const char *,
613 const char *,
char **,
char **,
int);
619 #if !HAVE_DECL_ASPRINTF
626 #if !HAVE_DECL_VASPRINTF
633 #if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF
638 #if defined(HAVE_DECL_VSNPRINTF) && !HAVE_DECL_VSNPRINTF
643 #if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP
645 extern int strverscmp(
const char *,
const char *);
651 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
663 #if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
664 #define alloca(x) __builtin_alloca(x)
667 (__extension__({ const char *const libiberty_optr = (X); \
668 const unsigned long libiberty_len = strlen (libiberty_optr) + 1; \
669 char *const libiberty_nptr = (char *const) alloca (libiberty_len); \
670 (char *) memcpy (libiberty_nptr, libiberty_optr, libiberty_len); }))
672 #define alloca(x) _alloca(x)
674 #define USE_C_ALLOCA 1
681 (libiberty_optr = (X), \
682 libiberty_len = strlen(libiberty_optr) + 1, \
683 libiberty_nptr = (char *)alloca(libiberty_len), \
684 (char *)memcpy(libiberty_nptr, libiberty_optr, libiberty_len))
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec vector
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog gettimeofday
#define ATTRIBUTE_PRINTF_3
#define ATTRIBUTE_SENTINEL
#define ATTRIBUTE_PRINTF_2
#define ATTRIBUTE_NORETURN
#define ATTRIBUTE_PRINTF(m, n)
char * concat(const char *,...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL
void unlock_stream(FILE *)
FILE * pex_input_pipe(struct pex_obj *obj, int binary)
const char * strsigno(int)
FILE * pex_input_file(struct pex_obj *obj, int flags, const char *in_name)
void * xmemdup(const void *, size_t, size_t) ATTRIBUTE_MALLOC
char * xstrdup(const char *) ATTRIBUTE_MALLOC
void pex_free(struct pex_obj *)
void unlock_std_streams(void)
void expandargv PARAMS((int *, char ***))
char * xstrndup(const char *, size_t) ATTRIBUTE_MALLOC
const char * strerrno(int)
char * lrealpath(const char *)
const char * lbasename(const char *)
void * xrealloc(void *, size_t)
void * xcalloc(size_t, size_t) ATTRIBUTE_MALLOC
int strtosigno(const char *)
FILE * fdopen_unlocked(int, const char *)
void xmalloc_set_program_name(const char *)
struct pex_obj * pex_init(int flags, const char *pname, const char *tempbase)
void xmalloc_failed(size_t) ATTRIBUTE_NORETURN
char * reconcat(char *, const char *,...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL
int strtoerrno(const char *)
int pwait(int, int *, int)
char ** buildargv(const char *) ATTRIBUTE_MALLOC
int pex_get_status(struct pex_obj *, int count, int *vector)
char ** dupargv(char **) ATTRIBUTE_MALLOC
const char * spaces(int count)
int xatexit(void(*fn)(void))
FILE * fopen_unlocked(const char *, const char *)
char * make_temp_file(const char *) ATTRIBUTE_MALLOC
const char * libiberty_optr
double physmem_available(void)
int unlink_if_ordinary(const char *)
const char * pex_one(int flags, const char *executable, char *const *argv, const char *pname, const char *outname, const char *errname, int *status, int *err)
unsigned long libiberty_len
FILE * freopen_unlocked(const char *, const char *, FILE *)
void * xmalloc(size_t) ATTRIBUTE_MALLOC
char * libiberty_concat_ptr
const char * pex_run(struct pex_obj *obj, int flags, const char *executable, char *const *argv, const char *outname, const char *errname, int *err)
double physmem_total(void)
void xexit(int status) ATTRIBUTE_NORETURN
char * make_relative_prefix(const char *, const char *, const char *) ATTRIBUTE_MALLOC
unsigned long concat_length(const char *,...) ATTRIBUTE_SENTINEL
char * choose_temp_base(void) ATTRIBUTE_MALLOC
char * concat_copy2(const char *,...) ATTRIBUTE_SENTINEL
char * concat_copy(char *, const char *,...) ATTRIBUTE_SENTINEL
int pexecute(const char *, char *const *, const char *, const char *, char **, char **, int)
int pex_get_times(struct pex_obj *, int count, struct pex_time *vector)
int fdmatch(int fd1, int fd2)
const unsigned char _hex_value[_hex_array_size]
FILE * pex_read_output(struct pex_obj *, int binary)
static static fork const void static count static fd const char const char static newpath char char argv
static const char struct stat static buf struct stat static buf static idle const char static path static fd const char static len const void static prot const char struct module static image struct kernel_sym static table unsigned char static buf static fsuid unsigned struct dirent unsigned static count const struct iovec static count static pid const void static len static flags const struct sched_param static p static pid static policy struct timespec static tp static suid unsigned fn
static const char struct stat static buf struct stat static buf static vhangup int status
static struct sockaddr static addrlen static backlog const void static flags void flags
unsigned long user_microseconds
unsigned long user_seconds
unsigned long system_seconds
unsigned long system_microseconds
const char * pex_run_in_environment(struct pex_obj *obj, int flags, const char *executable, char *const *argv, char *const *env, const char *outname, const char *errname, int *err)
unsigned int xcrc32(const unsigned char *, int, unsigned int)
int void setproctitle(const char *name,...)
int vasprintf(char **, const char *, va_list) ATTRIBUTE_PRINTF(2
FILE * pex_read_err(struct pex_obj *, int binary)
void * _alloca(size_t) ATTRIBUTE_MALLOC
const char * dos_lbasename(const char *)
const char * unix_lbasename(const char *)
int asprintf(char **, const char *,...) ATTRIBUTE_PRINTF_2
char * make_relative_prefix_ignore_links(const char *, const char *, const char *) ATTRIBUTE_MALLOC
static char * binary(unsigned int val, unsigned int bits)