XMMS2
Functions
const.c File Reference
#include "s4_priv.h"
#include <stdlib.h>

Functions

s4_const_data_t_const_create_data ()
 
void _const_free_data (s4_const_data_t *data)
 
const char * _string_lookup (s4_t *s4, const char *str)
 Gets a pointer to a constant string that's equal to str. More...
 
const s4_val_t_string_lookup_val (s4_t *s4, const char *str)
 Gets a pointer to a constant string value with a string equal to str. More...
 
char * s4_string_collate (const char *str)
 Creates a string that orders correctly according to the locale. More...
 
char * s4_string_casefold (const char *str)
 Creates a casefolded version of the string. More...
 
const char * _string_lookup_casefolded (s4_t *s4, const char *str)
 Gets the casefolded string corresponding to str. More...
 
const char * _string_lookup_collated (s4_t *s4, const char *str)
 Gets the collated string corresponding to str. More...
 
const s4_val_t_int_lookup_val (s4_t *s4, int32_t i)
 
const s4_val_t_const_lookup (s4_t *s4, const s4_val_t *val)
 

Function Documentation

s4_const_data_t* _const_create_data ( void  )
void _const_free_data ( s4_const_data_t data)
const s4_val_t* _const_lookup ( s4_t s4,
const s4_val_t val 
)

Referenced by s4_add(), and s4_del().

const s4_val_t* _int_lookup_val ( s4_t s4,
int32_t  i 
)

Referenced by _const_lookup().

const char* _string_lookup ( s4_t s4,
const char *  str 
)

Gets a pointer to a constant string that's equal to str.

_string_lookup will always return the same pointer for the same string

Parameters
s4The database to look for the string in
strThe string to find the constant string of
Returns
A pointer to a string equal to str

Referenced by _string_lookup_casefolded(), _string_lookup_collated(), s4_add(), s4_cond_update_key(), s4_del(), and s4_fetchspec_update_key().

const char* _string_lookup_casefolded ( s4_t s4,
const char *  str 
)

Gets the casefolded string corresponding to str.

str must have been obtained by calling _string_lookup.

Parameters
s4The database to look in
strThe string to find the casefold string of
Returns
The casefolded string of str

Referenced by s4_val_get_casefolded_str().

const char* _string_lookup_collated ( s4_t s4,
const char *  str 
)

Gets the collated string corresponding to str.

str must have been obtained by calling _string_lookup.

Parameters
s4The database to look in
strThe string to find the collated string of
Returns
The collated string of str

Referenced by s4_val_get_collated_str().

const s4_val_t* _string_lookup_val ( s4_t s4,
const char *  str 
)

Gets a pointer to a constant string value with a string equal to str.

_string_lookup_val will always return the same value for the same string.

Parameters
s4The database to look for the string in
strThe string to find the constant string of
Returns
A pointer to a string value

Referenced by _const_lookup(), and _string_lookup().

char* s4_string_casefold ( const char *  str)

Creates a casefolded version of the string.

Parameters
strThe string to casefold
Returns
A casefolded version of str, free with g_free

Referenced by _string_lookup_casefolded(), and s4_val_get_casefolded_str().

char* s4_string_collate ( const char *  str)

Creates a string that orders correctly according to the locale.

Parameters
strThe string to collate
Returns
A collated version of str, must be freed with g_free

Referenced by _string_lookup_collated(), and s4_val_get_collated_str().