rasdaman complete source
shhopt.h
Go to the documentation of this file.
1 /*
2  * This file is part of rasdaman community.
3  *
4  * Rasdaman community is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Rasdaman community is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH.
18  *
19  * For more information please see <http://www.rasdaman.org>
20  * or contact Peter Baumann via <baumann@rasdaman.com>.
21 */
22 
23 /* $Id: shhopt.h,v 1.4 2000/09/20 14:41:56 widmann Exp $ */
24 #ifndef SHHOPT_H
25 #define SHHOPT_H
26 
27 /* constants for recognized option types. */
28 typedef enum {
29  OPT_END, /* nothing. used as ending element. */
30  OPT_FLAG, /* no argument following. sets variable to 1. */
31  OPT_STRING, /* string argument. */
32  OPT_INT, /* signed integer argument. */
33  OPT_UINT, /* unsigned integer argument. */
34  OPT_LONG, /* signed long integer argument. */
35  OPT_ULONG /* unsigned long integer argument. */
36 } optArgType;
37 
38 /* flags modifying the default way options are handeled. */
39 #define OPT_CALLFUNC 1 /* pass argument to a function. */
40 
41 typedef struct {
42  char shortName; /* Short option name. */
43  char *longName; /* Long option name, no including '--'. */
44  optArgType type; /* Option type. */
45  void *arg; /* Pointer to variable to fill with argument,
46  * or pointer to function if Type == OPT_FUNC. */
47  int flags; /* Modifier flags. */
48 } optStruct;
49 
50 
51 void optSetFatalFunc(void (*f)(const char *, ...));
52 void optParseOptions(int *argc, char *argv[],
53  optStruct opt[], int allowNegNum);
54 
55 #endif
Definition: shhopt.h:30
optArgType type
Definition: shhopt.h:44
Definition: shhopt.h:29
Definition: shhopt.h:34
Definition: shhopt.h:35
char shortName
Definition: shhopt.h:42
Definition: shhopt.h:33
int flags
Definition: shhopt.h:47
Definition: shhopt.h:41
void optParseOptions(int *argc, char *argv[], optStruct opt[], int allowNegNum)
optArgType
Definition: shhopt.h:28
void * arg
Definition: shhopt.h:45
void optSetFatalFunc(void(*f)(const char *,...))
Definition: shhopt.h:31
Definition: shhopt.h:32
char * longName
Definition: shhopt.h:43