Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
65b77008
...
65b770085aff7b6bba421ae81a0589fe49694f01
authored
2006-01-20 15:53:07 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Updated by gnulib-sync
1 parent
50b24ab6
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
213 additions
and
127 deletions
m4/argp.m4
m4/regex.m4
m4/stdint.m4
mailbox/argp-fmtstream.h
mailbox/argp-help.c
mailbox/argp-namefrob.h
mailbox/argp-parse.c
mailbox/argp.h
mailbox/glob-libc.h
mailbox/glob_.h
mailbox/md5.c
mailbox/md5.h
mailbox/regex_internal.h
mailbox/stdint_.h
mailbox/sysexit_.h
m4/argp.m4
View file @
65b7700
...
...
@@ -9,8 +9,40 @@ AC_DEFUN([gl_ARGP],
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_GETOPT_SUBSTITUTE])
AC_CHECK_DECLS([program_invocation_name, program_invocation_short_name],,,
AC_CHECK_DECL([program_invocation_name],
[AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_NAME, 1,
[Define if program_invocation_name is declared])],
[AC_DEFINE(GNULIB_PROGRAM_INVOCATION_NAME, 1,
[Define to 1 to add extern declaration of program_invocation_name to argp-namefrob.h])],
[#include <errno.h>])
AC_CHECK_DECL([program_invocation_short_name],
[AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME, 1,
[Define if program_invocation_short_name is declared])],
[AC_DEFINE(GNULIB_PROGRAM_INVOCATION_SHORT_NAME, 1,
[Define to 1 to add extern declaration of program_invocation_short_name to argp-namefrob.h])],
[#include <errno.h>])
# Check if program_invocation_name and program_invocation_short_name
# are defined elsewhere. It is improbable that only one of them will
# be defined and other not, I prefer to stay on the safe side and to
# test each one separately.
AC_MSG_CHECKING(whether program_invocation_name is defined)
AC_TRY_COMPILE([#include <argp.h>],
[ program_invocation_name = "test"; ],
[ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
[Define if program_invocation_name is defined])
AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)] )
AC_MSG_CHECKING(whether program_invocation_short_name is defined)
AC_TRY_COMPILE([#include <argp.h>],
[ program_invocation_short_name = "test"; ],
[ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME,1,
[Define if program_invocation_short_name is defined])
AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)] )
AC_CHECK_DECLS_ONCE(
[clearerr_unlocked feof_unlocked ferror_unlocked
fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
...
...
m4/regex.m4
View file @
65b7700
#serial 3
0
#serial 3
1
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
# Software Foundation, Inc.
...
...
@@ -15,8 +15,29 @@ AC_PREREQ([2.50])
AC_DEFUN([gl_REGEX],
[
AC_REQUIRE([AC_SYS_LARGEFILE]) dnl for a sufficently-wide off_t
AC_CACHE_CHECK([whether off_t can be used in a switch statement],
[gl_cv_type_off_t_switch],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT],
[[off_t o = -1;
switch (o)
{
case -2:
return 1;
case -1:
return 2;
default:
return 0;
}
]])],
[gl_cv_type_off_t_switch=yes],
[gl_cv_type_off_t_switch=no])])
if test $gl_cv_type_off_t_switch = yes; then
AC_DEFINE([_REGEX_LARGE_OFFSETS], 1,
[Define if you want regoff_t to be at least as wide POSIX requires.])
fi
MU_LIBSOURCES(
[regcomp.c, regex.c, regex.h,
...
...
m4/stdint.m4
View file @
65b7700
# stdint.m4 serial
4
# stdint.m4 serial
5
dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
...
...
@@ -12,6 +12,8 @@ AC_DEFUN([gl_STDINT_H],
AC_REQUIRE([gt_HEADER_INTTYPES_H])
dnl Check for <sys/inttypes.h>.
AC_CHECK_HEADERS([sys/inttypes.h])
dnl Check for <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
AC_CHECK_HEADERS([sys/bitypes.h])
AC_MSG_CHECKING([for stdint.h])
AC_CACHE_VAL(gl_cv_header_stdint_h, [
...
...
mailbox/argp-fmtstream.h
View file @
65b7700
/* Word-wrapping and line-truncating streams.
Copyright (C) 1997 Free Software Foundation, Inc.
Copyright (C) 1997
, 2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
...
...
@@ -90,10 +90,6 @@ typedef FILE *argp_fmtstream_t;
#else
/* !ARGP_FMTSTREAM_USE_LINEWRAP */
/* Guess we have to define our own version. */
#ifndef __const
#define __const const
#endif
struct
argp_fmtstream
{
FILE
*
stream
;
/* The stream we're outputting to. */
...
...
@@ -133,22 +129,22 @@ extern void __argp_fmtstream_free (argp_fmtstream_t __fs);
extern
void
argp_fmtstream_free
(
argp_fmtstream_t
__fs
);
extern
ssize_t
__argp_fmtstream_printf
(
argp_fmtstream_t
__fs
,
__
const
char
*
__fmt
,
...)
const
char
*
__fmt
,
...)
__attribute__
((
__format__
(
printf
,
2
,
3
)));
extern
ssize_t
argp_fmtstream_printf
(
argp_fmtstream_t
__fs
,
__
const
char
*
__fmt
,
...)
const
char
*
__fmt
,
...)
__attribute__
((
__format__
(
printf
,
2
,
3
)));
extern
int
__argp_fmtstream_putc
(
argp_fmtstream_t
__fs
,
int
__ch
);
extern
int
argp_fmtstream_putc
(
argp_fmtstream_t
__fs
,
int
__ch
);
extern
int
__argp_fmtstream_puts
(
argp_fmtstream_t
__fs
,
__
const
char
*
__str
);
extern
int
argp_fmtstream_puts
(
argp_fmtstream_t
__fs
,
__
const
char
*
__str
);
extern
int
__argp_fmtstream_puts
(
argp_fmtstream_t
__fs
,
const
char
*
__str
);
extern
int
argp_fmtstream_puts
(
argp_fmtstream_t
__fs
,
const
char
*
__str
);
extern
size_t
__argp_fmtstream_write
(
argp_fmtstream_t
__fs
,
__
const
char
*
__str
,
size_t
__len
);
const
char
*
__str
,
size_t
__len
);
extern
size_t
argp_fmtstream_write
(
argp_fmtstream_t
__fs
,
__
const
char
*
__str
,
size_t
__len
);
const
char
*
__str
,
size_t
__len
);
/* Access macros for various bits of state. */
#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
...
...
@@ -207,7 +203,7 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
ARGP_FS_EI
size_t
__argp_fmtstream_write
(
argp_fmtstream_t
__fs
,
__
const
char
*
__str
,
size_t
__len
)
const
char
*
__str
,
size_t
__len
)
{
if
(
__fs
->
p
+
__len
<=
__fs
->
end
||
__argp_fmtstream_ensure
(
__fs
,
__len
))
{
...
...
@@ -220,7 +216,7 @@ __argp_fmtstream_write (argp_fmtstream_t __fs,
}
ARGP_FS_EI
int
__argp_fmtstream_puts
(
argp_fmtstream_t
__fs
,
__
const
char
*
__str
)
__argp_fmtstream_puts
(
argp_fmtstream_t
__fs
,
const
char
*
__str
)
{
size_t
__len
=
strlen
(
__str
);
if
(
__len
)
...
...
mailbox/argp-help.c
View file @
65b7700
...
...
@@ -89,13 +89,13 @@ struct uparams
int
dup_args_note
;
/* Various output columns. */
int
short_opt_col
;
int
long_opt_col
;
int
doc_opt_col
;
int
opt_doc_col
;
int
header_col
;
int
usage_indent
;
int
rmargin
;
int
short_opt_col
;
/* column in which short options start */
int
long_opt_col
;
/* column in which long options start */
int
doc_opt_col
;
/* column in which doc options start */
int
opt_doc_col
;
/* column in which option text starts */
int
header_col
;
/* column in which group headers are printed */
int
usage_indent
;
/* indentation of wrapped usage lines */
int
rmargin
;
/* right margin used for wrapping */
int
valid
;
/* True when the values in here are valid. */
};
...
...
@@ -131,15 +131,41 @@ static const struct uparam_name uparam_names[] =
{
0
}
};
static
void
validate_uparams
(
const
struct
argp_state
*
state
,
struct
uparams
*
upptr
)
{
const
struct
uparam_name
*
up
;
for
(
up
=
uparam_names
;
up
->
name
;
up
++
)
{
if
(
up
->
is_bool
||
up
->
uparams_offs
==
offsetof
(
struct
uparams
,
rmargin
))
continue
;
if
(
*
(
int
*
)((
char
*
)
upptr
+
up
->
uparams_offs
)
>=
upptr
->
rmargin
)
{
__argp_failure
(
state
,
0
,
0
,
dgettext
(
state
->
root_argp
->
argp_domain
,
"\
ARGP_HELP_FMT: %s value is less then or equal to %s"
),
"rmargin"
,
up
->
name
);
return
;
}
}
uparams
=
*
upptr
;
uparams
.
valid
=
1
;
}
/* Read user options from the environment, and fill in UPARAMS appropiately. */
static
void
fill_in_uparams
(
const
struct
argp_state
*
state
)
{
const
char
*
var
=
getenv
(
"ARGP_HELP_FMT"
);
struct
uparams
new_params
=
uparams
;
#define SKIPWS(p) do { while (isspace (*p)) p++; } while (0);
if
(
var
)
{
/* Parse var. */
while
(
*
var
)
{
...
...
@@ -191,11 +217,18 @@ fill_in_uparams (const struct argp_state *state)
{
if
(
unspec
&&
!
un
->
is_bool
)
__argp_failure
(
state
,
0
,
0
,
dgettext
(
state
->
root_argp
->
argp_domain
,
"\
dgettext
(
state
->
root_argp
->
argp_domain
,
"\
%.*s: ARGP_HELP_FMT parameter requires a value"
),
(
int
)
var_len
,
var
);
else
if
(
val
<
0
)
__argp_failure
(
state
,
0
,
0
,
dgettext
(
state
->
root_argp
->
argp_domain
,
"\
%.*s: ARGP_HELP_FMT parameter must be positive"
),
(
int
)
var_len
,
var
);
else
*
(
int
*
)((
char
*
)
&
u
params
+
un
->
uparams_offs
)
=
val
;
*
(
int
*
)((
char
*
)
&
new_
params
+
un
->
uparams_offs
)
=
val
;
break
;
}
if
(
!
un
->
name
)
...
...
@@ -216,6 +249,8 @@ fill_in_uparams (const struct argp_state *state)
break
;
}
}
validate_uparams
(
state
,
&
new_params
);
}
}
/* Returns true if OPT hasn't been marked invisible. Visibility only affects
...
...
@@ -1683,8 +1718,7 @@ char *
__argp_short_program_name
(
void
)
{
# if HAVE_DECL_PROGRAM_INVOCATION_NAME
char
*
name
=
strrchr
(
program_invocation_name
,
'/'
);
return
name
?
name
+
1
:
program_invocation_name
;
return
__argp_base_name
(
program_invocation_name
);
# else
/* FIXME: What now? Miles suggests that it is better to use NULL,
but currently the value is passed on directly to fputs_unlocked,
...
...
mailbox/argp-namefrob.h
View file @
65b7700
...
...
@@ -141,14 +141,21 @@
# define putchar_unlocked(x) putchar (x)
# endif
extern
char
*
__argp_basename
(
char
*
name
);
#endif
/* !_LIBC */
#ifndef __set_errno
#define __set_errno(e) (errno = (e))
#endif
#if defined GNULIB_ARGP_DISABLE_DIRNAME
# define __argp_base_name(arg) arg
#elif defined GNULIB_ARGP_EXTERN_BASENAME
# extern char *__argp_base_name(const char *arg);
#else
# include "dirname.h"
# define __argp_base_name base_name
#endif
#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
# define __argp_short_program_name() (program_invocation_short_name)
#else
...
...
mailbox/argp-parse.c
View file @
65b7700
...
...
@@ -109,11 +109,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
to be that, so we have to be a bit careful here.] */
/* Update what we use for messages. */
state
->
name
=
strrchr
(
arg
,
'/'
);
if
(
state
->
name
)
state
->
name
++
;
else
state
->
name
=
arg
;
state
->
name
=
__argp_base_name
(
arg
);
#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
program_invocation_short_name
=
state
->
name
;
...
...
@@ -562,10 +558,7 @@ parser_init (struct parser *parser, const struct argp *argp,
if
(
parser
->
state
.
argv
==
argv
&&
argv
[
0
])
/* There's an argv[0]; use it for messages. */
{
char
*
short_name
=
strrchr
(
argv
[
0
],
'/'
);
parser
->
state
.
name
=
short_name
?
short_name
+
1
:
argv
[
0
];
}
parser
->
state
.
name
=
__argp_base_name
(
argv
[
0
]);
else
parser
->
state
.
name
=
__argp_short_program_name
();
...
...
mailbox/argp.h
View file @
65b7700
/* Hierarchial argument parsing, layered over getopt.
Copyright (C) 1995-1999,2003
,2004
Free Software Foundation, Inc.
Copyright (C) 1995-1999,2003
-2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
...
...
@@ -28,10 +28,6 @@
#define __need_error_t
#include <errno.h>
#ifndef __const
# define __const const
#endif
#ifndef __THROW
# define __THROW
#endif
...
...
@@ -82,7 +78,7 @@ struct argp_option
{
/* The long option name. For more than one name for the same option, you
can use following options with the OPTION_ALIAS flag set. */
__
const
char
*
name
;
const
char
*
name
;
/* What key is returned for this option. If > 0 and printable, then it's
also accepted as a short option. */
...
...
@@ -90,7 +86,7 @@ struct argp_option
/* If non-NULL, this is the name of the argument associated with this
option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
__
const
char
*
arg
;
const
char
*
arg
;
/* OPTION_ flags. */
int
flags
;
...
...
@@ -99,7 +95,7 @@ struct argp_option
will be printed outdented from the normal option column, making it
useful as a group header (it will be the first thing printed in its
group); in this usage, it's conventional to end the string with a `:'. */
__
const
char
*
doc
;
const
char
*
doc
;
/* The group this option is in. In a long help message, options are sorted
alphabetically within each group, and the groups presented in the order
...
...
@@ -227,7 +223,7 @@ struct argp
{
/* An array of argp_option structures, terminated by an entry with both
NAME and KEY having a value of 0. */
__
const
struct
argp_option
*
options
;
const
struct
argp_option
*
options
;
/* What to do with an option from this structure. KEY is the key
associated with the option, and ARG is any associated argument (NULL if
...
...
@@ -243,12 +239,12 @@ struct argp
contains newlines, the strings separated by them are considered
alternative usage patterns, and printed on separate lines (lines after
the first are prefix by ` or: ' instead of `Usage:'). */
__
const
char
*
args_doc
;
const
char
*
args_doc
;
/* If non-NULL, a string containing extra text to be printed before and
after the options in a long help message (separated by a vertical tab
`\v' character). */
__
const
char
*
doc
;
const
char
*
doc
;
/* A vector of argp_children structures, terminated by a member with a 0
argp field, pointing to child argps should be parsed with this one. Any
...
...
@@ -256,7 +252,7 @@ struct argp
CHILDREN list. This field is useful if you use libraries that supply
their own argp structure, which you want to use in conjunction with your
own. */
__
const
struct
argp_child
*
children
;
const
struct
argp_child
*
children
;
/* If non-zero, this should be a function to filter the output of help
messages. KEY is either a key from an option, in which case TEXT is
...
...
@@ -268,7 +264,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
)
(
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
...
...
@@ -292,7 +288,7 @@ struct argp
struct
argp_child
{
/* The child parser. */
__
const
struct
argp
*
argp
;
const
struct
argp
*
argp
;
/* Flags for this child. */
int
flags
;
...
...
@@ -301,7 +297,7 @@ struct argp_child
child options. As a side-effect, a non-zero value forces the child
options to be grouped together; to achieve this effect without actually
printing a header string, use a value of "". */
__
const
char
*
header
;
const
char
*
header
;
/* Where to group the child options relative to the other (`consolidated')
options in the parent argp; the values are the same as the GROUP field
...
...
@@ -317,7 +313,7 @@ struct argp_child
struct
argp_state
{
/* The top level ARGP being parsed. */
__
const
struct
argp
*
root_argp
;
const
struct
argp
*
root_argp
;
/* The argument vector being parsed. May be modified. */
int
argc
;
...
...
@@ -411,11 +407,11 @@ 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
(
__
const
struct
argp
*
__restrict
__argp
,
extern
error_t
argp_parse
(
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
,
extern
error_t
__argp_parse
(
const
struct
argp
*
__restrict
__argp
,
int
__argc
,
char
**
__restrict
__argv
,
unsigned
__flags
,
int
*
__restrict
__arg_index
,
void
*
__restrict
__input
);
...
...
@@ -426,7 +422,7 @@ extern error_t __argp_parse (__const struct argp *__restrict __argp,
option --version is added (unless the ARGP_NO_HELP flag is used), which
will print this string followed by a newline and exit (unless the
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
extern
__
const
char
*
argp_program_version
;
extern
const
char
*
argp_program_version
;
/* If defined or set by the user program to a non-zero value, then a default
option --version is added (unless the ARGP_NO_HELP flag is used), which
...
...
@@ -442,7 +438,7 @@ extern void (*argp_program_version_hook) (FILE *__restrict __stream,
argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
standard help messages), embedded in a sentence that says something like
`Report bugs to ADDR.'. */
extern
__
const
char
*
argp_program_bug_address
;
extern
const
char
*
argp_program_bug_address
;
/* The exit status that argp will use when exiting due to a parsing error.
If not defined or set by the user program, this defaults to EX_USAGE from
...
...
@@ -480,10 +476,10 @@ 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
(
__
const
struct
argp
*
__restrict
__argp
,
extern
void
argp_help
(
const
struct
argp
*
__restrict
__argp
,
FILE
*
__restrict
__stream
,
unsigned
__flags
,
char
*
__restrict
__name
);
extern
void
__argp_help
(
__
const
struct
argp
*
__restrict
__argp
,
extern
void
__argp_help
(
const
struct
argp
*
__restrict
__argp
,
FILE
*
__restrict
__stream
,
unsigned
__flags
,
char
*
__name
);
...
...
@@ -497,25 +493,25 @@ extern void __argp_help (__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
(
__
const
struct
argp_state
*
__restrict
__state
,
extern
void
argp_state_help
(
const
struct
argp_state
*
__restrict
__state
,
FILE
*
__restrict
__stream
,
unsigned
int
__flags
);
extern
void
__argp_state_help
(
__
const
struct
argp_state
*
__restrict
__state
,
extern
void
__argp_state_help
(
const
struct
argp_state
*
__restrict
__state
,
FILE
*
__restrict
__stream
,
unsigned
int
__flags
);
/* Possibly output the standard usage message for ARGP to stderr and exit. */
extern
void
argp_usage
(
__
const
struct
argp_state
*
__state
);
extern
void
__argp_usage
(
__
const
struct
argp_state
*
__state
);
extern
void
argp_usage
(
const
struct
argp_state
*
__state
);
extern
void
__argp_usage
(
const
struct
argp_state
*
__state
);
/* 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
(
__
const
struct
argp_state
*
__restrict
__state
,
__
const
char
*
__restrict
__fmt
,
...)
extern
void
argp_error
(
const
struct
argp_state
*
__restrict
__state
,
const
char
*
__restrict
__fmt
,
...)
__attribute__
((
__format__
(
__printf__
,
2
,
3
)));
extern
void
__argp_error
(
__
const
struct
argp_state
*
__restrict
__state
,
__
const
char
*
__restrict
__fmt
,
...)
extern
void
__argp_error
(
const
struct
argp_state
*
__restrict
__state
,
const
char
*
__restrict
__fmt
,
...)
__attribute__
((
__format__
(
__printf__
,
2
,
3
)));
/* Similar to the standard gnu error-reporting function error(), but will
...
...
@@ -526,31 +522,31 @@ extern void __argp_error (__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
(
__
const
struct
argp_state
*
__restrict
__state
,
extern
void
argp_failure
(
const
struct
argp_state
*
__restrict
__state
,
int
__status
,
int
__errnum
,
__
const
char
*
__restrict
__fmt
,
...)
const
char
*
__restrict
__fmt
,
...)
__attribute__
((
__format__
(
__printf__
,
4
,
5
)));
extern
void
__argp_failure
(
__
const
struct
argp_state
*
__restrict
__state
,
extern
void
__argp_failure
(
const
struct
argp_state
*
__restrict
__state
,
int
__status
,
int
__errnum
,
__
const
char
*
__restrict
__fmt
,
...)
const
char
*
__restrict
__fmt
,
...)
__attribute__
((
__format__
(
__printf__
,
4
,
5
)));
/* Returns true if the option OPT is a valid short option. */
extern
int
_option_is_short
(
__
const
struct
argp_option
*
__opt
)
__THROW
;
extern
int
__option_is_short
(
__
const
struct
argp_option
*
__opt
)
__THROW
;
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
(
__
const
struct
argp_option
*
__opt
)
__THROW
;
extern
int
__option_is_end
(
__
const
struct
argp_option
*
__opt
)
__THROW
;
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
(
__
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
)
extern
void
*
__argp_input
(
const
struct
argp
*
__restrict
__argp
,
const
struct
argp_state
*
__restrict
__state
)
__THROW
;
#ifdef __USE_EXTERN_INLINES
...
...
@@ -567,13 +563,13 @@ extern void *__argp_input (__const struct argp *__restrict __argp,
# endif
ARGP_EI
void
__NTH
(
__argp_usage
(
__
const
struct
argp_state
*
__state
))
__NTH
(
__argp_usage
(
const
struct
argp_state
*
__state
))
{
__argp_state_help
(
__state
,
stderr
,
ARGP_HELP_STD_USAGE
);
}
ARGP_EI
int
__NTH
(
__option_is_short
(
__
const
struct
argp_option
*
__opt
))
__NTH
(
__option_is_short
(
const
struct
argp_option
*
__opt
))
{
if
(
__opt
->
flags
&
OPTION_DOC
)
return
0
;
...
...
@@ -585,7 +581,7 @@ __NTH (__option_is_short (__const struct argp_option *__opt))
}
ARGP_EI
int
__NTH
(
__option_is_end
(
__
const
struct
argp_option
*
__opt
))
__NTH
(
__option_is_end
(
const
struct
argp_option
*
__opt
))
{
return
!
__opt
->
key
&&
!
__opt
->
name
&&
!
__opt
->
doc
&&
!
__opt
->
group
;
}
...
...
mailbox/glob-libc.h
View file @
65b7700
/* Copyright (C) 1991,92,95-98,2000,2001,2004 Free Software Foundation, Inc.
/* Copyright (C) 1991,92,95-98,2000,2001,2004
-2006
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
...
...
@@ -104,13 +104,13 @@ typedef struct
#else
void
*
(
*
gl_readdir
)
(
void
*
);
#endif
void
*
(
*
gl_opendir
)
(
__
const
char
*
);
void
*
(
*
gl_opendir
)
(
const
char
*
);
#ifdef __USE_GNU
int
(
*
gl_lstat
)
(
__
const
char
*
__restrict
,
struct
stat
*
__restrict
);
int
(
*
gl_stat
)
(
__
const
char
*
__restrict
,
struct
stat
*
__restrict
);
int
(
*
gl_lstat
)
(
const
char
*
__restrict
,
struct
stat
*
__restrict
);
int
(
*
gl_stat
)
(
const
char
*
__restrict
,
struct
stat
*
__restrict
);
#else
int
(
*
gl_lstat
)
(
__
const
char
*
__restrict
,
void
*
__restrict
);
int
(
*
gl_stat
)
(
__
const
char
*
__restrict
,
void
*
__restrict
);
int
(
*
gl_lstat
)
(
const
char
*
__restrict
,
void
*
__restrict
);
int
(
*
gl_stat
)
(
const
char
*
__restrict
,
void
*
__restrict
);
#endif
}
glob_t
;
...
...
@@ -133,13 +133,13 @@ typedef struct
# else
void
*
(
*
gl_readdir
)
(
void
*
);
# endif
void
*
(
*
gl_opendir
)
(
__
const
char
*
);
void
*
(
*
gl_opendir
)
(
const
char
*
);
# ifdef __USE_GNU
int
(
*
gl_lstat
)
(
__
const
char
*
__restrict
,
struct
stat64
*
__restrict
);
int
(
*
gl_stat
)
(
__
const
char
*
__restrict
,
struct
stat64
*
__restrict
);
int
(
*
gl_lstat
)
(
const
char
*
__restrict
,
struct
stat64
*
__restrict
);
int
(
*
gl_stat
)
(
const
char
*
__restrict
,
struct
stat64
*
__restrict
);
# else
int
(
*
gl_lstat
)
(
__
const
char
*
__restrict
,
void
*
__restrict
);
int
(
*
gl_stat
)
(
__
const
char
*
__restrict
,
void
*
__restrict
);
int
(
*
gl_lstat
)
(
const
char
*
__restrict
,
void
*
__restrict
);
int
(
*
gl_stat
)
(
const
char
*
__restrict
,
void
*
__restrict
);
# endif
}
glob64_t
;
#endif
...
...
@@ -158,24 +158,24 @@ typedef struct
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 || defined __GLOB_GNULIB
extern
int
glob
(
__
const
char
*
__restrict
__pattern
,
int
__flags
,
int
(
*
__errfunc
)
(
__
const
char
*
,
int
),
extern
int
glob
(
const
char
*
__restrict
__pattern
,
int
__flags
,
int
(
*
__errfunc
)
(
const
char
*
,
int
),
glob_t
*
__restrict
__pglob
)
__THROW
;
/* Free storage allocated in PGLOB by a previous `glob' call. */
extern
void
globfree
(
glob_t
*
__pglob
)
__THROW
;
#else
extern
int
__REDIRECT_NTH
(
glob
,
(
__
const
char
*
__restrict
__pattern
,
extern
int
__REDIRECT_NTH
(
glob
,
(
const
char
*
__restrict
__pattern
,
int
__flags
,
int
(
*
__errfunc
)
(
__
const
char
*
,
int
),
int
(
*
__errfunc
)
(
const
char
*
,
int
),
glob_t
*
__restrict
__pglob
),
glob64
);
extern
void
__REDIRECT_NTH
(
globfree
,
(
glob_t
*
__pglob
),
globfree64
);
#endif
#if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB
extern
int
glob64
(
__
const
char
*
__restrict
__pattern
,
int
__flags
,
int
(
*
__errfunc
)
(
__
const
char
*
,
int
),
extern
int
glob64
(
const
char
*
__restrict
__pattern
,
int
__flags
,
int
(
*
__errfunc
)
(
const
char
*
,
int
),
glob64_t
*
__restrict
__pglob
)
__THROW
;
extern
void
globfree64
(
glob64_t
*
__pglob
)
__THROW
;
...
...
@@ -188,7 +188,7 @@ extern void globfree64 (glob64_t *__pglob) __THROW;
This function is not part of the interface specified by POSIX.2
but several programs want to use it. */
extern
int
glob_pattern_p
(
__
const
char
*
__pattern
,
int
__quote
)
__THROW
;
extern
int
glob_pattern_p
(
const
char
*
__pattern
,
int
__quote
)
__THROW
;
#endif
__END_DECLS
...
...
mailbox/glob_.h
View file @
65b7700
/* glob_.h -- Find a path matching a pattern.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005
, 2006
Free Software Foundation, Inc.
Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
...
...
@@ -38,9 +38,6 @@
#ifndef __size_t
# define __size_t size_t
#endif
#ifndef __const
# define __const const
#endif
#ifndef __restrict
# define __restrict restrict
#endif
...
...
mailbox/md5.c
View file @
65b7700
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995,1996,1997,1999,2000,2001,2005
Copyright (C) 1995,1996,1997,1999,2000,2001,2005
,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
...
...
@@ -86,7 +86,7 @@ md5_init_ctx (struct md5_ctx *ctx)
must be in little endian byte order.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32
bits
value. */
aligned for a 32
-bit
value. */
void
*
md5_read_ctx
(
const
struct
md5_ctx
*
ctx
,
void
*
resbuf
)
{
...
...
@@ -102,7 +102,7 @@ md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
prolog according to the standard and write the result to RESBUF.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32
bits
value. */
aligned for a 32
-bit
value. */
void
*
md5_finish_ctx
(
struct
md5_ctx
*
ctx
,
void
*
resbuf
)
{
...
...
@@ -245,14 +245,8 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
if
(
len
>=
64
)
{
#if !_STRING_ARCH_unaligned
/* To check alignment gcc has an appropriate operator. Other
compilers don't. */
# if __GNUC__ >= 2
# define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint32_t) != 0)
# else
# define alignof(type) offsetof (struct { char c; type x; }, x)
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
# endif
if
(
UNALIGNED_P
(
buffer
))
while
(
len
>
64
)
{
...
...
mailbox/md5.h
View file @
65b7700
/* Declaration of functions and data types used for MD5 sum computing
library functions.
Copyright (C) 1995-1997,1999,2000,2001,2004,2005
Copyright (C) 1995-1997,1999,2000,2001,2004,2005
,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
...
...
@@ -44,12 +44,6 @@
# endif
#endif
#ifndef __attribute__
# if ! __GNUC_PREREQ (2,8) || __STRICT_ANSI__
# define __attribute__(x)
# endif
#endif
#ifndef _LIBC
# define __md5_buffer md5_buffer
# define __md5_finish_ctx md5_finish_ctx
...
...
mailbox/regex_internal.h
View file @
65b7700
/* Extended regular expression matching and search library.
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005
, 2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
...
...
@@ -182,6 +182,10 @@ typedef unsigned long int bitset_word;
# if BITSET_WORD_BITS <= SBC_MAX
# error "Invalid SBC_MAX"
# endif
#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff
/* Work around a bug in 64-bit PGC (before version 6.1-2), where the
preprocessor mishandles large unsigned values as if they were signed. */
# define BITSET_WORD_BITS 64
#else
# error "Add case for new bitset_word size"
#endif
...
...
mailbox/stdint_.h
View file @
65b7700
/* Copyright (C) 2001-2002, 2004-200
5
Free Software Foundation, Inc.
/* Copyright (C) 2001-2002, 2004-200
6
Free Software Foundation, Inc.
Written by Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
...
...
@@ -33,6 +33,12 @@
#if defined(__FreeBSD__)
# include <sys/inttypes.h>
#endif
#if defined(__linux__) && HAVE_SYS_BITYPES_H
/* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
included by <sys/types.h>. */
# include <sys/bitypes.h>
#endif
#if defined(__sun) && HAVE_SYS_INTTYPES_H
# include <sys/inttypes.h>
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
...
...
@@ -48,7 +54,7 @@
UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX. */
# define _STDINT_H_HAVE_SYSTEM_INTTYPES
#endif
#if !(
defined(UNIX_CYGWIN32
) && defined(__BIT_TYPES_DEFINED__))
#if !(
(defined(UNIX_CYGWIN32) || defined(__linux__)
) && defined(__BIT_TYPES_DEFINED__))
# define _STDINT_H_NEED_SIGNED_INT_TYPES
#endif
...
...
@@ -133,11 +139,19 @@ typedef unsigned long uintptr_t;
/* 7.18.1.5. Greatest-width integer types */
#ifdef _STDINT_H_HAVE_INT64
# ifndef intmax_t
typedef
int64_t
intmax_t
;
# endif
# ifndef uintmax_t
typedef
uint64_t
uintmax_t
;
# endif
#else
# ifndef intmax_t
typedef
int32_t
intmax_t
;
# endif
# ifndef uintmax_t
typedef
uint32_t
uintmax_t
;
# endif
#endif
/* 7.18.2. Limits of specified-width integer types */
...
...
@@ -230,8 +244,8 @@ typedef uint32_t uintmax_t;
#define SIG_ATOMIC_MIN 0
#define SIG_ATOMIC_MAX 127
#ifndef SIZE_MAX
# define SIZE_MAX (~(size_t)0)
#ifndef SIZE_MAX
/* SIZE_MAX may also be defined in config.h. */
# define SIZE_MAX (
(size_t)
~(size_t)0)
#endif
/* wchar_t limits already defined in <stddef.h>. */
...
...
mailbox/sysexit_.h
View file @
65b7700
/* exit() exit codes for some BSD system programs.
Copyright (C) 2003 Free Software Foundation, Inc.
Copyright (C) 2003
, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -20,6 +20,8 @@
#ifndef _SYSEXITS_H
#define _SYSEXITS_H
#define EX_OK 0
/* same value as EXIT_SUCCESS */
#define EX_USAGE 64
#define EX_DATAERR 65
#define EX_NOINPUT 66
...
...
Please
register
or
sign in
to post a comment