zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_hints.c File Reference
#include "SDL_config.h"
#include "SDL_hints.h"
#include "SDL_error.h"

Go to the source code of this file.

Typedefs

typedef struct SDL_Hint SDL_Hint
 
typedef struct SDL_HintWatch SDL_HintWatch
 

Functions

void SDL_AddHintCallback (const char *name, SDL_HintCallback callback, void *userdata)
 
void SDL_ClearHints (void)
 Clear all hints. More...
 
void SDL_DelHintCallback (const char *name, SDL_HintCallback callback, void *userdata)
 Remove a function watching a particular hint. More...
 
const char * SDL_GetHint (const char *name)
 Get a hint. More...
 
SDL_bool SDL_SetHint (const char *name, const char *value)
 Set a hint with normal priority. More...
 
SDL_bool SDL_SetHintWithPriority (const char *name, const char *value, SDL_HintPriority priority)
 Set a hint with a specific priority. More...
 

Variables

static SDL_HintSDL_hints
 

Typedef Documentation

typedef struct SDL_Hint SDL_Hint
typedef struct SDL_HintWatch SDL_HintWatch

Function Documentation

void SDL_AddHintCallback ( const char *  name,
SDL_HintCallback  callback,
void userdata 
)
void SDL_ClearHints ( void  )

Clear all hints.

This function is called during SDL_Quit() to free stored hints.

Definition at line 197 of file SDL_hints.c.

References SDL_free(), and SDL_hints.

Referenced by SDL_Quit().

void SDL_DelHintCallback ( const char *  name,
SDL_HintCallback  callback,
void userdata 
)

Remove a function watching a particular hint.

Parameters
nameThe hint being watched
callbackThe function being called when the hint value changes
userdataA pointer being passed to the callback function

Definition at line 172 of file SDL_hints.c.

References NULL, SDL_free(), and SDL_strcmp().

Referenced by SDL_AddHintCallback().

SDL_bool SDL_SetHint ( const char *  name,
const char *  value 
)

Set a hint with normal priority.

Returns
SDL_TRUE if the hint was set, SDL_FALSE otherwise

Definition at line 98 of file SDL_hints.c.

References SDL_HINT_NORMAL, and SDL_SetHintWithPriority().

SDL_bool SDL_SetHintWithPriority ( const char *  name,
const char *  value,
SDL_HintPriority  priority 
)

Set a hint with a specific priority.

The priority controls the behavior when setting a hint that already has a value. Hints will replace existing hints of their priority and lower. Environment variables are considered to have override priority.

Returns
SDL_TRUE if the hint was set, SDL_FALSE otherwise

Definition at line 47 of file SDL_hints.c.

References env, NULL, SDL_FALSE, SDL_free(), SDL_getenv(), SDL_HINT_OVERRIDE, SDL_hints, SDL_malloc(), SDL_strcmp(), SDL_strdup(), and SDL_TRUE.

Referenced by SDL_SetHint().

Variable Documentation

SDL_Hint* SDL_hints
static

Definition at line 44 of file SDL_hints.c.

Referenced by SDL_AddHintCallback(), SDL_ClearHints(), and SDL_SetHintWithPriority().