source: git/src/cmdline.h @ af89ae7

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Last change on this file since af89ae7 was 66711f2, checked in by Olly Betts <olly@…>, 23 years ago

Fixed typo.

git-svn-id: file:///home/survex-svn/survex/trunk@1410 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/* cmdline.h
2 * Wrapper for GNU getopt which deals with standard options
3 * Copyright (C) 1998-2001 Olly Betts
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20#ifndef CMDLINE_H
21# define CMDLINE_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include "getopt.h"
28
29struct help_msg {
30   int opt;
31   const char *msg;
32};
33
34/* give -1 for max_args_ if there's no limit */
35void cmdline_init(int argc_, char *const *argv_, const char *shortopts_,
36                  const struct option *longopts_, int *longind_,
37                  const struct help_msg *help_,
38                  int min_args_, int max_args_);
39/* if args not NULL, use instead of auto-generated FILE args */
40/* if extra not NULL, display as extra blurb at end */
41void cmdline_set_syntax_message(const char *args, const char *extra);
42int cmdline_getopt(void);
43void cmdline_help(void);
44void cmdline_version(void);
45void cmdline_syntax(void);
46void cmdline_too_few_args(void);
47void cmdline_too_many_args(void);
48int cmdline_int_arg(void);
49double cmdline_double_arg(void);
50
51#define HLP_ENCODELONG(N) (-(N + 1))
52#define HLP_DECODELONG(N) (-(N + 1))
53#define HLP_ISLONG(N) ((N) <= 0)
54#define HLP_HELP 30000
55#define HLP_VERSION 30001
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif
Note: See TracBrowser for help on using the repository browser.