Changeset b308cf9 for set.c


Ignore:
Timestamp:
2010-06-05T23:21:02Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1fdb0a4
Parents:
3ab1d31 (diff), e774815 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging libpurple branch into killerbee. It's fairly usable already, and
Debian packaging is now properly separated. This also picks up a load of
stuff from mainline it seems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • set.c

    r3ab1d31 rb308cf9  
    2929char *SET_INVALID = "nee";
    3030
    31 set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data )
     31set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data )
    3232{
    3333        set_t *s = set_find( head, key );
     
    6363}
    6464
    65 set_t *set_find( set_t **head, char *key )
     65set_t *set_find( set_t **head, const char *key )
    6666{
    6767        set_t *s = *head;
     
    7777}
    7878
    79 char *set_getstr( set_t **head, char *key )
     79char *set_getstr( set_t **head, const char *key )
    8080{
    8181        set_t *s = set_find( head, key );
     
    8787}
    8888
    89 int set_getint( set_t **head, char *key )
     89int set_getint( set_t **head, const char *key )
    9090{
    9191        char *s = set_getstr( head, key );
     
    101101}
    102102
    103 int set_getbool( set_t **head, char *key )
     103int set_getbool( set_t **head, const char *key )
    104104{
    105105        char *s = set_getstr( head, key );
     
    111111}
    112112
    113 int set_setstr( set_t **head, char *key, char *value )
     113int set_setstr( set_t **head, const char *key, char *value )
    114114{
    115115        set_t *s = set_find( head, key );
     
    150150}
    151151
    152 int set_setint( set_t **head, char *key, int value )
     152int set_setint( set_t **head, const char *key, int value )
    153153{
    154154        char s[24];     /* Not quite 128-bit clean eh? ;-) */
     
    158158}
    159159
    160 void set_del( set_t **head, char *key )
     160void set_del( set_t **head, const char *key )
    161161{
    162162        set_t *s = *head, *t = NULL;
     
    182182}
    183183
    184 int set_reset( set_t **head, char *key )
     184int set_reset( set_t **head, const char *key )
    185185{
    186186        set_t *s;
     
    211211{
    212212        return is_bool( value ) ? value : SET_INVALID;
     213}
     214
     215char *set_eval_list( set_t *set, char *value )
     216{
     217        GSList *options = set->eval_data, *opt;
     218       
     219        for( opt = options; opt; opt = opt->next )
     220                if( strcmp( value, opt->data ) == 0 )
     221                        return value;
     222       
     223        /* TODO: It'd be nice to show the user a list of allowed values,
     224                 but we don't have enough context here to do that. May
     225                 want to fix that. */
     226       
     227        return NULL;
    213228}
    214229
Note: See TracChangeset for help on using the changeset viewer.