4 * Command line parsing routines
6 * See Copyright for the status of this software.
8 * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
10 #ifndef __XMLSEC_APPS_CMDLINE_H__
11 #define __XMLSEC_APPS_CMDLINE_H__
15 #endif /* __cplusplus */
19 typedef struct _xmlSecAppCmdLineParam xmlSecAppCmdLineParam,
20 *xmlSecAppCmdLineParamPtr;
21 typedef struct _xmlSecAppCmdLineValue xmlSecAppCmdLineValue,
22 *xmlSecAppCmdLineValuePtr;
23 typedef unsigned int xmlSecAppCmdLineParamTopic;
25 #define xmlSecAppCmdLineParamFlagNone 0x0000
26 #define xmlSecAppCmdLineParamFlagParamNameValue 0x0001
27 #define xmlSecAppCmdLineParamFlagMultipleValues 0x0002
30 xmlSecAppCmdLineParamTypeFlag,
31 xmlSecAppCmdLineParamTypeString,
32 xmlSecAppCmdLineParamTypeStringList,
33 xmlSecAppCmdLineParamTypeNumber,
34 xmlSecAppCmdLineParamTypeTime
35 } xmlSecAppCmdLineParamType;
37 struct _xmlSecAppCmdLineParam {
38 xmlSecAppCmdLineParamTopic topics;
40 const char* shortName;
42 xmlSecAppCmdLineParamType type;
44 xmlSecAppCmdLineValuePtr value;
47 int xmlSecAppCmdLineParamIsSet (xmlSecAppCmdLineParamPtr param);
48 const char* xmlSecAppCmdLineParamGetString (xmlSecAppCmdLineParamPtr param);
49 const char* xmlSecAppCmdLineParamGetStringList (xmlSecAppCmdLineParamPtr param);
50 int xmlSecAppCmdLineParamGetInt (xmlSecAppCmdLineParamPtr param,
52 time_t xmlSecAppCmdLineParamGetTime (xmlSecAppCmdLineParamPtr param,
55 int xmlSecAppCmdLineParamsListParse (xmlSecAppCmdLineParamPtr* params,
56 xmlSecAppCmdLineParamTopic topcis,
60 void xmlSecAppCmdLineParamsListClean (xmlSecAppCmdLineParamPtr* params);
61 void xmlSecAppCmdLineParamsListPrint (xmlSecAppCmdLineParamPtr* params,
62 xmlSecAppCmdLineParamTopic topic,
65 struct _xmlSecAppCmdLineValue {
66 xmlSecAppCmdLineParamPtr param;
68 const char* paramNameValue;
70 const char* strListValue;
73 xmlSecAppCmdLineValuePtr next;
77 xmlSecAppCmdLineValuePtr xmlSecAppCmdLineValueCreate (xmlSecAppCmdLineParamPtr param,
79 void xmlSecAppCmdLineValueDestroy (xmlSecAppCmdLineValuePtr value);
84 #endif /* __cplusplus */
86 #endif /* __XMLSEC_APPS_CMDLINE_H__ */