Index: irc.c
===================================================================
--- irc.c	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ irc.c	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -213,5 +213,5 @@
 	log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd );
 	
-	if( irc->status & USTATUS_IDENTIFIED && set_getint( &irc->set, "save_on_quit" ) ) 
+	if( irc->status & USTATUS_IDENTIFIED && set_getbool( &irc->set, "save_on_quit" ) ) 
 		if( storage_save( irc, TRUE ) != STORAGE_OK )
 			irc_usermsg( irc, "Error while saving settings!" );
@@ -1058,5 +1058,5 @@
 	if( !u || !u->gc ) return;
 	
-	if( set_getint( &irc->set, "buddy_sendbuffer" ) && set_getint( &irc->set, "buddy_sendbuffer_delay" ) > 0 )
+	if( set_getbool( &irc->set, "buddy_sendbuffer" ) && set_getint( &irc->set, "buddy_sendbuffer_delay" ) > 0 )
 	{
 		int delay;
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ protocols/nogaim.c	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -208,5 +208,5 @@
 
 	if( ( g_strcasecmp( set_getstr( &gc->irc->set, "strip_html" ), "always" ) == 0 ) ||
-	    ( ( gc->flags & OPT_CONN_HTML ) && set_getint( &gc->irc->set, "strip_html" ) ) )
+	    ( ( gc->flags & OPT_CONN_HTML ) && set_getbool( &gc->irc->set, "strip_html" ) ) )
 		strip_html( text );
 	
@@ -353,10 +353,10 @@
 	irc_t *irc = gc->irc;
 	
-	if( set_getint( &irc->set, "debug" ) && 0 ) /* This message is too useless */
+	if( set_getbool( &irc->set, "debug" ) && 0 ) /* This message is too useless */
 		serv_got_crap( gc, "Receiving user add from handle: %s", handle );
 	
 	if( user_findhandle( gc, handle ) )
 	{
-		if( set_getint( &irc->set, "debug" ) )
+		if( set_getbool( &irc->set, "debug" ) )
 			serv_got_crap( gc, "User already exists, ignoring add request: %s", handle );
 		
@@ -446,5 +446,5 @@
 		u->realname = g_strdup( realname );
 		
-		if( ( gc->flags & OPT_LOGGED_IN ) && set_getint( &gc->irc->set, "display_namechanges" ) )
+		if( ( gc->flags & OPT_LOGGED_IN ) && set_getbool( &gc->irc->set, "display_namechanges" ) )
 			serv_got_crap( gc, "User `%s' changed name to `%s'", u->nick, u->realname );
 	}
