orx  stable
Portable Game Engine
orxParam.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxPARAM_H_
44 #define _orxPARAM_H_
45 
46 
47 #include "orxInclude.h"
48 
49 
50 /* Macro definition */
51 
52 /* Flags definitions */
53 #define orxPARAM_KU32_FLAG_NONE 0x00000000
54 #define orxPARAM_KU32_FLAG_MULTIPLE_ALLOWED 0x00000001
55 #define orxPARAM_KU32_FLAG_STOP_ON_ERROR 0x00000002
62 typedef orxSTATUS (orxFASTCALL *orxPARAM_INIT_FUNCTION)(orxU32 _u32NbParam, const orxSTRING _azParams[]);
63 
64 /* Parameter's info */
65 typedef struct __orxPARAM_t
66 {
67  /* Flags associated to the parameters' parser */
68  orxU32 u32Flags;
69 
70  /* Short parameter name (ex: "h" for help (will be -h)) */
71  const orxSTRING zShortName;
72 
73  /* Long parameter name (ex: "help" for help (will be --help)) */
74  const orxSTRING zLongName;
75 
76  /* Short description (ex: "shows params' list") */
77  const orxSTRING zShortDesc;
78 
79  /* Long description (ex: "Display the list of parameters.
80  * -help <param> displays the <param> long description") */
81  const orxSTRING zLongDesc;
82 
83  /* Function called when the parameter is detected in the command line */
85 
86 } orxPARAM;
87 
88 
91 extern orxDLLAPI void orxFASTCALL orxParam_Setup();
92 
96 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_Init();
97 
100 extern orxDLLAPI void orxFASTCALL orxParam_Exit();
101 
102 
107 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_Register(const orxPARAM *_pstParam);
108 
112 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_DisplayHelp();
113 
119 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_SetArgs(orxU32 _u32NbParams, orxSTRING _azParams[]);
120 
121 #endif /* _orxPARAM_H_ */
122 
orxDLLAPI void orxFASTCALL orxParam_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxParam_Register(const orxPARAM *_pstParam)
const orxSTRING zLongDesc
Definition: orxParam.h:81
orxDLLAPI void orxFASTCALL orxParam_Exit()
orxPARAM_INIT_FUNCTION pfnParser
Definition: orxParam.h:84
orxDLLAPI orxSTATUS orxFASTCALL orxParam_SetArgs(orxU32 _u32NbParams, orxSTRING _azParams[])
orxDLLAPI orxSTATUS orxFASTCALL orxParam_Init()
orxDLLAPI orxSTATUS orxFASTCALL orxParam_DisplayHelp()
orxSTATUS
Definition: orxType.h:243
#define orxDLLAPI
Definition: orxDecl.h:387
const orxSTRING zShortDesc
Definition: orxParam.h:77
orxU32 u32Flags
Definition: orxParam.h:68
const orxSTRING zShortName
Definition: orxParam.h:71
orxSTATUS(orxFASTCALL * orxPARAM_INIT_FUNCTION)(orxU32 _u32NbParam, const orxSTRING _azParams[])
Definition: orxParam.h:62
const orxSTRING zLongName
Definition: orxParam.h:74

Generated for orx by doxygen 1.5.6