Changeset 1ba7e8f for conf.c


Ignore:
Timestamp:
2008-02-15T17:38:57Z (16 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
506e61b
Parents:
0fbd3a6d (diff), eeb85a8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged with upstream r328

Wilmer van der Gaast 2008-02-11 Got rid of some noise at startup: complaining when the default configuration

Wilmer van der Gaast 2008-02-10 Added support for password-protected Jabber chatrooms.
Wilmer van der Gaast 2008-02-10 Making AI_ADDRCONFIG optional, it doesn't exist on at least NetBSD and
Wilmer van der Gaast 2008-02-09 Restored "add -tmp". A bit hackish, but it will do for now.
Wilmer van der Gaast 2008-02-07 Fixed getnameinfo() calls, this fixes Solaris stability issues. Thanks to
Wilmer van der Gaast 2008-02-04 Added bogus G_GNUC_MALLOC to restore GLib 2.4 compatibility (hopefully).
Wilmer van der Gaast 2008-02-03 Messages from the user are also included in backlogs when joining a Jabber
Wilmer van der Gaast 2008-02-03 Disabling "Unknown command" warnings since they're very noisy and pretty
Wilmer van der Gaast 2008-02-03 Implemented XEP-0115. This adds some info to the <presence/> tags so
Wilmer van der Gaast 2008-02-03 Saner garbage collection of cached packets in the Jabber module. Now
Wilmer van der Gaast 2008-02-02 Added help_free() and cleaned up some very stale help-related stuff I
Wilmer van der Gaast 2008-01-30 Fixed handling of OSCAR multi-part messages... They're not arrays, they're
Wilmer van der Gaast 2008-01-24 Keeping track of valid Jabber connections so _connected() events will be
Wilmer van der Gaast 2008-01-24 Fixed two valgrind warnings (partially uninitialized "struct tm" vars.)
Wilmer van der Gaast 2008-01-20 The Jabber module now uses imcb_chat_log() instead of imcb_log() where
Wilmer van der Gaast 2008-01-20 Added imcb_chat_log() for chatroom system messages, so they can be
Wilmer van der Gaast 2008-01-20 GET_BUDDY_FIRST wasn't actually implemented, even though it was in use
Wilmer van der Gaast 2008-01-19 Using test -f instead of test -e. This breaks if the include files are
Wilmer van der Gaast 2008-01-19 Added byte swapping code to the new MD5 checksumming code to make it work
Wilmer van der Gaast 2008-01-18 Moving imcb_chat_new() to a saner location (no code changes) and fixing
Wilmer van der Gaast 2008-01-17 Apparently ext_yahoo_got_im can be called with msg=NULL, so it should be
Wilmer van der Gaast 2008-01-17 Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts
Wilmer van der Gaast 2008-01-13 Fixed handing of failed groupchat joins.
Wilmer van der Gaast 2008-01-13 Fixed "Conditional jump or move depends on uninitialised value(s)" at
Wilmer van der Gaast 2008-01-13 Fixed quickstart2. (Bug #349.)
Wilmer van der Gaast 2008-01-13 Different handling of charset mismatches before login time. Ignoring a
Wilmer van der Gaast 2008-01-12 When a switchboard connection dies (at the TCP level) and there are still
Wilmer van der Gaast 2008-01-12 Killed info_string_append() and now showing the IP address of ICQ users
Wilmer van der Gaast 2008-01-11 Fixing bug #344, now away states should always be correct, even when people
Wilmer van der Gaast 2008-01-11 Adding own handle to protocol name in blist output for people with multiple
Wilmer van der Gaast 2008-01-10 Now setting odata->icq properly again, this got lost some time ago, which
Wilmer van der Gaast 2008-01-06 More consistency in error/warning errors. Until now "WARNING:" was usually
Wilmer van der Gaast 2008-01-06 Changed warning message about unsent MSN messages. It should show the actual
Wilmer van der Gaast 2008-01-05 Added "mail_notifications" setting. Who needs those notifications anyway?
Wilmer van der Gaast 2008-01-05 Build fix from vmiklos.
Wilmer van der Gaast 2008-01-05 Added handling of MSN switchboard NAK messages. Untested, but hey, it
Wilmer van der Gaast 2008-01-05 Removed closure->result. I was planning to add some more stuff, but will
Miklos Vajna 2007-12-31 encode: md5.c is no longer in protocols/, it's in lib/
Wilmer van der Gaast 2007-12-28 Fixed return value check in proxy_connect(), since on some systems
Wilmer van der Gaast 2007-12-28 Added missing return in jabber_login().
Wilmer van der Gaast 2007-12-16 Implemented XEP-0199 (patch from misc@…).
Wilmer van der Gaast 2007-12-12 Checking conn->xcred before trying to clean it up since GnuTLS doesn't
Wilmer van der Gaast 2007-12-12 Killed the <server> parameter to "account add" and changed the default
Wilmer van der Gaast 2007-12-12 Fixed sockerr_again() usage in Jabber module to (hopefully) fix a 100% CPU
Wilmer van der Gaast 2007-12-10 Don't allow nicks that start with a number.
Wilmer van der Gaast 2007-12-10 Fixed "set xxx" syntax (it showed all settings instead of just xxx).
Wilmer van der Gaast 2007-12-09 If I keep forgetting to credit people in commit msgs I should probably add
Wilmer van der Gaast 2007-12-09 Added /invite support for Jabber chatrooms (and fixed the argument order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r0fbd3a6d r1ba7e8f  
    3636#include "proxy.h"
    3737
    38 char *CONF_FILE;
    39 
    4038static int conf_loadini( conf_t *conf, char *file );
    4139
     
    4341{
    4442        conf_t *conf;
    45         int opt, i;
     43        int opt, i, config_missing = 0;
    4644       
    4745        conf = g_new0( conf_t, 1 );
     
    6765        proxytype = 0;
    6866       
    69         i = conf_loadini( conf, CONF_FILE );
     67        i = conf_loadini( conf, global.conf_file );
    7068        if( i == 0 )
    7169        {
    72                 fprintf( stderr, "Error: Syntax error in configuration file `%s'.\n", CONF_FILE );
    73                 return( NULL );
     70                fprintf( stderr, "Error: Syntax error in configuration file `%s'.\n", global.conf_file );
     71                return NULL;
    7472        }
    7573        else if( i == -1 )
    7674        {
    77                 fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", CONF_FILE );
     75                config_missing ++;
     76                /* Whine after parsing the options if there was no -c pointing
     77                   at a *valid* configuration file. */
    7878        }
    7979       
     
    107107                else if( opt == 'c' )
    108108                {
    109                         if( strcmp( CONF_FILE, optarg ) != 0 )
    110                         {
    111                                 g_free( CONF_FILE );
    112                                 CONF_FILE = g_strdup( optarg );
     109                        if( strcmp( global.conf_file, optarg ) != 0 )
     110                        {
     111                                g_free( global.conf_file );
     112                                global.conf_file = g_strdup( optarg );
    113113                                g_free( conf );
    114114                                /* Re-evaluate arguments. Don't use this option twice,
     
    116116                                   works with all libcs BTW.. */
    117117                                optind = 1;
    118                                 return( conf_load( argc, argv ) );
     118                                return conf_load( argc, argv );
    119119                        }
    120120                }
     
    144144                                "  -d  Specify alternative user configuration directory\n"
    145145                                "  -h  Show this help page.\n" );
    146                         return( NULL );
     146                        return NULL;
    147147                }
    148148                else if( opt == 'R' )
     
    170170        }
    171171       
    172         return( conf );
     172        if( config_missing )
     173                fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", global.conf_file );
     174       
     175        return conf;
    173176}
    174177
     
    179182       
    180183        ini = ini_open( file );
    181         if( ini == NULL ) return( -1 );
     184        if( ini == NULL ) return -1;
    182185        while( ini_read( ini ) )
    183186        {
     
    257260                                {
    258261                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
    259                                         return( 0 );
     262                                        return 0;
    260263                                }
    261264                                conf->ping_interval = i;
     
    266269                                {
    267270                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
    268                                         return( 0 );
     271                                        return 0;
    269272                                }
    270273                                conf->ping_timeout = i;
     
    278281                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
    279282                                        g_free( url );
    280                                         return( 0 );
     283                                        return 0;
    281284                                }
    282285                               
     
    302305                        {
    303306                                fprintf( stderr, "Error: Unknown setting `%s` in configuration file.\n", ini->key );
    304                                 return( 0 );
     307                                return 0;
    305308                                /* For now just ignore unknown keys... */
    306309                        }
     
    310313                        fprintf( stderr, "Error: Unknown section [%s] in configuration file. "
    311314                                         "BitlBee configuration must be put in a [settings] section!\n", ini->section );
    312                         return( 0 );
     315                        return 0;
    313316                }
    314317        }
    315318        ini_close( ini );
    316319       
    317         return( 1 );
     320        return 1;
    318321}
    319322
     
    322325        ini_t *ini;
    323326       
    324         ini = ini_open( CONF_FILE );
     327        ini = ini_open( global.conf_file );
    325328        if( ini == NULL ) return;
    326329        while( ini_read( ini ) )
Note: See TracChangeset for help on using the changeset viewer.