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_action_configparser.h
5 * Header file for the parser for action config files.
8 #ifndef SDL_visualtest_action_configparser_h_
9 #define SDL_visualtest_action_configparser_h_
11 /** The maximum length of one line in the actions file */
12 #define MAX_ACTION_LINE_LENGTH 300
14 /* Set up for C function definitions, even when using C++ */
24 /*! Launch an application with some given arguments */
25 SDL_ACTION_LAUNCH = 0,
26 /*! Kill the SUT process */
28 /*! Quit (Gracefully exit) the SUT process */
30 /*! Take a screenshot of the SUT window */
31 SDL_ACTION_SCREENSHOT,
32 /*! Verify a previously taken screenshot */
34 } SDLVisualTest_ActionType;
37 * Struct that defines an action that will be performed on the SUT process at
40 typedef struct SDLVisualTest_Action
42 /*! The type of action to be performed */
43 SDLVisualTest_ActionType type;
44 /*! The time, in milliseconds from the launch of the SUT, when the action
47 /*! Any additional information needed to perform the action. */
50 /*! The path and arguments to the process to be launched */
57 } SDLVisualTest_Action;
60 * Struct for a node in the action queue.
62 typedef struct SDLVisualTest_ActionNode
64 /*! The action in this node */
65 SDLVisualTest_Action action;
66 /*! Pointer to the next element in the queue */
67 struct SDLVisualTest_ActionNode* next;
68 } SDLVisualTest_ActionNode;
71 * Queue structure for actions loaded from the actions config file.
73 typedef struct SDLVisualTest_ActionQueue
75 /*! Pointer to the front of the queue */
76 SDLVisualTest_ActionNode* front;
77 /*! Pointer to the rear of the queue */
78 SDLVisualTest_ActionNode* rear;
79 /*! Number of nodes in the queue */
81 } SDLVisualTest_ActionQueue;
84 * Add an action pointed to by \c action to the rear of the action queue pointed
87 * \return 1 on success, 0 on failure.
89 int SDLVisualTest_EnqueueAction(SDLVisualTest_ActionQueue* queue,
90 SDLVisualTest_Action action);
93 * Remove an action from the front of the action queue pointed to by \c queue.
95 * \return 1 on success, 0 on failure.
97 int SDLVisualTest_DequeueAction(SDLVisualTest_ActionQueue* queue);
100 * Initialize the action queue pointed to by \c queue.
102 void SDLVisualTest_InitActionQueue(SDLVisualTest_ActionQueue* queue);
105 * Get the action at the front of the action queue pointed to by \c queue.
106 * The returned action pointer may become invalid after subsequent dequeues.
108 * \return pointer to the action on success, NULL on failure.
110 SDLVisualTest_Action* SDLVisualTest_GetQueueFront(SDLVisualTest_ActionQueue* queue);
113 * Check if the queue pointed to by \c queue is empty or not.
115 * \return 1 if the queue is empty, 0 otherwise.
117 int SDLVisualTest_IsActionQueueEmpty(SDLVisualTest_ActionQueue* queue);
120 * Dequeues all the elements in the queque pointed to by \c queue.
122 void SDLVisualTest_EmptyActionQueue(SDLVisualTest_ActionQueue* queue);
125 * Inserts an action \c action into the queue pointed to by \c queue such that
126 * the times of actions in the queue increase as we move from the front to the
129 * \return 1 on success, 0 on failure.
131 int SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue,
132 SDLVisualTest_Action action);
135 * Parses an action config file with path \c file and populates an action queue
136 * pointed to by \c queue with actions.
138 * \return 1 on success, 0 on failure.
140 int SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue);
142 /* Ends C function definitions when using C++ */
147 #endif /* SDL_visualtest_action_configparser_h_ */
149 /* vi: set ts=4 sw=4 expandtab: */