Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	Patch by [email protected] [libc/1382].
  • Loading branch information
Ulrich Drepper committed Oct 9, 1999
1 parent a4a1492 commit c1422e5
Show file tree
Hide file tree
Showing 113 changed files with 2,934 additions and 2,978 deletions.
4 changes: 3 additions & 1 deletion Makeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,11 @@ ifeq (yes, $(build-shared))
ifndef avoid-generated
$(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \
$(wildcard $(patsubst %, $(..)%/shlib-versions,\
$(add-ons))) \
$(add-ons) \
$(subdirs))) \
$(common-objpfx)config.make
(file="$(wildcard $(patsubst %,$(..)%/shlib-versions,$(add-ons))) \
$(wildcard $(patsubst %,$(..)%/shlib-versions,$(subdirs))) \
$(..)shlib-versions"; \
for f in $$file; do \
sed 's/#.*$$//' $$f | while read conf versions; do \
Expand Down
116 changes: 48 additions & 68 deletions argp/argp.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,6 @@
typedef int error_t;
# define __error_t_defined
#endif

#ifndef __P
# ifdef __cplusplus
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)
# define __P(args) args throw ()
# else
# define __P(args) args
# endif
# define __PMT(args) args
# elif defined __STDC__ && __STDC__ > 0
# define __P(args) args
# define __PMT(args) args
# else
# define __P(args) ()
# define __PMT(args) ()
# endif
#endif

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -133,8 +116,8 @@ struct argp_state; /* " */
struct argp_child; /* " */

/* The type of a pointer to an argp parsing function. */
typedef error_t (*argp_parser_t) __PMT ((int key, char *arg,
struct argp_state *state));
typedef error_t (*argp_parser_t) (int key, char *arg,
struct argp_state *state);

/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
returns will simply be ignored. For user keys, this error will be turned
Expand Down Expand Up @@ -247,8 +230,7 @@ struct argp
has been done, so if any of the replacement text also needs translation,
that should be done by the filter function. INPUT is either the input
supplied to argp_parse, or NULL, if argp_help was called directly. */
char *(*help_filter) __PMT ((int __key, __const char *__text,
void *__input));
char *(*help_filter) (int __key, __const char *__text, void *__input);

/* If non-zero the strings used in the argp library are translated using
the domain described by this string. Otherwise the currently installed
Expand Down Expand Up @@ -391,15 +373,14 @@ struct argp_state
routine returned a non-zero value, it is returned; otherwise 0 is
returned. This function may also call exit unless the ARGP_NO_HELP flag
is set. INPUT is a pointer to a value to be passed in to the parser. */
extern error_t argp_parse __P ((__const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags, int *__restrict __arg_index,
void *__restrict __input));
extern error_t __argp_parse __P ((__const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags,
int *__restrict __arg_index,
void *__restrict __input));
extern error_t argp_parse (__const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags, int *__restrict __arg_index,
void *__restrict __input) __THROW;
extern error_t __argp_parse (__const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags, int *__restrict __arg_index,
void *__restrict __input) __THROW;

/* Global variables. */

Expand All @@ -414,9 +395,9 @@ extern __const char *argp_program_version;
calls this function with a stream to print the version to and a pointer to
the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
extern void (*argp_program_version_hook) __PMT ((FILE *__restrict __stream,
struct argp_state *__restrict
__state));
extern void (*argp_program_version_hook) (FILE *__restrict __stream,
struct argp_state *__restrict
__state);

/* If defined or set by the user program, it should point to string that is
the bug-reporting address for the program. It will be printed by
Expand Down Expand Up @@ -461,12 +442,12 @@ extern error_t argp_err_exit_status;

/* Output a usage message for ARGP to STREAM. FLAGS are from the set
ARGP_HELP_*. */
extern void argp_help __P ((__const struct argp *__restrict __argp,
FILE *__restrict __stream,
unsigned __flags, char *__restrict __name));
extern void __argp_help __P ((__const struct argp *__restrict __argp,
FILE *__restrict __stream, unsigned __flags,
char *__name));
extern void argp_help (__const struct argp *__restrict __argp,
FILE *__restrict __stream,
unsigned __flags, char *__restrict __name) __THROW;
extern void __argp_help __P (__const struct argp *__restrict __argp,
FILE *__restrict __stream, unsigned __flags,
char *__name) __THROW;

