Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1.29 KB

SDL_visualtest_parsehelper.h

File metadata and controls

46 lines (39 loc) · 1.29 KB
 
1
2
3
4
5
6
7
/* See COPYING.txt for the full license governing this code. */
/**
* \file SDL_visualtest_parsehelper.h
*
* Header with some helper functions for parsing strings.
*/
Aug 28, 2017
Aug 28, 2017
8
9
#ifndef SDL_visualtest_parsehelper_h_
#define SDL_visualtest_parsehelper_h_
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* Takes an string of command line arguments and breaks them up into an array
* based on whitespace.
*
* \param args The string of arguments.
*
* \return NULL on failure, an array of strings on success. The last element
* of the array is NULL. The first element of the array is NULL and should
* be set to the path of the executable by the caller.
*/
char** SDLVisualTest_ParseArgsToArgv(char* args);
/**
* Takes a string and breaks it into tokens by splitting on whitespace.
*
* \param str The string to be split.
* \param max_token_len Length of each element in the array to be returned.
*
* \return NULL on failure; an array of strings with the tokens on success. The
* last element of the array is NULL.
*/
char** SDLVisualTest_Tokenize(char* str, int max_token_len);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
Aug 28, 2017
Aug 28, 2017
44
45
46
#endif /* SDL_visualtest_parsehelper_h_ */
/* vi: set ts=4 sw=4 expandtab: */