visualtest/include/SDL_visualtest_parsehelper.h
author Ryan C. Gordon
Tue, 24 Jan 2017 00:03:36 -0500
changeset 10841 b9d6a3d65394
parent 7924 fcb86d323770
child 11382 2c50e79b19e0
permissions -rw-r--r--
audio: Fixed off-by-one error in upsampling.
icculus@7924
     1
/* See COPYING.txt for the full license governing this code. */
icculus@7924
     2
/**
icculus@7924
     3
 * \file SDL_visualtest_parsehelper.h
icculus@7924
     4
 *
icculus@7924
     5
 * Header with some helper functions for parsing strings.
icculus@7924
     6
 */
icculus@7924
     7
icculus@7924
     8
#ifndef _SDL_visualtest_parsehelper_h
icculus@7924
     9
#define _SDL_visualtest_parsehelper_h
icculus@7924
    10
icculus@7924
    11
/* Set up for C function definitions, even when using C++ */
icculus@7924
    12
#ifdef __cplusplus
icculus@7924
    13
extern "C" {
icculus@7924
    14
#endif
icculus@7924
    15
icculus@7924
    16
/**
icculus@7924
    17
 * Takes an string of command line arguments and breaks them up into an array
icculus@7924
    18
 * based on whitespace.
icculus@7924
    19
 *
icculus@7924
    20
 * \param args The string of arguments.
icculus@7924
    21
 *
icculus@7924
    22
 * \return NULL on failure, an array of strings on success. The last element
icculus@7924
    23
 *         of the array is NULL. The first element of the array is NULL and should
icculus@7924
    24
 *         be set to the path of the executable by the caller.
icculus@7924
    25
 */
icculus@7924
    26
char** SDLVisualTest_ParseArgsToArgv(char* args);
icculus@7924
    27
icculus@7924
    28
/**
icculus@7924
    29
 * Takes a string and breaks it into tokens by splitting on whitespace.
icculus@7924
    30
 *
icculus@7924
    31
 * \param str The string to be split.
icculus@7924
    32
 * \param max_token_len Length of each element in the array to be returned.
icculus@7924
    33
 *
icculus@7924
    34
 * \return NULL on failure; an array of strings with the tokens on success. The
icculus@7924
    35
 *         last element of the array is NULL.
icculus@7924
    36
 */
icculus@7924
    37
char** SDLVisualTest_Tokenize(char* str, int max_token_len);
icculus@7924
    38
icculus@7924
    39
/* Ends C function definitions when using C++ */
icculus@7924
    40
#ifdef __cplusplus
icculus@7924
    41
}
icculus@7924
    42
#endif
icculus@7924
    43
icculus@7924
    44
#endif /* _SDL_visualtest_parsehelper_h */