/* The following routines are intended to be called from within an argp
parsing routine (thus taking an argp_state structure as the first
Expand All @@ -478,27 +459,25 @@ extern void __argp_help __P ((__const struct argp *__restrict __argp,

/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
from the set ARGP_HELP_*. */
extern void argp_state_help __P ((__const struct argp_state *__restrict
__state,
FILE *__restrict __stream,
unsigned int __flags));
extern void __argp_state_help __P ((__const struct argp_state *__restrict
__state,
FILE *__restrict __stream,
unsigned int __flags));
extern void argp_state_help (__const struct argp_state *__restrict __state,
FILE *__restrict __stream,
unsigned int __flags) __THROW;
extern void __argp_state_help (__const struct argp_state *__restrict __state,
FILE *__restrict __stream,
unsigned int __flags) __THROW;

/* Possibly output the standard usage message for ARGP to stderr and exit. */
extern void argp_usage __P ((__const struct argp_state *__state));
extern void __argp_usage __P ((__const struct argp_state *__state));
extern void argp_usage (__const struct argp_state *__state) __THROW;
extern void __argp_usage (__const struct argp_state *__state) __THROW;

/* If appropriate, print the printf string FMT and following args, preceded
by the program name and `:', to stderr, and followed by a `Try ... --help'
message, then exit (1). */
extern void argp_error __P ((__const struct argp_state *__restrict __state,
__const char *__restrict __fmt, ...))
extern void argp_error (__const struct argp_state *__restrict __state,
__const char *__restrict __fmt, ...) __THROW
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void __argp_error __P ((__const struct argp_state *__restrict __state,
__const char *__restrict __fmt, ...))
extern void __argp_error (__const struct argp_state *__restrict __state,
__const char *__restrict __fmt, ...) __THROW
__attribute__ ((__format__ (__printf__, 2, 3)));

/* Similar to the standard gnu error-reporting function error(), but will
Expand All @@ -509,31 +488,32 @@ extern void __argp_error __P ((__const struct argp_state *__restrict __state,
difference between this function and argp_error is that the latter is for
*parsing errors*, and the former is for other problems that occur during
parsing but don't reflect a (syntactic) problem with the input. */
extern void argp_failure __P ((__const struct argp_state *__restrict __state,
int __status, int __errnum,
__const char *__restrict __fmt, ...))
extern void argp_failure (__const struct argp_state *__restrict __state,
int __status, int __errnum,
__const char *__restrict __fmt, ...) __THROW
__attribute__ ((__format__ (__printf__, 4, 5)));
extern void __argp_failure __P ((__const struct argp_state *__restrict __state,
int __status, int __errnum,
__const char *__restrict __fmt, ...))
extern void __argp_failure (__const struct argp_state *__restrict __state,
int __status, int __errnum,
__const char *__restrict __fmt, ...) __THROW
__attribute__ ((__format__ (__printf__, 4, 5)));

/* Returns true if the option OPT is a valid short option. */
extern int _option_is_short __P ((__const struct argp_option *__opt));
extern int __option_is_short __P ((__const struct argp_option *__opt));
extern int _option_is_short (__const struct argp_option *__opt) __THROW;
extern int __option_is_short (__const struct argp_option *__opt) __THROW;

/* Returns true if the option OPT is in fact the last (unused) entry in an
options array. */
extern int _option_is_end __P ((__const struct argp_option *__opt));
extern int __option_is_end __P ((__const struct argp_option *__opt));
extern int _option_is_end (__const struct argp_option *__opt) __THROW;
extern int __option_is_end (__const struct argp_option *__opt) __THROW;

/* Return the input field for ARGP in the parser corresponding to STATE; used
by the help routines. */
extern void *_argp_input __P ((__const struct argp *__restrict __argp,
__const struct argp_state *__restrict __state));
extern void *__argp_input __P ((__const struct argp *__restrict __argp,
__const struct argp_state *__restrict
__state));
extern void *_argp_input (__const struct argp *__restrict __argp,
__const struct argp_state *__restrict __state)
__THROW;
extern void *__argp_input (__const struct argp *__restrict __argp,
__const struct argp_state *__restrict __state)
__THROW;

#ifdef __USE_EXTERN_INLINES

Expand Down
17 changes: 7 additions & 10 deletions assert/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,15 @@
__BEGIN_DECLS

/* This prints an "Assertion failed" message and aborts. */
extern void __assert_fail __P ((__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function))
__attribute__ ((__noreturn__));
extern void __assert_fail (__const char *__assertion, __const char *__file,
unsigned int __line, __const char *__function)
__THROW __attribute__ ((__noreturn__));

/* Likewise, but prints the error text for ERRNUM. */
extern void __assert_perror_fail __P ((int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function))
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum, __const char *__file,
unsigned int __line,
__const char *__function)
__THROW __attribute__ ((__noreturn__));

__END_DECLS

Expand Down
10 changes: 5 additions & 5 deletions catgets/nl_types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1996, 1997, 1999 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
Expand Down Expand Up @@ -37,15 +37,15 @@ typedef void *nl_catd;
typedef int nl_item;

