Changeset 56244c0


Ignore:
Timestamp:
2010-03-12T00:38:40Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4dc6b8d
Parents:
fdba6bc
Message:

Added set_eval_list which I will need for the Purple module now to make QQ
(and others) work.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • set.c

    rfdba6bc r56244c0  
    213213}
    214214
     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;
     228}
     229
    215230char *set_eval_to_char( set_t *set, char *value )
    216231{
  • set.h

    rfdba6bc r56244c0  
    6969           set_setstr() should be able to free() the returned string! */
    7070        set_eval eval;
     71        void *eval_data;
    7172        struct set *next;
    7273} set_t;
     
    9899char *set_eval_bool( set_t *set, char *value );
    99100
     101/* Another more complicated one. */
     102char *set_eval_list( set_t *set, char *value );
     103
    100104/* Some not very generic evaluators that really shouldn't be here... */
    101105char *set_eval_to_char( set_t *set, char *value );
Note: See TracChangeset for help on using the changeset viewer.