src/SDL_hints.c
author Sam Lantinga <slouken@libsdl.org>
Fri, 15 Feb 2013 08:47:44 -0800
changeset 6885 700f1b25f77f
parent 6389 43a190ad60a7
child 7191 75360622e65f
permissions -rw-r--r--
Happy New Year!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
     2
  Simple DirectMedia Layer
6885
700f1b25f77f Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6389
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
     7
  arising from the use of this software.
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    11
  freely, subject to the following restrictions:
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5273
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
#include "SDL_config.h"
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
#include "SDL_hints.h"
5555
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    24
#include "SDL_hints_c.h"
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
/* Assuming there aren't many hints set and they aren't being queried in
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
   critical performance paths, we'll just use a linked list here.
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
 */
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
typedef struct SDL_Hint {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
    char *name;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
    char *value;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
    SDL_HintPriority priority;
5555
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    34
    SDL_HintChangedCb callback;
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
    struct SDL_Hint *next;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
} SDL_Hint;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
static SDL_Hint *SDL_hints;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
5555
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    40
SDL_bool
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    41
SDL_RegisterHintChangedCb(const char *name, SDL_HintChangedCb hintCb)
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    42
{
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    43
    SDL_Hint *hint;
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    44
	
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    45
    for (hint = SDL_hints; hint; hint = hint->next) {
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    46
        if (SDL_strcmp(name, hint->name) == 0) {
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    47
            hint->callback = hintCb;
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    48
            return SDL_TRUE;
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    49
        }
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    50
    }
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    51
	
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    52
    return SDL_FALSE;
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    53
}
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
SDL_bool
5200
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
    56
SDL_SetHintWithPriority(const char *name, const char *value,
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
    57
                        SDL_HintPriority priority)
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
{
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
    const char *env;
6389
43a190ad60a7 Removed some unused variables that gcc 4.6.1 complains about.
Ryan C. Gordon <icculus@icculus.org>
parents: 6138
diff changeset
    60
    SDL_Hint *hint;
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
    if (!name || !value) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    63
        return SDL_FALSE;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
    }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    65
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    66
    env = SDL_getenv(name);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
    if (env && priority < SDL_HINT_OVERRIDE) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
        return SDL_FALSE;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
    }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
6389
43a190ad60a7 Removed some unused variables that gcc 4.6.1 complains about.
Ryan C. Gordon <icculus@icculus.org>
parents: 6138
diff changeset
    71
    for (hint = SDL_hints; hint; hint = hint->next) {
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
        if (SDL_strcmp(name, hint->name) == 0) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
            if (priority < hint->priority) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
                return SDL_FALSE;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
            }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    76
            if (SDL_strcmp(hint->value, value) != 0) {
5555
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    77
                if (hint->callback != NULL) {
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    78
                    (*hint->callback)(name, hint->value, value);
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    79
                }
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    80
                SDL_free(hint->value);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
                hint->value = SDL_strdup(value);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    82
            }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
            hint->priority = priority;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    84
            return SDL_TRUE;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    85
        }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    86
    }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
    /* Couldn't find the hint, add a new one */
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
    hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    90
    if (!hint) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    91
        return SDL_FALSE;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    92
    }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    93
    hint->name = SDL_strdup(name);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    94
    hint->value = SDL_strdup(value);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
    hint->priority = priority;
5555
3ecad5e5dbe4 * SDL_IOS_IDLE_TIMER_DISABLED hint
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 5535
diff changeset
    96
    hint->callback = NULL;
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
    hint->next = SDL_hints;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
    SDL_hints = hint;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    99
    return SDL_TRUE;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   100
}
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   101
5200
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
   102
SDL_bool
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
   103
SDL_SetHint(const char *name, const char *value)
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
   104
{
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
   105
    return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL);
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
   106
}
01bced9a4cc1 Created a simpler version of SDL_SetHint() that doesn't need a priority.
Sam Lantinga <slouken@libsdl.org>
parents: 5189
diff changeset
   107
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   108
const char *
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   109
SDL_GetHint(const char *name)
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   110
{
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   111
    const char *env;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   112
    SDL_Hint *hint;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   113
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   114
    env = SDL_getenv(name);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   115
    for (hint = SDL_hints; hint; hint = hint->next) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   116
        if (SDL_strcmp(name, hint->name) == 0) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   117
            if (!env || hint->priority == SDL_HINT_OVERRIDE) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   118
                return hint->value;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   119
            }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   120
            break;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   121
        }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   122
    }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   123
    return env;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   124
}
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   125
5273
151f40ed9e55 This should match the header change.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   126
void SDL_ClearHints(void)
5189
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   127
{
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   128
    SDL_Hint *hint;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   129
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   130
    while (SDL_hints) {
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   131
        hint = SDL_hints;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   132
        SDL_hints = hint->next;
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   133
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   134
        SDL_free(hint->name);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   135
        SDL_free(hint->value);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   136
        SDL_free(hint);
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   137
    }
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   138
}
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   139
6f6a9340fb93 Added a hint system to allow configuration hints to be specified by the application.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   140
/* vi: set ts=4 sw=4 expandtab: */