mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
0d204b0a52
Thu Oct 17 01:55:34 1996 Ulrich Drepper <drepper@cygnus.com> * sunrpc/Makefile ($(objpfx)rpcsvc/%.h, $(objpfx)x%.c): Write output to $@T and move to $@ later since the new rpcgen will not overwrite existing files. * po/Makefile (libc.pot): Fix typo. Sun Oct 13 20:52:07 1996 Thorsten Kukuk <kukuk@weber.uni-paderborn.de> Update rpcgen program to TI-rpc code. * sunrpc/Makefile (rpcgen-objs): Add rpc_tblout.o and rpc_sample.o. (distribute): Add proto.h. * sunrpc/proto.h: New file. Prototypes for all the RPC functions. * sunrpc/rpc_clntout.c: Change to allow generation of ISO C code. * sunrpc/rpc_cout.c: Likewise. * sunrpc/rpc_hout.c: Likewise. * sunrpc/rpc_main.c: Likewise. * sunrpc/rpc_parse.c: Likewise. * sunrpc/rpc_parse.h: Likewise. * sunrpc/rpc_scan.c: Likewise. * sunrpc/rpc_scan.h: Likewise. * sunrpc/rpc_svcout.c: Likewise. * sunrpc/rpc_util.c: Likewise. * sunrpc/rpc_util.h: Likewise. * sunrpc/rpc_tblout.c: New file. * sunrpc/rpc_sample.c: Likewise. Thu Oct 17 00:26:20 1996 NIIBE Yutaka <gniibe@mri.co.jp> * sysdeps/unix/opendir.c: Add semicolon for consistency. Wed Oct 16 12:26:53 1996 Sven Verdoolaege <skimo@breughel.ufsia.ac.be> * locale/progams/localedef.c (main): Test with -1 to find out whether read failed. Wed Oct 16 14:54:59 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/i386/clone.S: Use JUMPTARGET and PSEUDO_END macro. Tue Oct 15 21:27:42 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/m68k/sigcontext.h: Removed. Tue Oct 15 15:52:29 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/m68k/clone.S: Add CALL_MCOUNT. * sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sigreturn.S: Likewise. * sysdeps/unix/sysv/linux/m68k/socket.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.S (__errno_location): Likewise. * sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise. Correct generation of system call. Tue Oct 15 15:13:16 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules (sysd-Makefile): Fix command so that it works in the subdirectories. (BUILD_CFLAGS): Change back using $(..) instead of $(common-objpfx), the latter fails in the toplevel directory when $(objdir) is relative. (common-objdir-compile): Run compiler in $(objdir). * sysdeps/posix/Makefile (mk-stdiolim): Likewise. Tue Oct 15 23:39:48 1996 Ulrich Drepper <drepper@cygnus.com> * string/string.h [__USE_SVID]: Add prototype for swab. * time/sys/time.h [__USE_BSD]: Add prototype for ualarm. Reported by Andreas Jaeger. The available nlist implementation is not generally usable. Especially on the currently supported ELF systems the nlist function comes with the libelf. * misc/Makefile (headers): Remove nlist.h. (routines): Remove nlist. * Makefile ($(objpfx)version-info.h): Include information about system the libc is built on in version-info.h file. * po/Makefile (distribute): Add header.pot. Tue Oct 15 16:34:15 1996 Andreas Jaeger <aj@arthur.pfalz.de> * sysdeps/unix/sysv/linux/sleep.c: Include file with prototype. * sysdeps/unix/sysv/linux/reboot.c: Likewise. * misc/error.c: Likewise. Tue Oct 15 22:41:27 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/syscalls.list: Add {get,set}resuid. Tue Oct 15 08:06:02 1996 Andreas Jaeger <aj@arthur.pfalz.de> * crypt/Makefiel (rpath-link): Extend search path to current directory. Fri Oct 11 09:18:06 1996 Sven Verdoolaege <skimo@breughel.ufsia.ac.be> * sysdeps/i386/i586/strlen.S: Correct handling of prolog for aligning pointer. Tue Oct 15 02:13:21 1996 Ulrich Drepper <drepper@cygnus.com> * stdio-common/vfprintf.c: Don't declare __flockfile as weak. * crypt/md5-crypt.c (md5_crypt_r): Add cast to prevent warning. Sun Oct 13 19:16:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/m68k/sysdep.h (POUND): Macro removed, replaced by `&'. (PSEUDO_END): Provide definition to use .size directive. (PSEUDO): Don't interpret negative return values less than -128 as syscall error. * sysdeps/unix/sysv/linux/m68k/syscall.S (syscall): Likewise. * sysdeps/m68k/bsd-_setjmp.S: Use PSEUDO_END macro to provide .size directive. * sysdeps/m68k/bsd-setjmp.S: Likewise. * sysdeps/unix/sysv/linux/m68k/clone.S: Likewise. * sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sigreturn.S: Likewise. * sysdeps/unix/sysv/linux/m68k/socket.S: Likewise. * sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Use PSEUDO_END instead of explicit .size directive. * libio/iogets.c: Warn when gets is used. cd * time/strptime.c: Recognize %s, %u, %g, and %G format.
252 lines
9.4 KiB
C
252 lines
9.4 KiB
C
/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library 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.
|
|
|
|
The GNU C 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
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with the GNU C Library; see the file COPYING.LIB. If
|
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
|
Cambridge, MA 02139, USA. */
|
|
|
|
/*
|
|
* ANSI Standard: 4.11 STRING HANDLING <string.h>
|
|
*/
|
|
|
|
#ifndef _STRING_H
|
|
|
|
#define _STRING_H 1
|
|
#include <features.h>
|
|
|
|
__BEGIN_DECLS
|
|
|
|
/* Get size_t and NULL from <stddef.h>. */
|
|
#define __need_size_t
|
|
#define __need_NULL
|
|
#include <stddef.h>
|
|
|
|
|
|
/* Copy N bytes of SRC to DEST. */
|
|
extern __ptr_t memcpy __P ((__ptr_t __dest, __const __ptr_t __src,
|
|
size_t __n));
|
|
/* Copy N bytes of SRC to DEST, guaranteeing
|
|
correct behavior for overlapping strings. */
|
|
extern __ptr_t memmove __P ((__ptr_t __dest, __const __ptr_t __src,
|
|
size_t __n));
|
|
|
|
/* Copy no more than N bytes of SRC to DEST, stopping when C is found.
|
|
Return the position in DEST one byte past where C was copied,
|
|
or NULL if C was not found in the first N bytes of SRC. */
|
|
extern __ptr_t __memccpy __P ((__ptr_t __dest, __const __ptr_t __src,
|
|
int __c, size_t __n));
|
|
#if defined (__USE_SVID) || defined (__USE_BSD)
|
|
extern __ptr_t memccpy __P ((__ptr_t __dest, __const __ptr_t __src,
|
|
int __c, size_t __n));
|
|
#endif /* SVID. */
|
|
|
|
|
|
/* Set N bytes of S to C. */
|
|
extern __ptr_t memset __P ((__ptr_t __s, int __c, size_t __n));
|
|
|
|
/* Compare N bytes of S1 and S2. */
|
|
extern int memcmp __P ((__const __ptr_t __s1, __const __ptr_t __s2,
|
|
size_t __n));
|
|
|
|
/* Search N bytes of S for C. */
|
|
extern __ptr_t memchr __P ((__const __ptr_t __s, int __c, size_t __n));
|
|
|
|
|
|
/* Copy SRC to DEST. */
|
|
extern char *strcpy __P ((char *__dest, __const char *__src));
|
|
/* Copy no more than N characters of SRC to DEST. */
|
|
extern char *strncpy __P ((char *__dest, __const char *__src, size_t __n));
|
|
|
|
/* Append SRC onto DEST. */
|
|
extern char *strcat __P ((char *__dest, __const char *__src));
|
|
/* Append no more than N characters from SRC onto DEST. */
|
|
extern char *strncat __P ((char *__dest, __const char *__src, size_t __n));
|
|
|
|
/* Compare S1 and S2. */
|
|
extern int strcmp __P ((__const char *__s1, __const char *__s2));
|
|
/* Compare N characters of S1 and S2. */
|
|
extern int strncmp __P ((__const char *__s1, __const char *__s2, size_t __n));
|
|
|
|
/* Compare the collated forms of S1 and S2. */
|
|
extern int strcoll __P ((__const char *__s1, __const char *__s2));
|
|
/* Put a transformation of SRC into no more than N bytes of DEST. */
|
|
extern size_t strxfrm __P ((char *__dest, __const char *__src, size_t __n));
|
|
|
|
#if defined (__USE_SVID) || defined (__USE_BSD)
|
|
/* Duplicate S, returning an identical malloc'd string. */
|
|
extern char *__strdup __P ((__const char *__s));
|
|
extern char *strdup __P ((__const char *__s));
|
|
#endif
|
|
|
|
/* Return a malloc'd copy of at most N bytes of STRING. The
|
|
resultant string is terminated even if no null terminator
|
|
appears before STRING[N]. */
|
|
extern char *__strndup __P ((__const char *__string, size_t __n));
|
|
extern char *strndup __P ((__const char *__string, size_t __n));
|
|
|
|
#if defined (__USE_GNU) && defined (__GNUC__)
|
|
/* Duplicate S, returning an identical alloca'd string. */
|
|
#define strdupa(s) \
|
|
(__extension__ \
|
|
({ \
|
|
__const char *__old = (s); \
|
|
size_t __len = strlen (__old) + 1; \
|
|
char *__new = __builtin_alloca (__len); \
|
|
memcpy (__new, __old, __len); \
|
|
}))
|
|
|
|
/* Return an alloca'd copy of at most N bytes of string. */
|
|
#define strndupa(s, n) \
|
|
(__extension__ \
|
|
({ \
|
|
__const char *__old = (s); \
|
|
size_t __len = strnlen (__old, (n)); \
|
|
char *__new = __builtin_alloca (__len + 1); \
|
|
__new[__len] = '\0'; \
|
|
memcpy (__new, __old, __len); \
|
|
}))
|
|
#endif
|
|
|
|
/* Find the first occurrence of C in S. */
|
|
extern char *strchr __P ((__const char *__s, int __c));
|
|
/* Find the last occurrence of C in S. */
|
|
extern char *strrchr __P ((__const char *__s, int __c));
|
|
|
|
/* Return the length of the initial segment of S which
|
|
consists entirely of characters not in REJECT. */
|
|
extern size_t strcspn __P ((__const char *__s, __const char *__reject));
|
|
/* Return the length of the initial segment of S which
|
|
consists entirely of characters in ACCEPT. */
|
|
extern size_t strspn __P ((__const char *__s, __const char *__accept));
|
|
/* Find the first occurence in S of any character in ACCEPT. */
|
|
extern char *strpbrk __P ((__const char *__s, __const char *__accept));
|
|
/* Find the first occurence of NEEDLE in HAYSTACK. */
|
|
extern char *strstr __P ((__const char *__haystack, __const char *__needle));
|
|
/* Divide S into tokens separated by characters in DELIM. */
|
|
extern char *strtok __P ((char *__s, __const char *__delim));
|
|
|
|
#ifdef __USE_GNU
|
|
/* Divide S into tokens separated by characters in DELIM. Information
|
|
passed between calls are stored in SAVE_PTR. */
|
|
extern char *strtok_r __P ((char *__s, __const char *__delim,
|
|
char **__save_ptr));
|
|
|
|
/* Find the first occurence of NEEDLE in HAYSTACK.
|
|
NEEDLE is NEEDLELEN bytes long;
|
|
HAYSTACK is HAYSTACKLEN bytes long. */
|
|
extern __ptr_t memmem __P ((__const __ptr_t __haystack, size_t __haystacklen,
|
|
__const __ptr_t __needle, size_t __needlelen));
|
|
#endif
|
|
|
|
|
|
/* Return the length of S. */
|
|
extern size_t strlen __P ((__const char *__s));
|
|
|
|
#ifdef __USE_GNU
|
|
/* Find the length of STRING, but scan at most MAXLEN characters.
|
|
If no '\0' terminator is found in that many characters, return MAXLEN. */
|
|
extern size_t strnlen __P ((__const char *__string, size_t __maxlen));
|
|
|
|
#ifdef __OPTIMIZE__
|
|
extern __inline size_t
|
|
strnlen (__const char *__string, size_t __maxlen)
|
|
{
|
|
__const char *__end = memchr (__string, '\0', __maxlen);
|
|
return __end ? __end - __string : __maxlen;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* Return a string describing the meaning of the `errno' code in ERRNUM. */
|
|
extern char *strerror __P ((int __errnum));
|
|
#ifdef __USE_REENTRANT
|
|
/* Reentrant version of `strerror'. If a temporary buffer is required, at
|
|
most BUFLEN bytes of BUF will be used. */
|
|
extern char *strerror_r __P ((int __errnum, char *__buf, size_t __buflen));
|
|
#endif
|
|
|
|
#ifdef __USE_BSD
|
|
/* Find the first occurrence of C in S (same as strchr). */
|
|
extern char *index __P ((__const char *__s, int __c));
|
|
|
|
/* Find the last occurrence of C in S (same as strrchr). */
|
|
extern char *rindex __P ((__const char *__s, int __c));
|
|
|
|
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
|
|
extern void bcopy __P ((__const __ptr_t __src, __ptr_t __dest, size_t __n));
|
|
|
|
/* Set N bytes of S to 0. */
|
|
extern void bzero __P ((__ptr_t __s, size_t __n));
|
|
|
|
/* Compare N bytes of S1 and S2 (same as memcmp). */
|
|
extern int bcmp __P ((__const __ptr_t __s1, __const __ptr_t __s2, size_t __n));
|
|
|
|
/* Return the position of the first bit set in I, or 0 if none are set.
|
|
The least-significant bit is position 1, the most-significant 32. */
|
|
extern int ffs __P ((int __i));
|
|
|
|
/* Compare S1 and S2, ignoring case. */
|
|
extern int __strcasecmp __P ((__const char *__s1, __const char *__s2));
|
|
extern int strcasecmp __P ((__const char *__s1, __const char *__s2));
|
|
|
|
/* Compare no more than N chars of S1 and S2, ignoring case. */
|
|
extern int __strncasecmp __P ((__const char *__s1, __const char *__s2,
|
|
size_t __n));
|
|
extern int strncasecmp __P ((__const char *__s1, __const char *__s2,
|
|
size_t __n));
|
|
|
|
/* Return the next DELIM-delimited token from *STRINGP,
|
|
terminating it with a '\0', and update *STRINGP to point past it. */
|
|
extern char *__strsep __P ((char **__stringp, __const char *__delim));
|
|
extern char *strsep __P ((char **__stringp, __const char *__delim));
|
|
#endif
|
|
|
|
#ifdef __USE_GNU
|
|
/* Return a string describing the meaning of the signal number in SIG. */
|
|
extern char *strsignal __P ((int __sig));
|
|
|
|
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
|
|
extern char *__stpcpy __P ((char *__dest, __const char *__src));
|
|
extern char *stpcpy __P ((char *__dest, __const char *__src));
|
|
|
|
/* Copy no more than N characters of SRC to DEST, returning the address of
|
|
the last character written into DEST. */
|
|
extern char *__stpncpy __P ((char *__dest, __const char *__src, size_t __n));
|
|
extern char *stpncpy __P ((char *__dest, __const char *__src, size_t __n));
|
|
|
|
/* Sautee STRING briskly. */
|
|
extern char *strfry __P ((char *__string));
|
|
|
|
/* Frobnicate N bytes of S. */
|
|
extern __ptr_t memfrob __P ((__ptr_t __s, size_t __n));
|
|
#endif
|
|
|
|
#ifdef __USE_MISC
|
|
/* Return the file name within directory of FILENAME. */
|
|
extern char *basename __P ((__const char *__filename));
|
|
#endif
|
|
|
|
#ifdef __USE_SVID
|
|
/* Swab pairs bytes in the first N bytes of the area pointed to by
|
|
FROM and copy the result to TO. The value of TO must not be in the
|
|
range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
|
|
is without partner. */
|
|
extern void swab __P ((__const char *__from, __const char *__to, size_t __n));
|
|
#endif
|
|
|
|
__END_DECLS
|
|
|
|
#endif /* string.h */
|