00001 /* Orx - Portable Game Engine 00002 * 00003 * Copyright (c) 2008-2011 Orx-Project 00004 * 00005 * This software is provided 'as-is', without any express or implied 00006 * warranty. In no event will the authors be held liable for any damages 00007 * arising from the use of this software. 00008 * 00009 * Permission is granted to anyone to use this software for any purpose, 00010 * including commercial applications, and to alter it and redistribute it 00011 * freely, subject to the following restrictions: 00012 * 00013 * 1. The origin of this software must not be misrepresented; you must not 00014 * claim that you wrote the original software. If you use this software 00015 * in a product, an acknowledgment in the product documentation would be 00016 * appreciated but is not required. 00017 * 00018 * 2. Altered source versions must be plainly marked as such, and must not be 00019 * misrepresented as being the original software. 00020 * 00021 * 3. This notice may not be removed or altered from any source 00022 * distribution. 00023 */ 00024 00043 #ifndef _orxPARAM_H_ 00044 #define _orxPARAM_H_ 00045 00046 00047 #include "orxInclude.h" 00048 00049 00050 /* Macro definition */ 00051 00052 /* Flags definitions */ 00053 #define orxPARAM_KU32_FLAG_NONE 0x00000000 00054 #define orxPARAM_KU32_FLAG_MULTIPLE_ALLOWED 0x00000001 00055 #define orxPARAM_KU32_FLAG_STOP_ON_ERROR 0x00000002 00062 typedef orxSTATUS (orxFASTCALL *orxPARAM_INIT_FUNCTION)(orxU32 _u32NbParam, const orxSTRING _azParams[]); 00063 00064 /* Parameter's info */ 00065 typedef struct __orxPARAM_t 00066 { 00067 /* Flags associated to the parameters' parser */ 00068 orxU32 u32Flags; 00069 00070 /* Short parameter name (ex: "h" for help (will be -h)) */ 00071 const orxSTRING zShortName; 00072 00073 /* Long parameter name (ex: "help" for help (will be --help)) */ 00074 const orxSTRING zLongName; 00075 00076 /* Short description (ex: "shows params' list") */ 00077 const orxSTRING zShortDesc; 00078 00079 /* Long description (ex: "Display the list of parameters. 00080 * -help <param> displays the <param> long description") */ 00081 const orxSTRING zLongDesc; 00082 00083 /* Function called when the parameter is detected in the command line */ 00084 orxPARAM_INIT_FUNCTION pfnParser; 00085 00086 } orxPARAM; 00087 00088 00091 extern orxDLLAPI void orxFASTCALL orxParam_Setup(); 00092 00096 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_Init(); 00097 00100 extern orxDLLAPI void orxFASTCALL orxParam_Exit(); 00101 00102 00107 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_Register(const orxPARAM *_pstParam); 00108 00112 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_DisplayHelp(); 00113 00119 extern orxDLLAPI orxSTATUS orxFASTCALL orxParam_SetArgs(orxU32 _u32NbParams, orxSTRING _azParams[]); 00120 00121 #endif /* _orxPARAM_H_ */ 00122
1.5.6