diff options
| -rw-r--r-- | irc.c | 4 | ||||
| -rw-r--r-- | root_commands.c | 1 | ||||
| -rw-r--r-- | set.c | 2 | ||||
| -rw-r--r-- | set.h | 6 | 
4 files changed, 9 insertions, 4 deletions
@@ -32,8 +32,10 @@ static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond );  GSList *irc_connection_list = NULL; -static char *passchange( irc_t *irc, void *set, char *value ) +static char *passchange( set_t *set, char *value )  { +	irc_t *irc = set->data; +	  	irc_setpass( irc, value );  	irc_usermsg( irc, "Password successfully changed" );  	return NULL; diff --git a/root_commands.c b/root_commands.c index 13567e8a..3097dc81 100644 --- a/root_commands.c +++ b/root_commands.c @@ -168,6 +168,7 @@ static void cmd_register( irc_t *irc, char **cmd )  			break;  		case STORAGE_OK: +			irc_usermsg( irc, "Account successfully created" );  			irc->status |= USTATUS_IDENTIFIED;  			irc_umode_set( irc, "+R", 1 );  			break; @@ -25,7 +25,7 @@  #define BITLBEE_CORE  #include "bitlbee.h" -set_t *set_add( set_t **head, char *key, char *def, void *eval, void *data ) +set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data )  {  	set_t *s = set_find( head, key ); @@ -33,6 +33,8 @@     every setting, which can check a new value and block it by returning     NULL, or replace it by returning a new value. See struct set.eval. */ +typedef char *(*set_eval) ( struct set *set, char *value ); +  typedef struct set  {  	void *data;     /* Here you can save a pointer to the @@ -51,12 +53,12 @@ typedef struct set  	/* Eval: Returns NULL if the value is incorrect or exactly the  	   passed value variable. When returning a corrected value,  	   set_setstr() should be able to free() the returned string! */ -	char *(*eval) ( struct set *set, char *value ); +	set_eval eval;  	struct set *next;  } set_t;  /* Should be pretty clear. */ -set_t *set_add( set_t **head, char *key, char *def, void *eval, void *data ); +set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data );  /* Returns the raw set_t. Might be useful sometimes. */  set_t *set_find( set_t **head, char *key );  | 
