Changeset a1f17d4 for storage.h


Ignore:
Timestamp:
2005-12-08T14:14:28Z (14 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
7989fcf3
Parents:
1ee6c18
Message:

Simplify storage API a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage.h

    r1ee6c18 ra1f17d4  
    2727#define __STORAGE_H__
    2828
     29typedef enum {
     30        STORAGE_OK = 0,
     31        STORAGE_NO_SUCH_USER,
     32        STORAGE_INVALID_PASSWORD,
     33        STORAGE_ALREADY_EXISTS,
     34        STORAGE_OTHER_ERROR /* Error that isn't caused by user input, such as
     35                                                   a database that is unreachable. log() will be
     36                                                   used for the exact error message */
     37} storage_status_t;
     38
    2939typedef struct {
    3040        const char *name;
     
    3343        void (*init) (void);
    3444
    35         int (*load) (const char *nick, const char *password, irc_t * irc);
    36         int (*exists) (const char *nick);
    37         int (*save) (irc_t *irc);
    38         int (*remove) (const char *nick);
    39         int (*check_pass) (const char *nick, const char *pass);
     45        storage_status_t (*load) (const char *nick, const char *password, irc_t * irc);
     46        storage_status_t (*save) (irc_t *irc, int overwrite);
     47        storage_status_t (*remove) (const char *nick, const char *password);
    4048
    4149        /* May be NULL if not supported by backend */
    42         int (*rename) (const char *onick, const char *nnick, const char *password);
     50        storage_status_t (*rename) (const char *onick, const char *nnick, const char *password);
    4351} storage_t;
    4452
Note: See TracChangeset for help on using the changeset viewer.