~ubuntu-branches/ubuntu/gutsy/findutils/gutsy-proposed

« back to all changes in this revision

Viewing changes to gnulib/lib/argmatch.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050704113737-ll89ui8be35r0pir
Tags: 4.2.22-2
* Remove locatedb on purge. (Closes: #315343)
* revert regex-syntax back to emacs-re. (Closes: #315136) Future versions
  will allow to select this by commandline parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* argmatch.h -- definitions and prototypes for argmatch.c
2
 
   Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
 
2
 
 
3
   Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004 Free Software
 
4
   Foundation, Inc.
3
5
 
4
6
   This program is free software; you can redistribute it and/or modify
5
7
   it under the terms of the GNU General Public License as published by
13
15
 
14
16
   You should have received a copy of the GNU General Public License
15
17
   along with this program; if not, write to the Free Software Foundation,
16
 
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
18
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17
19
 
18
20
/* Written by David MacKenzie <djm@ai.mit.edu>
19
21
   Modified by Akim Demaille <demaille@inf.enst.fr> */
47
49
   false ambiguities (i.e., different matches of ARG but corresponding
48
50
   to the same values in VALLIST).  */
49
51
 
50
 
int argmatch (char const *arg, char const *const *arglist,
51
 
              char const *vallist, size_t valsize);
 
52
ptrdiff_t argmatch (char const *arg, char const *const *arglist,
 
53
                    char const *vallist, size_t valsize);
52
54
 
53
55
# define ARGMATCH(Arg, Arglist, Vallist) \
54
56
  argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist))
55
57
 
56
58
/* xargmatch calls this function when it fails.  This function should not
57
59
   return.  By default, this is a function that calls ARGMATCH_DIE which
58
 
   in turn defaults to `exit (EXIT_FAILURE)'.  */
 
60
   in turn defaults to `exit (exit_failure)'.  */
59
61
typedef void (*argmatch_exit_fn) (void);
60
62
extern argmatch_exit_fn argmatch_die;
61
63
 
62
64
/* Report on stderr why argmatch failed.  Report correct values. */
63
65
 
64
 
void argmatch_invalid (char const *context, char const *value, int problem);
 
66
void argmatch_invalid (char const *context, char const *value,
 
67
                       ptrdiff_t problem);
65
68
 
66
69
/* Left for compatibility with the old name invalid_arg */
67
70
 
83
86
/* Same as argmatch, but upon failure, reports a explanation on the
84
87
   failure, and exits using the function EXIT_FN. */
85
88
 
86
 
int __xargmatch_internal (char const *context,
87
 
                          char const *arg, char const *const *arglist,
88
 
                          char const *vallist, size_t valsize,
89
 
                          argmatch_exit_fn exit_fn);
 
89
ptrdiff_t __xargmatch_internal (char const *context,
 
90
                                char const *arg, char const *const *arglist,
 
91
                                char const *vallist, size_t valsize,
 
92
                                argmatch_exit_fn exit_fn);
90
93
 
91
94
/* Programmer friendly interface to __xargmatch_internal. */
92
95