1
/* libc replacement functions for win32.
3
Copyright (C) 1998, 99 Free Software Foundation, Inc.
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public
16
License along with this library; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22
char *xstrdup(const char *s)
26
fprintf(stderr, "strdup(%x) failed in gnuw32.c at line %d\n", s, __LINE__);
32
void *xmalloc(unsigned size)
34
void *p = malloc(size);
36
fprintf(stderr, "malloc(%d) failed in gnuw32.c at line %d\n", size, __LINE__);
42
void *xrealloc(void *p, unsigned size)
46
fprintf(stderr, "realloc(%d) failed in gnuw32.c at line %d\n", size, __LINE__);
52
char *concat(const char *s1, const char *s2)
54
char *answer = (char *) xmalloc (strlen (s1) + strlen (s2) + 1);
61
char *concat3(const char *s1, const char *s2, const char *s3)
64
= (char *) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1);
72
char *concatn(const char *str1, ...)
83
va_start(marker, str1);
84
while ((arg = va_arg (marker, char*)) != NULL) {
90
ret = xmalloc(size + 1);
93
va_start(marker, str1);
94
while ((arg = va_arg (marker, char*)) != NULL) {