[P4W-posixcvs] cygwin/libiberty snprintf.c,NONE,1.1.2.1 stpcpy.c,NONE,1.1.2.1 stpncpy.c,NONE,1.1.2.1
Status: Pre-Alpha
Brought to you by:
earnie
Update of /cvsroot/p4w/cygwin/libiberty In directory sc8-pr-cvs1:/tmp/cvs-serv17902/libiberty Modified Files: Tag: p4wposix ChangeLog Makefile.in argv.c calloc.c config.in configure configure.in copysign.c floatformat.c functions.texi getcwd.c getopt.c hashtab.c maint-tool memchr.c memcmp.c memcpy.c memmove.c memset.c regex.c rename.c sigsetmask.c strcasecmp.c strdup.c strncasecmp.c strncmp.c strsignal.c strstr.c vfprintf.c vprintf.c vsprintf.c xatexit.c xmalloc.c Added Files: Tag: p4wposix snprintf.c stpcpy.c stpncpy.c vsnprintf.c Log Message: Sync with HEAD --- NEW FILE: snprintf.c --- /* Implement the snprintf function. Copyright (C) 2003 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <gh...@ca...>. This file is part of the libiberty library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* @deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...) This function is similar to sprintf, but it will print at most @var{n} characters. On error the return value is -1, otherwise it returns the number of characters that would have been printed had @var{n} been sufficiently large, regardless of the actual value of @var{n}. Note some pre-C99 system libraries do not implement this correctly so users cannot generally rely on the return value if the system version of this function is used. @end deftypefn */ #include "ansidecl.h" #ifdef ANSI_PROTOTYPES #include <stdarg.h> #include <stddef.h> #else #include <varargs.h> #define size_t unsigned long #endif int vsnprintf PARAMS ((char *, size_t, const char *, va_list)); int snprintf VPARAMS ((char *s, size_t n, const char *format, ...)) { int result; VA_OPEN (ap, format); VA_FIXEDARG (ap, char *, s); VA_FIXEDARG (ap, size_t, n); VA_FIXEDARG (ap, const char *, format); result = vsnprintf (s, n, format, ap); VA_CLOSE (ap); return result; } --- NEW FILE: stpcpy.c --- /* Implement the stpcpy function. Copyright (C) 2003 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <gh...@ca...>. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* @deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src}) Copies the string @var{src} into @var{dst}. Returns a pointer to @var{dst} + strlen(@var{src}). @end deftypefn */ #include <ansidecl.h> #ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long #endif extern size_t strlen PARAMS ((const char *)); extern PTR memcpy PARAMS ((PTR, const PTR, size_t)); char * stpcpy (dst, src) char *dst; const char *src; { const size_t len = strlen (src); return (char *) memcpy (dst, src, len + 1) + len; } --- NEW FILE: stpncpy.c --- /* Implement the stpncpy function. Copyright (C) 2003 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <gh...@ca...>. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* @deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, size_t @var{len}) Copies the string @var{src} into @var{dst}, copying exactly @var{len} and padding with zeros if necessary. If @var{len} < strlen(@var{src}) then return @var{dst} + @var{len}, otherwise returns @var{dst} + strlen(@var{src}). @end deftypefn */ #include <ansidecl.h> #ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long #endif extern size_t strlen PARAMS ((const char *)); extern char *strncpy PARAMS ((char *, const char *, size_t)); char * stpncpy (dst, src, len) char *dst; const char *src; size_t len; { size_t n = strlen (src); if (n > len) n = len; return strncpy (dst, src, len) + n; } --- NEW FILE: vsnprintf.c --- /* Implement the vsnprintf function. Copyright (C) 2003 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <gh...@ca...>. This file is part of the libiberty library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* @deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, va_list @var{ap}) This function is similar to vsprintf, but it will print at most @var{n} characters. On error the return value is -1, otherwise it returns the number of characters that would have been printed had @var{n} been sufficiently large, regardless of the actual value of @var{n}. Note some pre-C99 system libraries do not implement this correctly so users cannot generally rely on the return value if the system version of this function is used. @end deftypefn */ #include "config.h" #include "ansidecl.h" #ifdef ANSI_PROTOTYPES #include <stdarg.h> #else #include <varargs.h> #endif #ifdef HAVE_STRING_H #include <string.h> #endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif #include "libiberty.h" /* This implementation relies on a working vasprintf. */ int vsnprintf (s, n, format, ap) char * s; size_t n; const char *format; va_list ap; { char *buf = 0; int result = vasprintf (&buf, format, ap); if (!buf) return -1; if (result < 0) { free (buf); return -1; } result = strlen (buf); if (n > 0) { strncpy (s, buf, n); if (n - 1 < (size_t) result) s[n - 1] = 0; } free (buf); return result; } #ifdef TEST /* Set the buffer to a known state. */ #define CLEAR(BUF) do { memset ((BUF), 'X', sizeof (BUF)); (BUF)[14] = '\0'; } while (0) /* For assertions. */ #define VERIFY(P) do { if (!(P)) abort(); } while (0) static int ATTRIBUTE_PRINTF_3 checkit VPARAMS ((char *s, size_t n, const char *format, ...)) { int result; VA_OPEN (ap, format); VA_FIXEDARG (ap, char *, s); VA_FIXEDARG (ap, size_t, n); VA_FIXEDARG (ap, const char *, format); result = vsnprintf (s, n, format, ap); VA_CLOSE (ap); return result; } extern int main PARAMS ((void)); int main () { char buf[128]; int status; CLEAR (buf); status = checkit (buf, 10, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "foobar:9") == 0); CLEAR (buf); status = checkit (buf, 9, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "foobar:9") == 0); CLEAR (buf); status = checkit (buf, 8, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "foobar:") == 0); CLEAR (buf); status = checkit (buf, 7, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "foobar") == 0); CLEAR (buf); status = checkit (buf, 6, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "fooba") == 0); CLEAR (buf); status = checkit (buf, 2, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "f") == 0); CLEAR (buf); status = checkit (buf, 1, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "") == 0); CLEAR (buf); status = checkit (buf, 0, "%s:%d", "foobar", 9); VERIFY (status==8 && strcmp (buf, "XXXXXXXXXXXXXX") == 0); return 0; } #endif /* TEST */ Index: ChangeLog =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/ChangeLog,v retrieving revision 1.1.1.1.2.3 retrieving revision 1.1.1.1.2.4 diff -C2 -d -r1.1.1.1.2.3 -r1.1.1.1.2.4 *** ChangeLog 21 Mar 2003 18:56:09 -0000 1.1.1.1.2.3 --- ChangeLog 18 Apr 2003 20:27:37 -0000 1.1.1.1.2.4 *************** *** 1,2 **** --- 1,93 ---- + 2003-04-16 Kaveh R. Ghazi <gh...@ca...> + + * configure.in (funcs, AC_CHECK_FUNCS): Add snprintf and + vsnprintf. + * snprintf.c, vsnprintf.c: New files. + * Makefile.in (CFILES): Add snprintf.c and vsnprintf.c. + (CONFIGURED_OFILES): Add snprintf.o and vsnprintf.o. + Regenerate dependencies. + + * functions.texi, configure, config.in: Regenerated. + + 2003-04-15 Kaveh R. Ghazi <gh...@ca...> + + * mempcpy.c, stpcpy.c, stpncpy.c: New files. + * configure.in (funcs, AC_CHECK_FUNCS): Add mempcpy, stpcpy + and stpncpy. + * Makefile.in (CFILES): Add mempcpy.c, stpcpy.c and stpncpy.c. + (CONFIGURED_OFILES): Add mempcpy.o, stpcpy.o and stpncpy.o. + Regenerate dependencies. + + * functions.texi, configure, config.in: Regenerated. + + 2003-04-15 Kaveh R. Ghazi <gh...@ca...> + + * argv.c: Fix comments. + * calloc.c: Don't unnecessarily include "libiberty.h". + (bzero): Add prototype. + * floatformat.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES. + * getcwd.c (getcwd): Use standard definition to avoid conflicts + with system headers. + * hashtab.c (htab_traverse): Delete unused variables. + * rename.c: Include "ansidecl.h". + (rename): Use standard definition to avoid conflicts with system + headers. + * strsignal.c: Rely on ANSI_PROTOTYPES. + * strstr.c: Check GNUC >= 2, not GNUC == 2. + * vfprintf.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES. + * vprintf.c: Include "ansidecl.h" earlier, rely on + ANSI_PROTOTYPES. + * vsprintf.c: Include "ansidecl.h" earlier, rely on + ANSI_PROTOTYPES and possibly include <stdarg.h>. + + * Makefile.in: Regenerate dependencies. + + 2003-04-15 DJ Delorie <dj...@re...> + + * maint-tool (deps): Scan for headers in $srcdir also. + + 2003-04-15 Kaveh R. Ghazi <gh...@ca...> + + PR target/10338 + PR bootstrap/10198 + PR bootstrap/10140 + * getopt.c (exchange, _getopt_initialize): Use mempcpy not + __mempcpy. + * regex.c (regerror): Likewise. + + 2003-04-14 Roger Sayle <ro...@ey...> + + * argv.c: Use ANSI_PROTOTYPES instead of __STDC__. + * memchr.c: Likewise. + * strcasecmp.c: Likewise. + * strncasecmp.c: Likewise. + * strncmp.c: Likewise. + * xatexit.c: Likewise. + * xmalloc.c: Likewise. + + * copysign.c: Use traditional function declaration instead of DEFUN. + * sigsetmask.c: Likewise. + + * memcmp.c: Both of the above, ANSI_PROTOTYPES and DEFUN. + * memset.c: Likewise. + + * memcpy.c: ANSI_PROTOTYPES, DEFUN and prototype bcopy. + * memmove.c: Likewise. + + 2003-04-14 Roger Sayle <ro...@ey...> + + * strdup.c (strdup): Tweak implementation to use memcpy. + + 2003-04-14 Kaveh R. Ghazi <gh...@ca...> + + * configure.in (HAVE_UINTPTR_T): Always define. + * configure: Regenerated. + + 2003-03-23 Alexandre Oliva <ao...@re...> + + * Makefile.in (MULTIOSDIR): New macro. Use $(CC) $(LIBCFLAGS) + instead of $$CC alone. + (install_to_tooldir): Use it. + 2003-17-03 Jan Hubicka <jh...@su...> *************** *** 12,21 **** (htab_traverse): Call htab_expand when table is too empty. - 2003-12-03 Jan Hubicka <jh...@su...> - - * hashtab.c (htab_expand): Compute the size of hashtable based - on the number of elements actually used. - (htab_traverse): Call htab_expand when table is too empty. - 2003-03-11 Carlo Wood <ca...@gn...> --- 103,106 ---- *************** *** 53,57 **** Richard Earnshaw <rea...@ar...> Geoffrey Keating <ge...@ap...> ! * configure.in: Check for sys/sysctl.h and sysctl. * physmem.c: Add support for *bsd and darwin. --- 138,142 ---- Richard Earnshaw <rea...@ar...> Geoffrey Keating <ge...@ap...> ! * configure.in: Check for sys/sysctl.h and sysctl. * physmem.c: Add support for *bsd and darwin. *************** *** 72,79 **** 2003-02-21 Kaveh R. Ghazi <gh...@ca...> * physmem.c (physmem_total, physmem_available): De-ANSI-fy. * configure.in (AC_CHECK_FUNCS): Add pstat_getstatic and pstat_getdynamic. ! 2003-02-20 Kaveh R. Ghazi <gh...@ca...> --- 157,171 ---- 2003-02-21 Kaveh R. Ghazi <gh...@ca...> + * configure.in: Check for sys/sysmp.h and sysmp. + * physmem.c: Pull upstream copy, add support for irix6. + + * config.in, configure: Regenerated. + + 2003-02-21 Kaveh R. Ghazi <gh...@ca...> + * physmem.c (physmem_total, physmem_available): De-ANSI-fy. * configure.in (AC_CHECK_FUNCS): Add pstat_getstatic and pstat_getdynamic. ! 2003-02-20 Kaveh R. Ghazi <gh...@ca...> Index: Makefile.in =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/Makefile.in,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** Makefile.in 22 Feb 2003 19:46:44 -0000 1.1.1.1.2.1 --- Makefile.in 18 Apr 2003 20:27:37 -0000 1.1.1.1.2.2 *************** *** 141,145 **** make-relative-prefix.c \ make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \ ! memset.c mkstemps.c \ objalloc.c obstack.c \ partition.c \ --- 141,145 ---- make-relative-prefix.c \ make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \ ! mempcpy.c memset.c mkstemps.c \ objalloc.c obstack.c \ partition.c \ *************** *** 148,157 **** physmem.c putenv.c \ random.c regex.c rename.c rindex.c \ ! safe-ctype.c setenv.c sigsetmask.c sort.c spaces.c \ ! splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \ ! strncasecmp.c strncmp.c strrchr.c strsignal.c strstr.c \ ! strtod.c strtol.c strtoul.c \ ternary.c tmpnam.c \ ! vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c \ waitpid.c \ xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c --- 148,157 ---- physmem.c putenv.c \ random.c regex.c rename.c rindex.c \ ! safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c spaces.c \ ! splay-tree.c stpcpy.c stpncpy.c strcasecmp.c strchr.c strdup.c \ ! strerror.c strncasecmp.c strncmp.c strrchr.c strsignal.c \ ! strstr.c strtod.c strtol.c strtoul.c \ ternary.c tmpnam.c \ ! vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \ waitpid.c \ xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c *************** *** 187,200 **** getcwd.o getpagesize.o \ index.o insque.o \ ! memchr.o memcmp.o memcpy.o memmove.o memset.o mkstemps.o \ pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \ pex-unix.o pex-win32.o \ putenv.o \ random.o rename.o rindex.o \ ! setenv.o sigsetmask.o strcasecmp.o strchr.o strdup.o \ ! strncasecmp.o strncmp.o strrchr.o strstr.o strtod.o strtol.o \ ! strtoul.o \ tmpnam.o \ ! vasprintf.o vfork.o vfprintf.o vprintf.o vsprintf.o \ waitpid.o --- 187,200 ---- getcwd.o getpagesize.o \ index.o insque.o \ ! memchr.o memcmp.o memcpy.o memmove.o mempcpy.o memset.o mkstemps.o \ pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \ pex-unix.o pex-win32.o \ putenv.o \ random.o rename.o rindex.o \ ! setenv.o sigsetmask.o snprintf.o stpcpy.o stpncpy.o strcasecmp.o \ ! strchr.o strdup.o strncasecmp.o strncmp.o strrchr.o strstr.o \ ! strtod.o strtol.o strtoul.o \ tmpnam.o \ ! vasprintf.o vfork.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \ waitpid.o *************** *** 287,295 **** @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install install_to_tooldir: all ! ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` ! $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n ! ( cd $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` ; $(RANLIB) $(TARGETLIB)n ) ! mv -f $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install --- 287,300 ---- @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install + # This is tricky. Even though CC in the Makefile contains + # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the + # default multilib, so we have to take LIBCFLAGS into account as well, + # since it will be passed the multilib flags. + MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory` install_to_tooldir: all ! ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR) ! $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n ! ( cd $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR) ; $(RANLIB) $(TARGETLIB)n ) ! mv -f $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install *************** *** 419,423 **** $(INCDIR)/safe-ctype.h bsearch.o: config.h $(INCDIR)/ansidecl.h ! calloc.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h clock.o: config.h --- 424,428 ---- $(INCDIR)/safe-ctype.h bsearch.o: config.h $(INCDIR)/ansidecl.h ! calloc.o: $(INCDIR)/ansidecl.h choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h clock.o: config.h *************** *** 427,431 **** $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ ! $(INCDIR)/getopt.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \ $(INCDIR)/libiberty.h --- 432,436 ---- $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ ! $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \ $(INCDIR)/libiberty.h *************** *** 447,451 **** $(INCDIR)/safe-ctype.h lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h --- 452,457 ---- $(INCDIR)/safe-ctype.h lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \ ! $(INCDIR)/libiberty.h make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h *************** *** 454,457 **** --- 460,464 ---- memcpy.o: $(INCDIR)/ansidecl.h memmove.o: $(INCDIR)/ansidecl.h + mempcpy.o: $(INCDIR)/ansidecl.h memset.o: $(INCDIR)/ansidecl.h mkstemps.o: config.h $(INCDIR)/ansidecl.h *************** *** 460,478 **** partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/partition.h ! pex-djgpp.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! pex-mpw.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! pex-msdos.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(INCDIR)/safe-ctype.h ! pex-os2.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! pex-unix.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! pex-win32.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ! physmem.o: config.h $(INCDIR)/libiberty.h putenv.o: config.h $(INCDIR)/ansidecl.h random.o: $(INCDIR)/ansidecl.h regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h ! rename.o: config.h safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h setenv.o: config.h $(INCDIR)/ansidecl.h sigsetmask.o: $(INCDIR)/ansidecl.h sort.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/sort.h --- 467,491 ---- partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/partition.h ! pex-djgpp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(srcdir)/pex-common.h ! pex-mpw.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(srcdir)/pex-common.h ! pex-msdos.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(srcdir)/pex-common.h $(INCDIR)/safe-ctype.h ! pex-os2.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(srcdir)/pex-common.h ! pex-unix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(srcdir)/pex-common.h ! pex-win32.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ! $(srcdir)/pex-common.h ! physmem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h putenv.o: config.h $(INCDIR)/ansidecl.h random.o: $(INCDIR)/ansidecl.h regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h ! rename.o: config.h $(INCDIR)/ansidecl.h safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h setenv.o: config.h $(INCDIR)/ansidecl.h sigsetmask.o: $(INCDIR)/ansidecl.h + snprintf.o: $(INCDIR)/ansidecl.h sort.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/sort.h *************** *** 480,485 **** --- 493,501 ---- splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/splay-tree.h + stpcpy.o: $(INCDIR)/ansidecl.h + stpncpy.o: $(INCDIR)/ansidecl.h strcasecmp.o: $(INCDIR)/ansidecl.h strchr.o: $(INCDIR)/ansidecl.h + strdup.o: $(INCDIR)/ansidecl.h strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h strncasecmp.o: $(INCDIR)/ansidecl.h *************** *** 494,498 **** --- 510,516 ---- vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h vfork.o: $(INCDIR)/ansidecl.h + vfprintf.o: $(INCDIR)/ansidecl.h vprintf.o: $(INCDIR)/ansidecl.h + vsnprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h vsprintf.o: $(INCDIR)/ansidecl.h waitpid.o: config.h Index: argv.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/argv.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** argv.c 20 Feb 2003 17:54:06 -0000 1.1.1.1 --- argv.c 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.1 *************** *** 30,34 **** /* Routines imported from standard C runtime libraries. */ ! #ifdef __STDC__ #include <stddef.h> --- 30,34 ---- /* Routines imported from standard C runtime libraries. */ ! #ifdef ANSI_PROTOTYPES #include <stddef.h> *************** *** 36,40 **** #include <stdlib.h> ! #else /* !__STDC__ */ #if !defined _WIN32 || defined __GNUC__ --- 36,40 ---- #include <stdlib.h> ! #else /* !ANSI_PROTOTYPES */ #if !defined _WIN32 || defined __GNUC__ *************** *** 47,51 **** #endif ! #endif /* __STDC__ */ --- 47,51 ---- #endif ! #endif /* ANSI_PROTOTYPES */ Index: calloc.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/calloc.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** calloc.c 20 Feb 2003 17:54:06 -0000 1.1.1.1 --- calloc.c 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.1 *************** *** 14,19 **** #include "ansidecl.h" - #include "libiberty.h" - #ifdef ANSI_PROTOTYPES #include <stddef.h> --- 14,17 ---- *************** *** 24,27 **** --- 22,26 ---- /* For systems with larger pointers than ints, this must be declared. */ PTR malloc PARAMS ((size_t)); + void bzero PARAMS ((PTR, size_t)); PTR Index: config.in =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/config.in,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** config.in 22 Feb 2003 19:46:44 -0000 1.1.1.1.2.1 --- config.in 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.2 *************** *** 106,109 **** --- 106,112 ---- #undef HAVE_MEMMOVE + /* Define if you have the mempcpy function. */ + #undef HAVE_MEMPCPY + /* Define if you have the memset function. */ #undef HAVE_MEMSET *************** *** 148,151 **** --- 151,163 ---- #undef HAVE_SIGSETMASK + /* Define if you have the snprintf function. */ + #undef HAVE_SNPRINTF + + /* Define if you have the stpcpy function. */ + #undef HAVE_STPCPY + + /* Define if you have the stpncpy function. */ + #undef HAVE_STPNCPY + /* Define if you have the strcasecmp function. */ #undef HAVE_STRCASECMP *************** *** 207,210 **** --- 219,225 ---- /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF + + /* Define if you have the vsnprintf function. */ + #undef HAVE_VSNPRINTF /* Define if you have the vsprintf function. */ Index: configure =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/configure,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** configure 22 Feb 2003 19:46:44 -0000 1.1.1.1.2.1 --- configure 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.2 *************** *** 1646,1665 **** fi ! ! if test $ac_cv_type_uintptr_t = yes ! then ! cat >> confdefs.h <<\EOF #define HAVE_UINTPTR_T 1 EOF - fi [...997 lines suppressed...] --- 3449,3453 ---- else cat > conftest.$ac_ext <<EOF ! #line 3452 "configure" #include "confdefs.h" *************** *** 3509,3513 **** EOF ! if { (eval echo configure:3512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes --- 3513,3517 ---- EOF ! if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes Index: configure.in =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/configure.in,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** configure.in 22 Feb 2003 19:46:44 -0000 1.1.1.1.2.1 --- configure.in 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.2 *************** *** 150,158 **** AC_CHECK_TYPE(uintptr_t, unsigned long) ! ! if test $ac_cv_type_uintptr_t = yes ! then ! AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.]) ! fi AC_TYPE_PID_T --- 150,157 ---- AC_CHECK_TYPE(uintptr_t, unsigned long) ! # Given the above check, we always have uintptr_t or a fallback ! # definition. So define HAVE_UINTPTR_T in case any imported code ! # relies on it. ! AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.]) AC_TYPE_PID_T *************** *** 179,182 **** --- 178,182 ---- funcs="$funcs memcpy" funcs="$funcs memmove" + funcs="$funcs mempcpy" funcs="$funcs memset" funcs="$funcs mkstemps" *************** *** 186,190 **** --- 186,193 ---- funcs="$funcs rindex" funcs="$funcs setenv" + funcs="$funcs snprintf" funcs="$funcs sigsetmask" + funcs="$funcs stpcpy" + funcs="$funcs stpncpy" funcs="$funcs strcasecmp" funcs="$funcs strchr" *************** *** 200,203 **** --- 203,207 ---- funcs="$funcs vfprintf" funcs="$funcs vprintf" + funcs="$funcs vsnprintf" funcs="$funcs vsprintf" funcs="$funcs waitpid" *************** *** 216,224 **** AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock) AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy) ! AC_CHECK_FUNCS(memmove memset putenv random rename rindex sigsetmask) ! AC_CHECK_FUNCS(strcasecmp setenv strchr strdup strncasecmp strrchr strstr) AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) ! AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs) AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl) AC_CHECK_FUNCS(realpath canonicalize_file_name) --- 220,228 ---- AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock) AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy) ! AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask) ! AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr) AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) ! AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf) AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl) AC_CHECK_FUNCS(realpath canonicalize_file_name) Index: copysign.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/copysign.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** copysign.c 20 Feb 2003 17:54:07 -0000 1.1.1.1 --- copysign.c 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.1 *************** *** 132,136 **** #if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) ! double DEFUN(copysign, (x, y), double x AND double y) { __ieee_double_shape_type a,b; --- 132,138 ---- #if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) ! double ! copysign (x, y) ! double x, y; { __ieee_double_shape_type a,b; *************** *** 143,147 **** #else ! double DEFUN(copysign, (x, y), double x AND double y) { if ((x < 0 && y > 0) || (x > 0 && y < 0)) --- 145,151 ---- #else ! double ! copysign (x, y) ! double x, y; { if ((x < 0 && y > 0) || (x > 0 && y < 0)) Index: floatformat.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/floatformat.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** floatformat.c 20 Feb 2003 17:54:09 -0000 1.1.1.1 --- floatformat.c 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.1 *************** *** 18,24 **** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "floatformat.h" #include <math.h> /* ldexp */ ! #ifdef __STDC__ #include <stddef.h> extern void *memcpy (void *s1, const void *s2, size_t n); --- 18,25 ---- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "ansidecl.h" #include "floatformat.h" #include <math.h> /* ldexp */ ! #ifdef ANSI_PROTOTYPES #include <stddef.h> extern void *memcpy (void *s1, const void *s2, size_t n); Index: functions.texi =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/functions.texi,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** functions.texi 22 Feb 2003 19:46:45 -0000 1.1.1.1.2.1 --- functions.texi 18 Apr 2003 20:27:38 -0000 1.1.1.1.2.2 *************** *** 399,403 **** version of the filename. Symlinks will be resolved, and ``.'' and ``..'' components will be simplified. The returned value will be allocated using ! @code{xmalloc} or @code{malloc}. @end deftypefn --- 399,403 ---- version of the filename. Symlinks will be resolved, and ``.'' and ``..'' components will be simplified. The returned value will be allocated using ! @code{malloc}, or @code{NULL} will be returned on a memory allocation error. @end deftypefn *************** *** 477,480 **** --- 477,488 ---- @end deftypefn + @c mempcpy.c:23 + @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) + + Copies @var{length} bytes from memory region @var{in} to region + @var{out}. Returns a pointer to @var{out} + @var{length}. + + @end deftypefn + @c memset.c:6 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count}) *************** *** 666,669 **** --- 674,690 ---- @end deftypefn + @c snprintf.c:28 + @deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...) + + This function is similar to sprintf, but it will print at most @var{n} + characters. On error the return value is -1, otherwise it returns the + number of characters that would have been printed had @var{n} been + sufficiently large, regardless of the actual value of @var{n}. Note + some pre-C99 system libraries do not implement this correctly so users + cannot generally rely on the return value if the system version of + this function is used. + + @end deftypefn + @c spaces.c:22 @deftypefn Extension char* spaces (int @var{count}) *************** *** 675,678 **** --- 696,717 ---- @end deftypefn + @c stpcpy.c:23 + @deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src}) + + Copies the string @var{src} into @var{dst}. Returns a pointer to + @var{dst} + strlen(@var{src}). + + @end deftypefn + + @c stpncpy.c:23 + @deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, size_t @var{len}) + + Copies the string @var{src} into @var{dst}, copying exactly @var{len} + and padding with zeros if necessary. If @var{len} < strlen(@var{src}) + then return @var{dst} + @var{len}, otherwise returns @var{dst} + + strlen(@var{src}). + + @end deftypefn + @c strcasecmp.c:15 @deftypefn Supplemental int strcasecmp (const char *@var{s1}, const char *@var{s2}) *************** *** 901,904 **** --- 940,956 ---- responsibility. In @libib{} they are implemented in terms of the nonstandard but common function @code{_doprnt}. + + @end deftypefn + + @c vsnprintf.c:28 + @deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, va_list @var{ap}) + + This function is similar to vsprintf, but it will print at most + @var{n} characters. On error the return value is -1, otherwise it + returns the number of characters that would have been printed had + @var{n} been sufficiently large, regardless of the actual value of + @var{n}. Note some pre-C99 system libraries do not implement this + correctly so users cannot generally rely on the return value if the + system version of this function is used. @end deftypefn Index: getcwd.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/getcwd.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** getcwd.c 20 Feb 2003 17:54:11 -0000 1.1.1.1 --- getcwd.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 41,45 **** getcwd (buf, len) char *buf; ! int len; { char ourbuf[MAXPATHLEN]; --- 41,45 ---- getcwd (buf, len) char *buf; ! size_t len; { char ourbuf[MAXPATHLEN]; Index: getopt.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/getopt.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** getopt.c 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- getopt.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 334,339 **** else { ! memset (__mempcpy (new_str, __getopt_nonoption_flags, ! nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; --- 334,339 ---- else { ! memset (mempcpy (new_str, __getopt_nonoption_flags, ! nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; *************** *** 445,449 **** nonoption_flags_max_len = -1; else ! memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } --- 445,449 ---- nonoption_flags_max_len = -1; else ! memset (mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } Index: hashtab.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/hashtab.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** hashtab.c 21 Mar 2003 18:56:09 -0000 1.1.1.1.2.1 --- hashtab.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.2 *************** *** 635,641 **** PTR info; { - PTR *slot; - PTR *limit; - if ((htab->n_elements - htab->n_deleted) * 8 < htab->size) htab_expand (htab); --- 635,638 ---- Index: maint-tool =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/maint-tool,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** maint-tool 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- maint-tool 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 224,227 **** --- 224,235 ---- $mine{'config.h'} = "config.h"; + opendir(INC, $srcdir); + while ($f = readdir INC) { + next unless $f =~ /\.h$/; + $mine{$f} = "\$(srcdir)/$f"; + $deps{$f} = join(' ', &deps_for("$srcdir/$f")); + } + $mine{'config.h'} = "config.h"; + open(IN, "$srcdir/Makefile.in"); open(OUT, ">$srcdir/Makefile.tmp"); Index: memchr.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/memchr.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** memchr.c 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- memchr.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 16,20 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 16,20 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else Index: memcmp.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/memcmp.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** memcmp.c 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- memcmp.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 17,21 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 17,21 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else *************** *** 24,29 **** int ! DEFUN(memcmp, (str1, str2, count), ! const PTR str1 AND const PTR str2 AND size_t count) { register const unsigned char *s1 = (const unsigned char*)str1; --- 24,31 ---- int ! memcmp (str1, str2, count) ! const PTR str1; ! const PTR str2; ! size_t count; { register const unsigned char *s1 = (const unsigned char*)str1; Index: memcpy.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/memcpy.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** memcpy.c 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- memcpy.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 14,18 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 14,18 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else *************** *** 20,25 **** #endif PTR ! DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) { bcopy(in, out, length); --- 20,30 ---- #endif + void bcopy PARAMS((const void*, void*, size_t)); + PTR ! memcpy (out, in, length) ! PTR out; ! const PTR in; ! size_t length; { bcopy(in, out, length); Index: memmove.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/memmove.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** memmove.c 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- memmove.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 14,22 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long #endif PTR --- 14,24 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long #endif + + void bcopy PARAMS ((const void*, void*, size_t)); PTR Index: memset.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/memset.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** memset.c 20 Feb 2003 17:54:12 -0000 1.1.1.1 --- memset.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 14,18 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 14,18 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else *************** *** 21,26 **** PTR ! DEFUN(memset, (dest, val, len), ! PTR dest AND register int val AND register size_t len) { register unsigned char *ptr = (unsigned char*)dest; --- 21,28 ---- PTR ! memset (dest, val, len) ! PTR dest; ! register int val; ! register size_t len; { register unsigned char *ptr = (unsigned char*)dest; Index: regex.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/regex.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** regex.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- regex.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 8201,8205 **** { #if defined HAVE_MEMPCPY || defined _LIBC ! *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; #else memcpy (errbuf, msg, errbuf_size - 1); --- 8201,8205 ---- { #if defined HAVE_MEMPCPY || defined _LIBC ! *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; #else memcpy (errbuf, msg, errbuf_size - 1); Index: rename.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/rename.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** rename.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- rename.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 13,16 **** --- 13,17 ---- */ + #include "ansidecl.h" #ifdef HAVE_CONFIG_H #include "config.h" *************** *** 23,28 **** int rename (zfrom, zto) ! char *zfrom; ! char *zto; { if (link (zfrom, zto) < 0) --- 24,29 ---- int rename (zfrom, zto) ! const char *zfrom; ! const char *zto; { if (link (zfrom, zto) < 0) Index: sigsetmask.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/sigsetmask.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** sigsetmask.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- sigsetmask.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 26,31 **** #ifdef SIG_SETMASK int ! DEFUN(sigsetmask,(set), ! int set) { sigset_t new; --- 26,31 ---- #ifdef SIG_SETMASK int ! sigsetmask (set) ! int set; { sigset_t new; Index: strcasecmp.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/strcasecmp.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** strcasecmp.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- strcasecmp.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 26,30 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 26,30 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else Index: strdup.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/strdup.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** strdup.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- strdup.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 10,21 **** */ char * strdup(s) char *s; { ! char *result = (char*)malloc(strlen(s) + 1); ! if (result == (char*)0) ! return (char*)0; ! strcpy(result, s); ! return result; } --- 10,32 ---- */ + #include <ansidecl.h> + #ifdef ANSI_PROTOTYPES + #include <stddef.h> + #else + #define size_t unsigned long + #endif + + extern size_t strlen PARAMS ((const char*)); + extern PTR malloc PARAMS ((size_t)); + extern PTR memcpy PARAMS ((PTR, const PTR, size_t)); + char * strdup(s) char *s; { ! size_t len = strlen (s) + 1; ! char *result = (char*) malloc (len); ! if (result == (char*) 0) ! return (char*) 0; ! return (char*) memcpy (result, s, len); } Index: strncasecmp.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/strncasecmp.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** strncasecmp.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- strncasecmp.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 26,30 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 26,30 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else Index: strncmp.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/strncmp.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** strncmp.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- strncmp.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 14,18 **** #include <ansidecl.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 14,18 ---- #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else Index: strsignal.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/strsignal.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** strsignal.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- strsignal.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 43,47 **** #ifndef NULL ! # ifdef __STDC__ # define NULL (void *) 0 # else --- 43,47 ---- #ifndef NULL ! # ifdef ANSI_PROTOTYPES # define NULL (void *) 0 # else Index: strstr.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/strstr.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** strstr.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- strstr.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 28,33 **** extern char *strchr (); extern int strncmp (); ! #if __GNUC__==2 ! extern __SIZE_TYPE__ strlen (); #endif register int len = strlen (s2); --- 28,33 ---- extern char *strchr (); extern int strncmp (); ! #if __GNUC__ >= 2 ! extern __SIZE_TYPE__ strlen (const char *); #endif register int len = strlen (s2); Index: vfprintf.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/vfprintf.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** vfprintf.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- vfprintf.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 4,8 **** */ ! #ifdef __STDC__ #include <stdarg.h> #else --- 4,9 ---- */ ! #include "ansidecl.h" ! #ifdef ANSI_PROTOTYPES #include <stdarg.h> #else Index: vprintf.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/vprintf.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** vprintf.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- vprintf.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 16,20 **** */ ! #ifdef __STDC__ #include <stdarg.h> #else --- 16,21 ---- */ ! #include <ansidecl.h> ! #ifdef ANSI_PROTOTYPES #include <stdarg.h> #else *************** *** 22,26 **** #endif #include <stdio.h> - #include <ansidecl.h> #undef vprintf int --- 23,26 ---- Index: vsprintf.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/vsprintf.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** vsprintf.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- vsprintf.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 27,33 **** the executable file might be covered by the GNU General Public License. */ #include <varargs.h> #include <stdio.h> - #include <ansidecl.h> #undef vsprintf --- 27,37 ---- the executable file might be covered by the GNU General Public License. */ + #include <ansidecl.h> + #ifdef ANSI_PROTOTYPES + #include <stdarg.h> + #else #include <varargs.h> + #endif #include <stdio.h> #undef vsprintf Index: xatexit.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/xatexit.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** xatexit.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- xatexit.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 28,32 **** #include <stdio.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 28,32 ---- #include <stdio.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else Index: xmalloc.c =================================================================== RCS file: /cvsroot/p4w/cygwin/libiberty/xmalloc.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** xmalloc.c 20 Feb 2003 17:54:13 -0000 1.1.1.1 --- xmalloc.c 18 Apr 2003 20:27:39 -0000 1.1.1.1.2.1 *************** *** 69,73 **** #include <stdio.h> ! #ifdef __STDC__ #include <stddef.h> #else --- 69,73 ---- #include <stdio.h> ! #ifdef ANSI_PROTOTYPES #include <stddef.h> #else |