Changeset ab49fdc


Ignore:
Timestamp:
2005-12-10T14:50:49Z (19 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
a301379c
Parents:
87c24ba
Message:

Use helper functions rather then the backends directly. This will be
used for transparent upgrade support later on.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r87c24ba rab49fdc  
    8686int cmd_identify( irc_t *irc, char **cmd )
    8787{
    88         storage_status_t status = global.storage->load( irc->nick, cmd[1], irc );
     88        storage_status_t status = storage_load( irc->nick, cmd[1], irc );
    8989       
    9090        switch (status) {
     
    115115
    116116        irc_setpass( irc, cmd[1] );
    117         switch( global.storage->save( irc, FALSE )) {
     117        switch( storage_save( irc, FALSE )) {
    118118                case STORAGE_ALREADY_EXISTS:
    119119                        irc_usermsg( irc, "Nick is already registered" );
     
    136136        storage_status_t status;
    137137       
    138         status = global.storage->remove (irc->nick, cmd[1]);
     138        status = storage_remove (irc->nick, cmd[1]);
    139139        switch (status) {
    140140        case STORAGE_NO_SUCH_USER:
     
    616616int cmd_save( irc_t *irc, char **cmd )
    617617{
    618         if( global.storage->save( irc, TRUE ) == STORAGE_OK )
     618        if( storage_save( irc, TRUE ) == STORAGE_OK )
    619619                irc_usermsg( irc, "Configuration saved" );
    620620        else
  • irc.c

    r87c24ba rab49fdc  
    161161       
    162162        if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) )
    163                 if( !global.storage->save( irc, TRUE ) )
     163                if( !storage_save( irc, TRUE ) )
    164164                        irc_usermsg( irc, "Error while saving settings!" );
    165165       
  • storage.c

    r87c24ba rab49fdc  
    5757        return st;
    5858}
     59
     60storage_status_t storage_check_pass (const char *nick, const char *password)
     61{
     62        return global.storage->check_pass(nick, password);
     63}
     64
     65storage_status_t storage_load (const char *nick, const char *password, irc_t * irc)
     66{
     67        return global.storage->load(nick, password, irc);
     68}
     69
     70storage_status_t storage_save (irc_t *irc, int overwrite)
     71{
     72        return global.storage->save(irc, overwrite);
     73}
     74
     75storage_status_t storage_remove (const char *nick, const char *password)
     76{
     77        return global.storage->remove(nick, password);
     78}
     79
     80storage_status_t storage_rename (const char *onick, const char *nnick, const char *password)
     81{
     82        return global.storage->rename(onick, nnick, password);
     83}
  • storage.h

    r87c24ba rab49fdc  
    5353} storage_t;
    5454
     55storage_status_t storage_check_pass (const char *nick, const char *password);
     56
     57storage_status_t storage_load (const char *nick, const char *password, irc_t * irc);
     58storage_status_t storage_save (irc_t *irc, int overwrite);
     59storage_status_t storage_remove (const char *nick, const char *password);
     60
     61storage_status_t storage_rename (const char *onick, const char *nnick, const char *password);
     62
    5563void register_storage_backend(storage_t *);
    5664storage_t *storage_init(const char *name);
Note: See TracChangeset for help on using the changeset viewer.