gwenhywfar
5.2.0
gwenhywfar5
gwenhywfar
args.h
Go to the documentation of this file.
1
/***************************************************************************
2
$RCSfile$
3
-------------------
4
cvs : $Id$
5
begin : Sat Apr 24 2004
6
copyright : (C) 2004 by Martin Preuss
7
email : martin@libchipcard.de
8
9
***************************************************************************
10
* *
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU Lesser General Public *
13
* License as published by the Free Software Foundation; either *
14
* version 2.1 of the License, or (at your option) any later version. *
15
* *
16
* This library is distributed in the hope that it will be useful, *
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* Lesser General Public License for more details. *
20
* *
21
* You should have received a copy of the GNU Lesser General Public *
22
* License along with this library; if not, write to the Free Software *
23
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24
* MA 02111-1307 USA *
25
* *
26
***************************************************************************/
27
28
#ifndef GWENHYWFAR_ARGS_H
29
#define GWENHYWFAR_ARGS_H
30
31
#include <
gwenhywfar/gwenhywfarapi.h
>
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
typedef
struct
GWEN_ARGS
GWEN_ARGS
;
37
#ifdef __cplusplus
38
}
39
#endif
40
41
#include <
gwenhywfar/types.h
>
42
#include <
gwenhywfar/buffer.h
>
43
#include <
gwenhywfar/db.h
>
44
45
#ifdef __cplusplus
46
extern
"C"
{
47
#endif
48
49
50
#define GWEN_ARGS_FLAGS_HAS_ARGUMENT 0x00000001
51
#define GWEN_ARGS_FLAGS_LAST 0x00000002
52
#define GWEN_ARGS_FLAGS_HELP 0x00000004
53
54
#define GWEN_ARGS_MODE_ALLOW_FREEPARAM 0x00000001
55
#define GWEN_ARGS_MODE_STOP_AT_FREEPARAM 0x00000002
56
57
#define GWEN_ARGS_RESULT_ERROR (-1)
58
#define GWEN_ARGS_RESULT_HELP (-2)
59
60
61
typedef
enum
{
62
GWEN_ArgsType_Char
=0,
63
GWEN_ArgsType_Int
64
}
65
GWEN_ARGS_TYPE
;
66
67
typedef
enum
{
68
GWEN_ArgsOutType_Txt
=0,
69
GWEN_ArgsOutType_Html
70
}
GWEN_ARGS_OUTTYPE
;
71
72
79
struct
GWEN_ARGS
{
80
uint32_t
flags
;
81
GWEN_ARGS_TYPE
type
;
82
const
char
*
name
;
83
unsigned
int
minNum
;
84
unsigned
int
maxNum
;
85
const
char
*
shortOption
;
86
const
char
*
longOption
;
87
const
char
*
shortDescription
;
88
const
char
*
longDescription
;
89
};
90
91
98
GWENHYWFAR_API
99
int
GWEN_Args_Check
(
int
argc,
char
**argv,
100
int
startAt,
101
uint32_t mode,
102
const
GWEN_ARGS
*args,
103
GWEN_DB_NODE
*db);
104
110
GWENHYWFAR_API
111
int
GWEN_Args_Usage
(
const
GWEN_ARGS
*args,
GWEN_BUFFER
*ubuf,
112
GWEN_ARGS_OUTTYPE
ot);
113
115
GWENHYWFAR_API
116
int
GWEN_Args_ShortUsage
(
const
GWEN_ARGS
*args,
GWEN_BUFFER
*ubuf,
117
GWEN_ARGS_OUTTYPE
ot);
118
119
#ifdef __cplusplus
120
}
121
#endif
122
123
124
#endif
/* GWENHYWFAR_ARGS_H */
125
126
127
GWEN_ArgsType_Int
Definition:
args.h:62
types.h
GWEN_ARGS::maxNum
unsigned int maxNum
Definition:
args.h:83
GWEN_ARGS::longOption
const char * longOption
Definition:
args.h:85
GWEN_ARGS::shortDescription
const char * shortDescription
Definition:
args.h:86
GWEN_Args_ShortUsage
GWENHYWFAR_API int GWEN_Args_ShortUsage(const GWEN_ARGS *args, GWEN_BUFFER *ubuf, GWEN_ARGS_OUTTYPE ot)
GWEN_ARGS::minNum
unsigned int minNum
Definition:
args.h:82
db.h
GWEN_ArgsOutType_Html
Definition:
args.h:68
GWEN_ArgsOutType_Txt
Definition:
args.h:67
GWEN_ARGS
Definition:
args.h:78
GWEN_ARGS::longDescription
const char * longDescription
Definition:
args.h:87
GWEN_ArgsType_Char
Definition:
args.h:61
buffer.h
GWEN_Args_Check
GWENHYWFAR_API int GWEN_Args_Check(int argc, char **argv, int startAt, uint32_t mode, const GWEN_ARGS *args, GWEN_DB_NODE *db)
GWEN_ARGS::flags
uint32_t flags
Definition:
args.h:79
GWEN_ARGS::type
GWEN_ARGS_TYPE type
Definition:
args.h:80
GWEN_Args_Usage
GWENHYWFAR_API int GWEN_Args_Usage(const GWEN_ARGS *args, GWEN_BUFFER *ubuf, GWEN_ARGS_OUTTYPE ot)
gwenhywfarapi.h
GWEN_ARGS::name
const char * name
Definition:
args.h:81
GWEN_DB_NODE
struct GWEN_DB_NODE GWEN_DB_NODE
Definition:
db.h:227
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition:
gwenhywfarapi.h:66
GWEN_ARGS_TYPE
GWEN_ARGS_TYPE
Definition:
args.h:60
GWEN_BUFFER
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition:
buffer.h:37
GWEN_ARGS::shortOption
const char * shortOption
Definition:
args.h:84
GWEN_ARGS_OUTTYPE
GWEN_ARGS_OUTTYPE
Definition:
args.h:66
Generated by
1.8.16