Changeset 5ebff60 for set.h


Ignore:
Timestamp:
2015-02-20T22:50:54Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0b9daac, 3d45471, 7733b8c
Parents:
af359b4
git-author:
Indent <please@…> (19-02-15 05:47:20)
git-committer:
dequis <dx@…> (20-02-15 22:50:54)
Message:

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • set.h

    raf359b4 r5ebff60  
    1   /********************************************************************\
     1/********************************************************************\
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
     
    3232   (so it can also be used for account_t structs). It's pretty simple, but
    3333   so far pretty useful.
    34    
     34
    3535   In short, it just keeps a linked list of settings/variables and it also
    3636   remembers a default value for every setting. And to prevent the user
     
    3939   NULL, or replace it by returning a new value. See struct set.eval. */
    4040
    41 typedef char *(*set_eval) ( struct set *set, char *value );
     41typedef char *(*set_eval) (struct set *set, char *value);
    4242
    4343extern char *SET_INVALID;
    4444
    45 typedef enum
    46 {
     45typedef enum {
    4746        SET_NOSAVE = 0x0001,   /* Don't save this setting (i.e. stored elsewhere). */
    4847        SET_NULL_OK = 0x0100,  /* set->value == NULL is allowed. */
     
    5251} set_flags_t;
    5352
    54 typedef struct set
    55 {
     53typedef struct set {
    5654        void *data;     /* Here you can save a pointer to the
    5755                           object this settings belongs to. */
    58        
     56
    5957        char *key;
    6058        char *old_key;  /* Previously known as; for smooth upgrades. */
     
    6664                           In fact, you should only read values using
    6765                           set_getstr/int(). */
    68        
     66
    6967        set_flags_t flags; /* Mostly defined per user. */
    70        
     68
    7169        /* Eval: Returns SET_INVALID if the value is incorrect, exactly
    7270           the passed value variable, or a corrected value. In case of
     
    7775} set_t;
    7876
    79 #define set_value( set ) ((set)->value) ? ((set)->value) : ((set)->def)
     77#define set_value(set) ((set)->value) ? ((set)->value) : ((set)->def)
    8078
    8179/* Should be pretty clear. */
    82 set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data );
     80set_t *set_add(set_t **head, const char *key, const char *def, set_eval eval, void *data);
    8381
    8482/* Returns the raw set_t. Might be useful sometimes. */
    85 set_t *set_find( set_t **head, const char *key );
     83set_t *set_find(set_t **head, const char *key);
    8684
    8785/* Returns a pointer to the string value of this setting. Don't modify the
    8886   returned string, and don't free() it! */
    89 G_MODULE_EXPORT char *set_getstr( set_t **head, const char *key );
     87G_MODULE_EXPORT char *set_getstr(set_t **head, const char *key);
    9088
    9189/* Get an integer. In previous versions set_getint() was also used to read
    9290   boolean values, but this SHOULD be done with set_getbool() now! */
    93 G_MODULE_EXPORT int set_getint( set_t **head, const char *key );
    94 G_MODULE_EXPORT int set_getbool( set_t **head, const char *key );
     91G_MODULE_EXPORT int set_getint(set_t **head, const char *key);
     92G_MODULE_EXPORT int set_getbool(set_t **head, const char *key);
    9593
    9694/* set_setstr() strdup()s the given value, so after using this function
    9795   you can free() it, if you want. */
    98 int set_setstr( set_t **head, const char *key, char *value );
    99 int set_setint( set_t **head, const char *key, int value );
    100 void set_del( set_t **head, const char *key );
    101 int set_reset( set_t **head, const char *key );
     96int set_setstr(set_t **head, const char *key, char *value);
     97int set_setint(set_t **head, const char *key, int value);
     98void set_del(set_t **head, const char *key);
     99int set_reset(set_t **head, const char *key);
    102100
    103101/* returns true if a setting shall be shown to the user */
    104 int set_isvisible( set_t *set );
     102int set_isvisible(set_t *set);
    105103
    106104/* Two very useful generic evaluators. */
    107 char *set_eval_int( set_t *set, char *value );
    108 char *set_eval_bool( set_t *set, char *value );
     105char *set_eval_int(set_t *set, char *value);
     106char *set_eval_bool(set_t *set, char *value);
    109107
    110108/* Another more complicated one. */
    111 char *set_eval_list( set_t *set, char *value );
     109char *set_eval_list(set_t *set, char *value);
    112110
    113111/* Some not very generic evaluators that really shouldn't be here... */
    114 char *set_eval_to_char( set_t *set, char *value );
    115 char *set_eval_oauth( set_t *set, char *value );
     112char *set_eval_to_char(set_t *set, char *value);
     113char *set_eval_oauth(set_t *set, char *value);
    116114
    117115#endif /* __SET_H__ */
Note: See TracChangeset for help on using the changeset viewer.