mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-05 09:01:07 +00:00
2303f5fdd9
Sun Nov 10 02:37:15 1996 Ulrich Drepper <drepper@cygnus.com> * inet/gethstent_r.c: Update copyright. * nss/getXXbyYY_r.c: Likewise. * nss/nsswitch.c: Likewise. * nss/getXXent_r.c: Likewise. * nss/nss_files/files-XXX.c: Likewise. * nss/nss_files/files-netgroup.c: Likewise. * nss/nss_files/files-parse.c: Likewise. * nss/getXXent_r.c: Change implementation. It's not necessary to call all setXXent functions. Just find first available and when necessary let getXXent_r call the others. * nss/nss_files/files-XXX.c: Make really reentrant. Now calls of getXXent and getXXbyYY can be mixed. The cursor for traversing the database with getXXent will be remembered. * stdlib/test-canon.c (cwd): Change size to PATH_MAX. Sat Nov 9 15:34:48 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/Dist: Add sys/mtio.h. * sysdeps/unix/sysv/linux/sys/mtio.h: New file. * signal/signal.h [__USE_BSD]: Add prototype for siggetmask. Fri Nov 8 13:29:30 1996 Ulrich Drepper <drepper@cygnus.com> * ctype/ctype.h (__isascii): Don't test for seventh bit not to be set. Instead for none beside the first seven bits to be set. X/Open allows the argument to be an `int' value. Reported by Alain Williams <addw@phcomp.co.uk>. (toascii, isascii): Define macro also when __USE_XOPEN. * sysdeps/posix/fpathconf.c: Use fstatfs to compute NAME_MAX, not PATH_MAX. Thu Nov 7 03:04:29 1996 Ulrich Drepper <drepper@cygnus.com> * nss/getXXXent_r.c (SETFUNC_NAME): Reset `nip' after loop to NULL so that GETFUNC will see first entry. (ENDFUNC_NAME): Likewise. Rewrite Netgroups implementation to avoid global data. * inet/netgroup.h: Add definition of name_list and struct __netgrent. Add prototypes for internal netgroup functions. * nss/nss_files/files-netgroup.c (_nss_files_setnetgrent): Take extra argument and use the included data instead of global vars. (_nss_files_endnetgrent): Likewise. (_nss_netgroup_parseline): Change to be static and use data included in the RESULT structure. * inet/getnetgrent_r.c (startp): Move into setup function. (known_groups, needed_groups): new part of the __netgrent sruct. (freememory): Take extra argument and use included data. (__internal_endnetgrent): Likewise. (internal_setnetgrent): Renamed to __internal_setnetgrent_reuse and take extra argument. (__internal_setnetgrent): New function. Call __internal_setnetgrent_reuse after calling free_memory. (setnetgrent): Only call __internal_setnetgrent. (__getnetgrent_r): Split into two functions. __getnetgrent_r calls __internal_getnetgrent after locking. (innetgr): Use dynamic data only. I.e., innetgr now is fully reentrant. Thu Nov 7 00:15:14 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/stub/setenv.c: Correct typo: unseenv -> unsetenv. Reported by Joshua Cowan <jcowan@jcowan.reslife.okstate.edu>. Wed Nov 6 13:13:37 1996 Ulrich Drepper <drepper@cygnus.com> * manual/creature.texi: Document that _GNU_SOURCE is no longer the default when no *_SOURCE macro is given. Reported by Karsten Weiss <karsten@addx.au.s.shuttle.de>. * NOTES: remade from manual/creature.texi. * manual/libc.texinfo: Add back line about GPL translation which somehow got lost. * Make-dist (dist.tar): Depend on README being updated. * rellns-sh: Correct thinko in removing leading /. Reported by Andreas Jaeger <aj@arthur.pfalz.de>. * pwd/fgetpwent_r.c: Recognize lines containing only names starting with `+' or `-' in parser. * grp/fgetgrent_r.c: Likewise. * shadow/sgetspent_r.c: Likewise. * nss/nss_files/files-spwd.c: Don't accept entries starting with `+' or `-'. * sysdeps/stub/lchown.c: New file.
165 lines
5.3 KiB
C
165 lines
5.3 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., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
/*
|
|
* ISO C Standard 4.3: CHARACTER HANDLING <ctype.h>
|
|
*/
|
|
|
|
#ifndef _CTYPE_H
|
|
|
|
#define _CTYPE_H 1
|
|
#include <features.h>
|
|
|
|
__BEGIN_DECLS
|
|
|
|
#ifndef _ISbit
|
|
/* These are all the characteristics of characters.
|
|
If there get to be more than 16 distinct characteristics,
|
|
many things must be changed that use `unsigned short int's.
|
|
|
|
The characteristics are stored always in network byte order (big
|
|
endian). We define the bit value interpretations here dependent on the
|
|
machine's byte order. */
|
|
|
|
#include <endian.h>
|
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
|
#define _ISbit(bit) (1 << bit)
|
|
#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
|
|
#define _ISbit(bit) (bit < 8 ? ((1 << bit) << 8) : ((1 << bit) >> 8))
|
|
#endif
|
|
|
|
enum
|
|
{
|
|
_ISupper = _ISbit (0), /* UPPERCASE. */
|
|
_ISlower = _ISbit (1), /* lowercase. */
|
|
_ISalpha = _ISbit (2), /* Alphabetic. */
|
|
_ISdigit = _ISbit (3), /* Numeric. */
|
|
_ISxdigit = _ISbit (4), /* Hexadecimal numeric. */
|
|
_ISspace = _ISbit (5), /* Whitespace. */
|
|
_ISprint = _ISbit (6), /* Printing. */
|
|
_ISgraph = _ISbit (7), /* Graphical. */
|
|
_ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */
|
|
_IScntrl = _ISbit (9), /* Control character. */
|
|
_ISpunct = _ISbit (10), /* Punctuation. */
|
|
_ISalnum = _ISbit (11) /* Alphanumeric. */
|
|
};
|
|
#endif /* ! _ISbit */
|
|
|
|
/* These are defined in ctype-info.c.
|
|
The declarations here must match those in localeinfo.h.
|
|
|
|
These point into arrays of 384, so they can be indexed by any `unsigned
|
|
char' value [0,255]; by EOF (-1); or by any `signed char' value
|
|
[-128,-1). ISO C requires that the ctype functions work for `unsigned
|
|
char' values and for EOF; we also support negative `signed char' values
|
|
for broken old programs. The case conversion arrays are of `int's
|
|
rather than `unsigned char's because tolower (EOF) must be EOF, which
|
|
doesn't fit into an `unsigned char'. But today more important is that
|
|
the arrays are also used for multi-byte character sets. */
|
|
extern __const unsigned short int *__ctype_b; /* Characteristics. */
|
|
extern __const int *__ctype_tolower; /* Case conversions. */
|
|
extern __const int *__ctype_toupper; /* Case conversions. */
|
|
|
|
#define __isctype(c, type) \
|
|
(__ctype_b[(int) (c)] & (unsigned short int) type)
|
|
|
|
#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
|
|
#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
|
|
|
|
#define __tolower(c) ((int) __ctype_tolower[(int) (c)])
|
|
#define __toupper(c) ((int) __ctype_toupper[(int) (c)])
|
|
|
|
#define __exctype(name) extern int name __P ((int))
|
|
|
|
/* The following names are all functions:
|
|
int isCHARACTERISTIC(int c);
|
|
which return nonzero iff C has CHARACTERISTIC.
|
|
For the meaning of the characteristic names, see the `enum' above. */
|
|
__exctype (isalnum);
|
|
__exctype (isalpha);
|
|
__exctype (iscntrl);
|
|
__exctype (isdigit);
|
|
__exctype (islower);
|
|
__exctype (isgraph);
|
|
__exctype (isprint);
|
|
__exctype (ispunct);
|
|
__exctype (isspace);
|
|
__exctype (isupper);
|
|
__exctype (isxdigit);
|
|
|
|
#ifdef __USE_GNU
|
|
__exctype (isblank);
|
|
#endif
|
|
|
|
|
|
/* Return the lowercase version of C. */
|
|
extern int tolower __P ((int __c));
|
|
|
|
/* Return the uppercase version of C. */
|
|
extern int toupper __P ((int __c));
|
|
|
|
|
|
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
|
|
|
/* Return nonzero iff C is in the ASCII set
|
|
(i.e., is no more than 7 bits wide). */
|
|
extern int isascii __P ((int __c));
|
|
|
|
/* Return the part of C that is in the ASCII set
|
|
(i.e., the low-order 7 bits of C). */
|
|
extern int toascii __P ((int __c));
|
|
|
|
#endif /* Use SVID or use misc. */
|
|
|
|
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
|
/* These are the same as `toupper' and `tolower'. */
|
|
__exctype (_toupper);
|
|
__exctype (_tolower);
|
|
#endif
|
|
|
|
#ifndef __NO_CTYPE
|
|
#define isalnum(c) __isctype((c), _ISalnum)
|
|
#define isalpha(c) __isctype((c), _ISalpha)
|
|
#define iscntrl(c) __isctype((c), _IScntrl)
|
|
#define isdigit(c) __isctype((c), _ISdigit)
|
|
#define islower(c) __isctype((c), _ISlower)
|
|
#define isgraph(c) __isctype((c), _ISgraph)
|
|
#define isprint(c) __isctype((c), _ISprint)
|
|
#define ispunct(c) __isctype((c), _ISpunct)
|
|
#define isspace(c) __isctype((c), _ISspace)
|
|
#define isupper(c) __isctype((c), _ISupper)
|
|
#define isxdigit(c) __isctype((c), _ISxdigit)
|
|
|
|
#ifdef __USE_GNU
|
|
#define isblank(c) __isctype((c), _ISblank)
|
|
#endif
|
|
|
|
#define tolower(c) __tolower(c)
|
|
#define toupper(c) __toupper(c)
|
|
|
|
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
|
#define isascii(c) __isascii(c)
|
|
#define toascii(c) __toascii(c)
|
|
#endif
|
|
|
|
#endif /* Not __NO_CTYPE. */
|
|
|
|
__END_DECLS
|
|
|
|
#endif /* ctype.h */
|