/* Open message catalog for later use, returning descriptor. */
extern nl_catd catopen __P ((__const char *__cat_name, int __flag));
extern nl_catd catopen (__const char *__cat_name, int __flag) __THROW;

/* Return translation with NUMBER in SET of CATALOG; if not found
return STRING. */
extern char *catgets __P ((nl_catd __catalog, int __set, int __number,
__const char *__string));
extern char *catgets (nl_catd __catalog, int __set, int __number,
__const char *__string) __THROW;

/* Close message CATALOG. */
extern int catclose __P ((nl_catd __catalog));
extern int catclose (nl_catd __catalog) __THROW;

__END_DECLS

Expand Down
69 changes: 38 additions & 31 deletions ctype/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ extern __const __int32_t *__ctype_toupper; /* Case conversions. */
#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */

#define __exctype(name) extern int name __P ((int))
#define __exctype(name) extern int name (int) __THROW

/* The following names are all functions:
int isCHARACTERISTIC(int c);
Expand All @@ -106,28 +106,46 @@ __exctype (isblank);


/* Return the lowercase version of C. */
extern int tolower __P ((int __c));
extern int tolower (int __c) __THROW;

/* Return the uppercase version of C. */
extern int toupper __P ((int __c));
extern int toupper (int __c) __THROW;


#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));
extern int isascii (int __c) __THROW;

/* 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));
extern int toascii (int __c) __THROW;

/* These are the same as `toupper' and `tolower' except that they do not
check the argument for being in the range of a `char'. */
__exctype (_toupper);
__exctype (_tolower);
#endif /* Use SVID or use misc. */

/* This code is needed for the optimized mapping functions. */
#define __tobody(c, f, a, args) \
(__extension__ \
({ int __res; \
if (sizeof (c) > 1) \
{ \
if (__builtin_constant_p (c)) \
{ \
int __c = (c); \
__res = __c < -128 || __c > 255 ? __c : a[__c]; \
} \
else \
__res = f args; \
} \
else \
__res = a[(int) (c)]; \
__res; }))

#ifndef __NO_CTYPE
# define isalnum(c) __isctype((c), _ISalnum)
# define isalpha(c) __isctype((c), _ISalpha)
Expand Down Expand Up @@ -161,25 +179,8 @@ toupper (int __c) __THROW
# endif

# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
# define __tobody(c, f, a) \
(__extension__ \
({ int __res; \
if (sizeof (c) > 1) \
{ \
if (__builtin_constant_p (c)) \
{ \
int __c = (c); \
__res = __c < -128 || __c > 255 ? __c : a[__c]; \
} \
else \
__res = f (c); \
} \
else \
__res = a[(int) (c)]; \
__res; }))

# define tolower(c) __tobody (c, tolower, __ctype_tolower)
# define toupper(c) __tobody (c, toupper, __ctype_toupper)
# define tolower(c) __tobody (c, tolower, __ctype_tolower, (c))
# define toupper(c) __tobody (c, toupper, __ctype_toupper, (c))
# endif /* Optimizing gcc */

# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
Expand Down Expand Up @@ -211,13 +212,12 @@ toupper (int __c) __THROW

/* These definitions are similar to the ones above but all functions
take as an argument a handle for the locale which shall be used. */
# define __isctype_l(c, type, locale) \
# ifdef __OPTIMIZE__
# define __isctype_l(c, type, locale) \
((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
# endif

# define __tolower_l(c, locale) ((int) (locale)->__ctype_tolower[(int) (c)])
# define __toupper_l(c, locale) ((int) (locale)->__ctype_toupper[(int) (c)])

# define __exctype_l(name) extern int name __P ((int, __locale_t))
# define __exctype_l(name) extern int name (int, __locale_t) __THROW

/* The following names are all functions:
int isCHARACTERISTIC(int c, locale_t *locale);
Expand All @@ -239,10 +239,17 @@ __exctype_l (__isblank_l);


/* Return the lowercase version of C in locale L. */
extern int __tolower_l __P ((int __c, __locale_t __l));
extern int __tolower_l (int __c, __locale_t __l) __THROW;

/* Return the uppercase version of C. */
extern int __toupper_l __P ((int __c, __locale_t __l));
extern int __toupper_l (int __c, __locale_t __l) __THROW;

# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
# define __tolower_l(c, locale) \
__tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale))
# define __toupper_l(c, locale) \
__tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale))
# endif /* Optimizing gcc */


# ifndef __NO_CTYPE
Expand Down
Loading

0 comments on commit c1422e5

Please sign in to comment.