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. */
21 #include <kpathsea/config.h>
23 #include <kpathsea/c-proto.h>
24 #include <kpathsea/win32lib.h>
25 #include <kpathsea/lib.h>
27 char *xstrdup(const char *s)
31 fprintf(stderr, "strdup(%x) failed in gnuw32.c at line %d\n", s, __LINE__);
37 void *xmalloc(unsigned size)
39 void *p = malloc(size);
41 fprintf(stderr, "malloc(%d) failed in gnuw32.c at line %d\n", size, __LINE__);
47 void *xrealloc(void *p, unsigned size)
51 fprintf(stderr, "realloc(%d) failed in gnuw32.c at line %d\n", size, __LINE__);
57 char *concat(const char *s1, const char *s2)
59 char *answer = (char *) xmalloc (strlen (s1) + strlen (s2) + 1);
66 char *concat3(const char *s1, const char *s2, const char *s3)
69 = (char *) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1);
77 char *concatn(const char *str1, ...)
86 va_start(marker, str1);
87 while ((arg = va_arg (marker, char*)) != NULL) {
96 va_start(marker, str1);
97 while ((arg = va_arg (marker, char*)) != NULL) {