@@ -509,5 +509,5 @@
 		else
 		{
-			if( set_getint( &gc->irc->set, "debug" ) || g_strcasecmp( set_getstr( &gc->irc->set, "handle_unknown" ), "ignore" ) != 0 )
+			if( set_getbool( &gc->irc->set, "debug" ) || g_strcasecmp( set_getstr( &gc->irc->set, "handle_unknown" ), "ignore" ) != 0 )
 			{
 				serv_got_crap( gc, "serv_got_update() for handle %s:", handle );
@@ -568,5 +568,5 @@
 	
 	/* LISPy... */
-	if( ( set_getint( &gc->irc->set, "away_devoice" ) ) &&		/* Don't do a thing when user doesn't want it */
+	if( ( set_getbool( &gc->irc->set, "away_devoice" ) ) &&		/* Don't do a thing when user doesn't want it */
 	    ( u->online ) &&						/* Don't touch offline people */
 	    ( ( ( u->online != oo ) && !u->away ) ||			/* Voice joining people */
@@ -591,5 +591,5 @@
 		if( g_strcasecmp( h, "ignore" ) == 0 )
 		{
-			if( set_getint( &irc->set, "debug" ) )
+			if( set_getbool( &irc->set, "debug" ) )
 				serv_got_crap( gc, "Ignoring message from unknown handle %s", handle );
 			
@@ -598,5 +598,5 @@
 		else if( g_strncasecmp( h, "add", 3 ) == 0 )
 		{
-			int private = set_getint( &irc->set, "private" );
+			int private = set_getbool( &irc->set, "private" );
 			
 			if( h[3] )
@@ -620,5 +620,5 @@
 	
 	if( ( g_strcasecmp( set_getstr( &gc->irc->set, "strip_html" ), "always" ) == 0 ) ||
-	    ( ( gc->flags & OPT_CONN_HTML ) && set_getint( &gc->irc->set, "strip_html" ) ) )
+	    ( ( gc->flags & OPT_CONN_HTML ) && set_getbool( &gc->irc->set, "strip_html" ) ) )
 		strip_html( msg );
 
@@ -660,5 +660,5 @@
 	user_t *u;
 	
-	if( !set_getint( &gc->irc->set, "typing_notice" ) )
+	if( !set_getbool( &gc->irc->set, "typing_notice" ) )
 		return;
 	
@@ -682,5 +682,5 @@
 	GList *ir;
 	
-	if( set_getint( &gc->irc->set, "debug" ) )
+	if( set_getbool( &gc->irc->set, "debug" ) )
 		serv_got_crap( gc, "You were removed from conversation %d", (int) id );
 	
@@ -728,5 +728,5 @@
 	
 	if( ( g_strcasecmp( set_getstr( &gc->irc->set, "strip_html" ), "always" ) == 0 ) ||
-	    ( ( gc->flags & OPT_CONN_HTML ) && set_getint( &gc->irc->set, "strip_html" ) ) )
+	    ( ( gc->flags & OPT_CONN_HTML ) && set_getbool( &gc->irc->set, "strip_html" ) ) )
 		strip_html( msg );
 	
@@ -761,5 +761,5 @@
 	g_free( s );
 	
-	if( set_getint( &gc->irc->set, "debug" ) )
+	if( set_getbool( &gc->irc->set, "debug" ) )
 		serv_got_crap( gc, "Creating new conversation: (id=%d,handle=%s)", id, handle );
 	
@@ -775,5 +775,5 @@
 	int me = 0;
 	
-	if( set_getint( &b->gc->irc->set, "debug" ) )
+	if( set_getbool( &b->gc->irc->set, "debug" ) )
 		serv_got_crap( b->gc, "User %s added to conversation %d", handle, b->id );
 	
@@ -809,5 +809,5 @@
 	int me = 0;
 	
-	if( set_getint( &b->gc->irc->set, "debug" ) )
+	if( set_getbool( &b->gc->irc->set, "debug" ) )
 		serv_got_crap( b->gc, "User %s removed from conversation %d (%s)", handle, b->id, reason ? reason : "" );
 	
@@ -887,5 +887,5 @@
 	/* Horror.... */
 	
-	if( st != set_getint( &irc->set, "away_devoice" ) )
+	if( st != set_getbool( &irc->set, "away_devoice" ) )
 	{
 		char list[80] = "";
@@ -1007,5 +1007,5 @@
 		{
 			gc->acc->prpl->set_away( gc, s, away );
-			if( set_getint( &gc->irc->set, "debug" ) )
+			if( set_getbool( &gc->irc->set, "debug" ) )
 				serv_got_crap( gc, "Setting away state to %s", s );
 		}
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ protocols/oscar/oscar.c	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -1251,8 +1251,4 @@
 	channel = va_arg(ap, int);
 	userinfo = va_arg(ap, aim_userinfo_t *);
-
-    if (set_getint(sess->aux_data, "debug")) {
-        serv_got_crap(sess->aux_data, "channel %i called", channel);
-    }
 
 	switch (channel) {
Index: protocols/oscar/rxhandlers.c
===================================================================
--- protocols/oscar/rxhandlers.c	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ protocols/oscar/rxhandlers.c	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -112,8 +112,4 @@
 		/* Following SNAC will be related */
 	}
-
-    if (set_getint(sess->aux_data, "debug")) {
-        serv_got_crap(sess->aux_data, "snac %x/%x received", snac.family, snac.subtype);
-    }
 
 	for (cur = (aim_module_t *)sess->modlistv; cur; cur = cur->next) {
Index: root_commands.c
===================================================================
--- root_commands.c	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ root_commands.c	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -144,5 +144,5 @@
 		irc_usermsg( irc, "Password accepted, settings and accounts loaded" );
 		irc_umode_set( irc, "+R", 1 );
-		if( set_getint( &irc->set, "auto_connect" ) )
+		if( set_getbool( &irc->set, "auto_connect" ) )
 			cmd_account( irc, account_on );
 		break;
Index: set.h
===================================================================
--- set.h	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ set.h	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -24,13 +24,28 @@
 */
 
+/* This used to be specific to irc_t structures, but it's more generic now
+   (so it can also be used for account_t structs). It's pretty simple, but
+   so far pretty useful.
+   
+   In short, it just keeps a linked list of settings/variables and it also
+   remembers a default value for every setting. And to prevent the user
+   from setting invalid values, you can write an evaluator function for
+   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 struct set
 {
-	void *data;
+	void *data;     /* Here you can save a pointer to the
+	                   object this settings belongs to. */
 	
 	char *key;
 	char *value;
-	char *def;	/* Default */
+	char *def;      /* Default value. If the set_setstr() function
+	                   notices a new value is exactly the same as
+	                   the default, value gets set to NULL. So when
+	                   you read a setting, don't forget about this! */
 	
-	int flags;
+	int flags;      /* See account.h, for example. set.c doesn't use
+	                   this (yet?). */
 	
 	/* Eval: Returns NULL if the value is incorrect or exactly the
@@ -41,16 +56,31 @@
 } set_t;
 
+/* Should be pretty clear. */
 set_t *set_add( set_t **head, char *key, char *def, void *eval, void *data );
+
+/* Returns the raw set_t. Might be useful sometimes. */
 set_t *set_find( set_t **head, char *key );
+
+/* Returns a pointer to the string value of this setting. Don't modify the
+   returned string, and don't free() it! */
 G_MODULE_EXPORT char *set_getstr( set_t **head, char *key );
+
+/* Get an integer. Right now this also converts true/false/on/off/etc to
+   numbers, but this is for historical reasons, please use set_getbool()
+   for booleans instead. */
 G_MODULE_EXPORT int set_getint( set_t **head, char *key );
 G_MODULE_EXPORT int set_getbool( set_t **head, char *key );
+
+/* set_setstr() strdup()s the given value, so after using this function
+   you can free() it, if you want. */
 int set_setstr( set_t **head, char *key, char *value );
 int set_setint( set_t **head, char *key, int value );
 void set_del( set_t **head, char *key );
 
+/* Two very useful generic evaluators. */
 char *set_eval_int( set_t *set, char *value );
 char *set_eval_bool( set_t *set, char *value );
 
+/* Some not very generic evaluators that really shouldn't be here... */
 char *set_eval_to_char( set_t *set, char *value );
 char *set_eval_ops( set_t *set, char *value );
Index: user.c
===================================================================
--- user.c	(revision 846cec61f2b94be60c7bae7f4d0de8952e2d45fa)
+++ user.c	(revision d5ccd83c5235528df2481003502647b86b41fdc4)
@@ -67,5 +67,5 @@
 	
 	u->user = u->realname = u->host = u->nick = g_strdup( nick );
-	u->is_private = set_getint( &irc->set, "private" );
+	u->is_private = set_getbool( &irc->set, "private" );
 	
 	key = g_strdup( nick );
