rasdaman API
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
raslib
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
OPT_FLAG
Definition:
shhopt.h:30
optStruct::type
optArgType type
Definition:
shhopt.h:44
OPT_END
Definition:
shhopt.h:29
OPT_LONG
Definition:
shhopt.h:34
OPT_ULONG
Definition:
shhopt.h:35
optStruct::shortName
char shortName
Definition:
shhopt.h:42
OPT_UINT
Definition:
shhopt.h:33
optStruct::flags
int flags
Definition:
shhopt.h:47
optStruct
Definition:
shhopt.h:41
optParseOptions
void optParseOptions(int *argc, char *argv[], optStruct opt[], int allowNegNum)
optArgType
optArgType
Definition:
shhopt.h:28
optStruct::arg
void * arg
Definition:
shhopt.h:45
optSetFatalFunc
void optSetFatalFunc(void(*f)(const char *,...))
OPT_STRING
Definition:
shhopt.h:31
OPT_INT
Definition:
shhopt.h:32
optStruct::longName
char * longName
Definition:
shhopt.h:43
Generated on Sat Mar 7 2015 23:10:35 for rasdaman API by
1.8.8