visualtest/include/SDL_visualtest_parsehelper.h
author Ozkan Sezer <sezeroz@gmail.com>
Wed, 26 Sep 2018 20:47:34 +0300
changeset 12230 162b6f94df3a
parent 11382 2c50e79b19e0
permissions -rw-r--r--
SDL_string.c: added comments to three SDL_FormatInfo members.
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
slouken@11382
     8
#ifndef SDL_visualtest_parsehelper_h_
slouken@11382
     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
slouken@11382
    44
#endif /* SDL_visualtest_parsehelper_h_ */
slouken@11382
    45
slouken@11382
    46
/* vi: set ts=4 sw=4 expandtab: */