61 val = realloc (ptr, size);
77 if (number == 0 || size == 0)
83 mem = calloc (number, size);
112 va_start (args, format);
122 int status = vasprintf (&ret, format, ap);
128 if (ret == NULL || status < 0)
139 va_start (args, format);
140 ret = vsnprintf (str, size, format, args);
150 char *p = (
char *)
xmalloc (len + 1);
152 memcpy (p, ptr, len);
160 #define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
168 if (!isalnum (digit))
171 return (isdigit (digit) && digit < base +
'0');
173 return (isdigit (digit) || tolower (digit) < base - 10 +
'a');
182 return tolower (c) -
'a' + 10;
188 strtoulst (
const char *num,
const char **trailer,
int base)
190 unsigned int high_part;
196 while (isspace (num[i]))
202 else if (num[i] ==
'-')
208 if (base == 0 || base == 16)
210 if (num[i] ==
'0' && (num[i + 1] ==
'x' || num[i + 1] ==
'X'))
218 if (base == 0 && num[i] ==
'0')
224 if (base < 2 || base > 36)
230 result = high_part = 0;
236 if (high_part > 0xff)
263 while (*chp && isspace (*chp))
275 while (*chp && isspace (*chp))
287 while (*chp && !isspace (*chp))
char * xstrvprintf(const char *format, va_list ap)
static int digit_to_int(unsigned char c)
static int is_digit_in_base(unsigned char digit, int base)
const char * skip_to_space_const(const char *chp)
void internal_error(const char *file, int line, const char *fmt,...)
char * skip_spaces(char *chp)
void * xzalloc(size_t size)
const char * skip_spaces_const(const char *chp)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
ULONGEST strtoulst(const char *num, const char **trailer, int base)
char * xstrprintf(const char *format,...)
PTR xrealloc(PTR ptr, size_t size)
const char const char int
int xsnprintf(char *str, size_t size, const char *format,...)
unsigned long long ULONGEST
char * savestring(const char *ptr, size_t len)
PTR xcalloc(size_t number, size_t size)
void malloc_failure(long size) ATTRIBUTE_NORETURN
const ULONGEST const LONGEST len