SDL.c (SDL_ExitProcess): unconstify its param to match its declaration.
1 /* See COPYING.txt for the full license governing this code. */
3 * \file SDL_visualtest_sut_configparser.h
5 * Header for the parser for SUT config files.
8 #ifndef SDL_visualtest_sut_configparser_h_
9 #define SDL_visualtest_sut_configparser_h_
11 /** Maximum length of the name of an SUT option */
12 #define MAX_SUTOPTION_NAME_LEN 100
13 /** Maximum length of the name of a category of an SUT option */
14 #define MAX_SUTOPTION_CATEGORY_LEN 40
15 /** Maximum length of one enum value of an SUT option */
16 #define MAX_SUTOPTION_ENUMVAL_LEN 40
17 /** Maximum length of a line in the paramters file */
18 #define MAX_SUTOPTION_LINE_LENGTH 256
20 /* Set up for C function definitions, even when using C++ */
26 * Describes the different kinds of options to the SUT.
29 SDL_SUT_OPTIONTYPE_STRING = 0,
30 SDL_SUT_OPTIONTYPE_INT,
31 SDL_SUT_OPTIONTYPE_ENUM,
32 SDL_SUT_OPTIONTYPE_BOOL
33 } SDLVisualTest_SUTOptionType;
36 * Represents the range of values an integer option can take.
38 typedef struct SDLVisualTest_SUTIntRange {
39 /*! Minimum value of the integer option */
41 /*! Maximum value of the integer option */
43 } SDLVisualTest_SUTIntRange;
46 * Struct that defines an option to be passed to the SUT.
48 typedef struct SDLVisualTest_SUTOption {
49 /*! The name of the option. This is what you would pass in the command line
50 along with two leading hyphens. */
51 char name[MAX_SUTOPTION_NAME_LEN];
52 /*! An array of categories that the option belongs to. The last element is
55 /*! Type of the option - integer, boolean, etc. */
56 SDLVisualTest_SUTOptionType type;
57 /*! Whether the option is required or not */
59 /*! extra data that is required for certain types */
61 /*! This field is valid only for integer type options; it defines the
62 valid range for such an option */
63 SDLVisualTest_SUTIntRange range;
64 /*! This field is valid only for enum type options; it holds the list of values
65 that the option can take. The last element is NULL */
68 } SDLVisualTest_SUTOption;
71 * Struct to hold all the options to an SUT application.
73 typedef struct SDLVisualTest_SUTConfig
75 /*! Pointer to an array of options */
76 SDLVisualTest_SUTOption* options;
77 /*! Number of options in \c options */
79 } SDLVisualTest_SUTConfig;
82 * Parses a configuration file that describes the command line options an SUT
83 * application will take and populates a SUT config object. All lines in the
84 * config file must be smaller than
86 * \param file Path to the configuration file.
87 * \param config Pointer to an object that represents an SUT configuration.
89 * \return zero on failure, non-zero on success
91 int SDLVisualTest_ParseSUTConfig(char* file, SDLVisualTest_SUTConfig* config);
94 * Free any resources associated with the config object pointed to by \c config.
96 void SDLVisualTest_FreeSUTConfig(SDLVisualTest_SUTConfig* config);
98 /* Ends C function definitions when using C++ */
103 #endif /* SDL_visualtest_sut_configparser_h_ */
105 /* vi: set ts=4 sw=4 expandtab: */