Changeset be609ff


Ignore:
Timestamp:
2010-03-12T19:10:16Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dde9d571
Parents:
08e5bb2 (diff), 8b6b740 (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:

Merging mainline.

Files:
28 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r08e5bb2 rbe609ff  
    4949
    5050clean: $(subdirs)
    51         rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode
     51        rm -f *.o $(OUTFILE) core utils/bitlbeed
    5252        $(MAKE) -C tests clean
    5353
     
    124124endif
    125125
    126 encode: crypting.c
    127         $(CC) crypting.c lib/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
    128 
    129 decode: encode
    130         cp encode decode
    131 
    132126ctags:
    133127        ctags `find . -name "*.c"` `find . -name "*.h"`
  • account.c

    r08e5bb2 rbe609ff  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2004 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    6969                prpl->init( a );
    7070       
    71         return( a );
     71        s = set_add( &a->set, "away", NULL, set_eval_account, a );
     72        s->flags |= SET_NULL_OK;
     73       
     74        if( a->flags & ACC_FLAG_STATUS_MESSAGE )
     75        {
     76                s = set_add( &a->set, "status", NULL, set_eval_account, a );
     77                s->flags |= SET_NULL_OK;
     78        }
     79       
     80        return a;
    7281}
    7382
     
    121130               
    122131                acc->auto_connect = bool2int( value );
     132                return value;
     133        }
     134        else if( strcmp( set->key, "away" ) == 0 ||
     135                 strcmp( set->key, "status" ) == 0 )
     136        {
     137                if( acc->ic && acc->ic->flags & OPT_LOGGED_IN )
     138                {
     139                        /* If we're currently on-line, set the var now already
     140                           (bit of a hack) and send an update. */
     141                        g_free( set->value );
     142                        set->value = g_strdup( value );
     143                       
     144                        imc_away_send_update( acc->ic );
     145                }
     146               
    123147                return value;
    124148        }
     
    267291        p->max = 86400;
    268292       
    269         /* Format: /[0-9]+([*+][0-9]+(<[0-9+]))/ */
     293        /* Format: /[0-9]+([*+][0-9]+(<[0-9+])?)?/ */
    270294        while( *value && isdigit( *value ) )
    271295                p->start = p->start * 10 + *value++ - '0';
  • account.h

    r08e5bb2 rbe609ff  
    3737        int auto_reconnect_delay;
    3838        int reconnect;
     39        int flags;
    3940       
    4041        set_t *set;
     
    5657int account_reconnect_delay( account_t *a );
    5758
    58 #define ACC_SET_NOSAVE          0x01
    59 #define ACC_SET_OFFLINE_ONLY    0x02
    60 #define ACC_SET_ONLINE_ONLY     0x04
     59typedef enum
     60{
     61        ACC_SET_NOSAVE = 0x01,          /* Don't save this setting (i.e. stored elsewhere). */
     62        ACC_SET_OFFLINE_ONLY = 0x02,    /* Allow changes only if the acct is offline. */
     63        ACC_SET_ONLINE_ONLY = 0x04,     /* Allow changes only if the acct is online. */
     64} account_set_flag_t;
     65
     66typedef enum
     67{
     68        ACC_FLAG_AWAY_MESSAGE = 0x01,   /* Supports away messages instead of just states. */
     69        ACC_FLAG_STATUS_MESSAGE = 0x02, /* Supports status messages (without being away). */
     70} account_flag_t;
    6171
    6272#endif
  • bitlbee.conf

    r08e5bb2 rbe609ff  
    5555##
    5656## Password the user should enter when logging into a closed BitlBee server.
    57 ## You can also have an MD5-encrypted password here. Format: "md5:", followed
    58 ## by a hash as generated for the <user password=""> attribute in a BitlBee
    59 ## XML file (for now there's no easier way to generate the hash).
     57## You can also have a BitlBee-style MD5 hash here. Format: "md5:", followed
     58## by a hash as generated by "bitlbee -x hash <password>".
    6059##
    6160# AuthPassword = ItllBeBitlBee   ## Heh.. Our slogan. ;-)
  • conf.c

    r08e5bb2 rbe609ff  
    127127                {
    128128                        printf( "Usage: bitlbee [-D/-F [-i <interface>] [-p <port>] [-n] [-v]] [-I]\n"
    129                                 "               [-c <file>] [-d <dir>] [-h]\n"
     129                                "               [-c <file>] [-d <dir>] [-x] [-h]\n"
    130130                                "\n"
    131131                                "An IRC-to-other-chat-networks gateway\n"
     
    143143                                "  -c  Load alternative configuration file\n"
    144144                                "  -d  Specify alternative user configuration directory\n"
     145                                "  -x  Command-line interface to password encryption/hashing\n"
    145146                                "  -h  Show this help page.\n" );
    146147                        return NULL;
  • configure

    r08e5bb2 rbe609ff  
    360360       
    361361        ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
    362         if [ "$msn" = "1" ]; then
     362        if [ "$msn" = "1" -o "$yahoo" = "1" ]; then
    363363                echo
    364                 echo 'Real SSL support is necessary for MSN authentication, will build without'
    365                 echo 'MSN protocol support.'
     364                echo 'WARNING: The MSN and Yahoo! modules will not work without SSL. Disabling.'
    366365                msn=0
     366                yahoo=0
    367367        fi
    368368       
  • crypting.c

    r08e5bb2 rbe609ff  
    132132        return (rv);
    133133}
    134 
    135 #ifdef CRYPTING_MAIN
    136 
    137 /* A little main() function for people who want a stand-alone program to
    138    encode/decode BitlCrypted files. */
    139 
    140 int main( int argc, char *argv[] )
    141 {
    142         char *hash, *action, line[256];
    143         char* (*func)( char *, const char * );
    144        
    145         if( argc < 2 )
    146         {
    147                 fprintf( stderr, "Usage: %s <password>\n\n"
    148                                  "Reads from stdin, writes to stdout.\n"
    149                                  "Call as \"encode\" to encode, \"decode\" to decode.\n", argv[0] );
    150                 return( 1 );
    151         }
    152        
    153         hash = hashpass( argv[1] );
    154         action = argv[0] + strlen( argv[0] ) - strlen( "encode" );
    155        
    156         if( strcmp( action, "encode" ) == 0 )
    157         {
    158                 fwrite( hash, 32, 1, stdout );
    159                 func = obfucrypt;
    160         }
    161         else if( strcmp( action, "decode" ) == 0 )
    162         {
    163                 char hash2[32];
    164                
    165                 fread( hash2, 32, 1, stdin );
    166                 if( memcmp( hash, hash2, 32 ) != 0 )
    167                 {
    168                         fprintf( stderr, "Passwords don't match. Can't decode.\n" );
    169                         return( 1 );
    170                 }
    171                 func = deobfucrypt;
    172         }
    173         else
    174         {
    175                 return( main( 0, NULL ) );
    176         }
    177        
    178         while( fscanf( stdin, "%[^\n]255s", line ) > 0 )
    179         {
    180                 char *out;
    181                
    182                 /* Flush the newline */
    183                 fgetc( stdin );
    184                
    185                 out = func( line, argv[1] );
    186                 printf( "%s\n", out );
    187                 g_free( out );
    188         }
    189        
    190         return( 0 );
    191 }
    192 
    193 #endif
  • doc/user-guide/commands.xml

    r08e5bb2 rbe609ff  
    436436        </bitlbee-setting>
    437437
     438        <bitlbee-setting name="away" type="string" scope="both">
     439                <description>
     440                        <para>
     441                                To mark yourself as away, it is recommended to just use <emphasis>/away</emphasis>, like on normal IRC networks. If you want to mark yourself as away on only one IM network, you can use this per-account setting.
     442                        </para>
     443
     444                        <para>
     445                                You can set it to any value and BitlBee will try to map it to the most appropriate away state for every open IM connection, or set it as a free-form away message where possible.
     446                        </para>
     447
     448                        <para>
     449                                Any per-account away setting will override globally set away states. To un-set the setting, use <emphasis>set -del away</emphasis>.
     450                        </para>
     451                </description>
     452        </bitlbee-setting>
     453
    438454        <bitlbee-setting name="away_devoice" type="boolean" scope="global">
    439455                <default>true</default>
     
    747763        </bitlbee-setting>
    748764
     765        <bitlbee-setting name="status" type="string" scope="both">
     766                <description>
     767                        <para>
     768                                Certain protocols (like Jabber/XMPP) support status messages, similar to away messages. They can be used to indicate things like your location or activity, without showing up as away/busy.
     769                        </para>
     770
     771                        <para>
     772                                This setting can be used to set such a message. It will be available as a per-account setting for protocols that support it, and also as a global setting (which will then automatically be used for all protocols that support it).
     773                        </para>
     774
     775                        <para>
     776                                Away states set using <emphasis>/away</emphasis> or the <emphasis>away</emphasis> setting will override this setting. To un-set the setting, use <emphasis>set -del status</emphasis>.
     777                        </para>
     778                </description>
     779        </bitlbee-setting>
     780
    749781        <bitlbee-setting name="strip_html" type="boolean" scope="global">
    750782                <default>true</default>
  • doc/user-guide/misc.xml

    r08e5bb2 rbe609ff  
    8686
    8787<para>
    88 As you might've expected, you can just use the <emphasis>/away</emphasis> command in your IRC client to set an away-state. BitlBee supports most away-states supported by the protocols.
     88To mark yourself as away, you can just use the <emphasis>/away</emphasis> command in your IRC client. BitlBee supports most away-states supported by the protocols.
    8989</para>
    9090
    9191<para>
    92 Not all away states are supported by all protocols, and some protocols have different names for them. BitlBee will try to pick the best available alias from this list for every connection:
     92Away states have different names accross different protocols. BitlBee will try to pick the best available option for every connection:
    9393</para>
    9494
    9595<simplelist>
    96         <member>Away from computer, Away, Extended away</member>
    97         <member>NA, N/A, Not available</member>
    98         <member>Busy, Do not disturb, DND, Occupied</member>
    99         <member>Be right back, BRB</member>
    100         <member>On the phone, Phone, On phone</member>
    101         <member>Out to lunch, Lunch, Food</member>
     96        <member>Away</member>
     97        <member>NA</member>
     98        <member>Busy, DND</member>
     99        <member>BRB</member>
     100        <member>Phone</member>
     101        <member>Lunch, Food</member>
    102102        <member>Invisible, Hidden</member>
    103103</simplelist>
    104104
    105105<para>
    106 So <emphasis>/away Food</emphasis> will set your state to "Out to lunch" on your MSN connection, and for most other connections the default, "Away" or "Away from computer" will be chosen.
     106So <emphasis>/away Food</emphasis> will set your state to "Out to lunch" on your MSN connection, and for most other connections the default, "Away" will be chosen.
    107107</para>
    108108
     
    111111</para>
    112112
     113<para>
     114If you want to set an away state for only one of your connections, you can use the per-account <emphasis>away</emphasis> setting. See <emphasis>help set away</emphasis>.
     115</para>
     116
    113117</sect1>
    114118
  • irc.c

    r08e5bb2 rbe609ff  
    7878}
    7979
     80static char *set_eval_away_status( set_t *set, char *value )
     81{
     82        irc_t *irc = set->data;
     83        account_t *a;
     84       
     85        g_free( set->value );
     86        set->value = g_strdup( value );
     87       
     88        for( a = irc->accounts; a; a = a->next )
     89        {
     90                struct im_connection *ic = a->ic;
     91               
     92                if( ic && ic->flags & OPT_LOGGED_IN )
     93                        imc_away_send_update( ic );
     94        }
     95       
     96        return value;
     97}
     98
    8099irc_t *irc_new( int fd )
    81100{
     
    143162        irc_connection_list = g_slist_append( irc_connection_list, irc );
    144163       
     164        s = set_add( &irc->set, "away", NULL,  set_eval_away_status, irc );
     165        s->flags |= SET_NULL_OK;
    145166        s = set_add( &irc->set, "away_devoice", "true",  set_eval_away_devoice, irc );
    146167        s = set_add( &irc->set, "auto_connect", "true", set_eval_bool, irc );
     
    163184        s = set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc );
    164185        s = set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc );
     186        s = set_add( &irc->set, "status", NULL,  set_eval_away_status, irc );
     187        s->flags |= SET_NULL_OK;
    165188        s = set_add( &irc->set, "strip_html", "true", NULL, irc );
    166189        s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc );
  • irc_commands.c

    r08e5bb2 rbe609ff  
    448448        user_t *u = user_find( irc, irc->nick );
    449449        char *away = cmd[1];
    450         account_t *a;
    451450       
    452451        if( !u ) return;
     
    475474        }
    476475       
    477         for( a = irc->accounts; a; a = a->next )
    478         {
    479                 struct im_connection *ic = a->ic;
    480                
    481                 if( ic && ic->flags & OPT_LOGGED_IN )
    482                         imc_set_away( ic, u->away );
    483         }
     476        set_setstr( &irc->set, "away", u->away );
    484477}
    485478
  • lib/misc.c

    r08e5bb2 rbe609ff  
    8989        { "gt",     ">" },
    9090        { "amp",    "&" },
     91        { "apos",   "'" },
    9192        { "quot",   "\"" },
    9293        { "aacute", "á" },
  • protocols/jabber/jabber.c

    r08e5bb2 rbe609ff  
    8282        s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc );
    8383        s->flags |= ACC_SET_OFFLINE_ONLY;
     84       
     85        acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
    8486}
    8587
     
    358360        while( bud )
    359361        {
    360                 imcb_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
    361                                    bud->full_jid, bud->priority,
    362                                    bud->away_state ? bud->away_state->full_name : "(none)",
    363                                    bud->away_message ? : "(none)" );
     362                imcb_log( ic, "Buddy %s (%d) information:", bud->full_jid, bud->priority );
     363                if( bud->away_state )
     364                        imcb_log( ic, "Away state: %s", bud->away_state->full_name );
     365                imcb_log( ic, "Status message: %s", bud->away_message ? : "(none)" );
     366               
    364367                bud = bud->next;
    365368        }
     
    371374{
    372375        struct jabber_data *jd = ic->proto_data;
    373         struct jabber_away_state *state;
    374        
    375         /* Save all this info. We need it, for example, when changing the priority setting. */
    376         state = (void *) jabber_away_state_by_name( state_txt );
    377         jd->away_state = state ? state : (void *) jabber_away_state_list; /* Fall back to "Away" if necessary. */
     376       
     377        /* state_txt == NULL -> Not away.
     378           Unknown state -> fall back to the first defined away state. */
     379        jd->away_state = state_txt ? jabber_away_state_by_name( state_txt )
     380                         ? : jabber_away_state_list : NULL;
     381       
    378382        g_free( jd->away_message );
    379383        jd->away_message = ( message && *message ) ? g_strdup( message ) : NULL;
  • protocols/jabber/jabber.h

    r08e5bb2 rbe609ff  
    8484        /* After changing one of these two (or the priority setting), call
    8585           presence_send_update() to inform the server about the changes. */
    86         struct jabber_away_state *away_state;
     86        const struct jabber_away_state *away_state;
    8787        char *away_message;
    8888       
  • protocols/jabber/jabber_util.c

    r08e5bb2 rbe609ff  
    228228{
    229229        { "away",  "Away" },
    230         { "chat",  "Free for Chat" },
     230        { "chat",  "Free for Chat" },   /* WTF actually uses this? */
    231231        { "dnd",   "Do not Disturb" },
    232232        { "xa",    "Extended Away" },
    233         { "",      "Online" },
    234233        { "",      NULL }
    235234};
     
    238237{
    239238        int i;
     239       
     240        if( code == NULL )
     241                return NULL;
    240242       
    241243        for( i = 0; jabber_away_state_list[i].full_name; i ++ )
     
    249251{
    250252        int i;
     253       
     254        if( name == NULL )
     255                return NULL;
    251256       
    252257        for( i = 0; jabber_away_state_list[i].full_name; i ++ )
  • protocols/jabber/presence.c

    r08e5bb2 rbe609ff  
    187187                int is_away = 0;
    188188
    189                 if( send_presence->away_state && !( *send_presence->away_state->code == 0 ||
    190                     strcmp( send_presence->away_state->code, "chat" ) == 0 ) )
     189                if( send_presence->away_state &&
     190                    strcmp( send_presence->away_state->code, "chat" ) != 0 )
    191191                        is_away = OPT_AWAY;
    192192
    193193                imcb_buddy_status( ic, send_presence->bare_jid, OPT_LOGGED_IN | is_away,
    194                                    ( is_away && send_presence->away_state ) ?
    195                                    send_presence->away_state->full_name : NULL,
     194                                   is_away ? send_presence->away_state->full_name : NULL,
    196195                                   send_presence->away_message );
    197196        }
     
    206205        struct jabber_data *jd = ic->proto_data;
    207206        struct xt_node *node, *cap;
    208         char *show = jd->away_state->code;
    209         char *status = jd->away_message;
    210207        struct groupchat *c;
    211208        int st;
     
    213210        node = jabber_make_packet( "presence", NULL, NULL, NULL );
    214211        xt_add_child( node, xt_new_node( "priority", set_getstr( &ic->acc->set, "priority" ), NULL ) );
    215         if( show && *show )
    216                 xt_add_child( node, xt_new_node( "show", show, NULL ) );
    217         if( status )
    218                 xt_add_child( node, xt_new_node( "status", status, NULL ) );
     212        if( jd->away_state )
     213                xt_add_child( node, xt_new_node( "show", jd->away_state->code, NULL ) );
     214        if( jd->away_message )
     215                xt_add_child( node, xt_new_node( "status", jd->away_message, NULL ) );
    219216       
    220217        /* This makes the packet slightly bigger, but clients interested in
  • protocols/msn/msn.c

    r08e5bb2 rbe609ff  
    139139       
    140140        if( l == NULL )
    141                 for( i = 0; msn_away_state_list[i].number > -1; i ++ )
    142                         l = g_list_append( l, (void*) msn_away_state_list[i].name );
     141                for( i = 0; *msn_away_state_list[i].code; i ++ )
     142                        if( *msn_away_state_list[i].name )
     143                                l = g_list_append( l, (void*) msn_away_state_list[i].name );
    143144       
    144145        return l;
     
    149150        char buf[1024];
    150151        struct msn_data *md = ic->proto_data;
    151         const struct msn_away_state *st;
    152        
    153         if( strcmp( state, GAIM_AWAY_CUSTOM ) == 0 )
    154                 st = msn_away_state_by_name( "Away" );
     152       
     153        if( state )
     154                md->away_state = msn_away_state_by_name( state ) ? :
     155                                 msn_away_state_list + 1;
    155156        else
    156                 st = msn_away_state_by_name( state );
    157        
    158         if( !st ) st = msn_away_state_list;
    159         md->away_state = st;
    160        
    161         g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, st->code );
     157                md->away_state = msn_away_state_list;
     158       
     159        g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code );
    162160        msn_write( ic, buf, strlen( buf ) );
    163161}
  • protocols/msn/msn.h

    r08e5bb2 rbe609ff  
    9797struct msn_away_state
    9898{
    99         int number;
    10099        char code[4];
    101100        char name[16];
  • protocols/msn/msn_util.c

    r08e5bb2 rbe609ff  
    171171               
    172172                /* End of headers? */
    173                 if( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||
    174                     strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ||
    175                     strncmp( text + i - 2, "\r\r", 2 ) == 0 )
     173                if( ( i >= 4 && strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ) ||
     174                    ( i >= 2 && ( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||   
     175                                  strncmp( text + i - 2, "\r\r", 2 ) == 0 ) ) )
    176176                {
    177177                        break;
     
    374374        *list = NULL;
    375375       
    376         imcb_log( ic, ret->str );
     376        imcb_log( ic, "%s", ret->str );
    377377        g_string_free( ret, TRUE );
    378378}
  • protocols/msn/ns.c

    r08e5bb2 rbe609ff  
    420420                {
    421421                        /* FIXME: Warn/Bomb about unknown away state? */
    422                         st = msn_away_state_list;
    423                 }
    424                
    425                 imcb_buddy_status( ic, cmd[3], OPT_LOGGED_IN |
    426                                    ( st->number ? OPT_AWAY : 0 ), st->name, NULL );
     422                        st = msn_away_state_list + 1;
     423                }
     424               
     425                imcb_buddy_status( ic, cmd[3], OPT_LOGGED_IN |
     426                                   ( st != msn_away_state_list ? OPT_AWAY : 0 ),
     427                                   st->name, NULL );
    427428        }
    428429        else if( strcmp( cmd[0], "FLN" ) == 0 )
     
    449450                {
    450451                        /* FIXME: Warn/Bomb about unknown away state? */
    451                         st = msn_away_state_list;
    452                 }
    453                
    454                 imcb_buddy_status( ic, cmd[2], OPT_LOGGED_IN |
    455                                    ( st->number ? OPT_AWAY : 0 ), st->name, NULL );
     452                        st = msn_away_state_list + 1;
     453                }
     454               
     455                imcb_buddy_status( ic, cmd[2], OPT_LOGGED_IN |
     456                                   ( st != msn_away_state_list ? OPT_AWAY : 0 ),
     457                                   st->name, NULL );
    456458        }
    457459        else if( strcmp( cmd[0], "RNG" ) == 0 )
     
    663665                                }
    664666                               
    665                                 if( arg1 ) g_free( arg1 );
    666                                 if( mtype ) g_free( mtype );
     667                                g_free( arg1 );
     668                                g_free( mtype );
    667669                        }
    668670                        else if( g_strncasecmp( ct, "text/x-msmsgsprofile", 20 ) == 0 )
     
    672674                        else if( g_strncasecmp( ct, "text/x-msmsgsinitialemailnotification", 37 ) == 0 )
    673675                        {
    674                                 char *inbox = msn_findheader( body, "Inbox-Unread:", blen );
    675                                 char *folders = msn_findheader( body, "Folders-Unread:", blen );
    676                                
    677                                 if( inbox && folders && set_getbool( &ic->acc->set, "mail_notifications" ) )
     676                                if( set_getbool( &ic->acc->set, "mail_notifications" ) )
    678677                                {
    679                                         imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
     678                                        char *inbox = msn_findheader( body, "Inbox-Unread:", blen );
     679                                        char *folders = msn_findheader( body, "Folders-Unread:", blen );
     680
     681                                        if( inbox && folders )
     682                                                imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
     683                                       
     684                                        g_free( inbox );
     685                                        g_free( folders );
    680686                                }
    681                                
    682                                 g_free( inbox );
    683                                 g_free( folders );
    684687                        }
    685688                        else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 )
    686689                        {
    687                                 char *from = msn_findheader( body, "From-Addr:", blen );
    688                                 char *fromname = msn_findheader( body, "From:", blen );
    689                                
    690                                 if( from && fromname && set_getbool( &ic->acc->set, "mail_notifications" ) )
     690                                if( set_getbool( &ic->acc->set, "mail_notifications" ) )
    691691                                {
    692                                         imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
     692                                        char *from = msn_findheader( body, "From-Addr:", blen );
     693                                        char *fromname = msn_findheader( body, "From:", blen );
     694                                       
     695                                        if( from && fromname )
     696                                                imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
     697
     698                                        g_free( from );
     699                                        g_free( fromname );
    693700                                }
    694701                        }
  • protocols/msn/tables.c

    r08e5bb2 rbe609ff  
    2929const struct msn_away_state msn_away_state_list[] =
    3030{
    31         {  0, "NLN", "Available" },
    32         {  1, "BSY", "Busy" },
    33         {  3, "IDL", "Idle" },
    34         {  5, "BRB", "Be Right Back" },
    35         {  7, "AWY", "Away" },
    36         {  9, "PHN", "On the Phone" },
    37         { 11, "LUN", "Out to Lunch" },
    38         { 13, "HDN", "Hidden" },
    39         { -1, "",    "" }
     31        { "NLN", "" },
     32        { "AWY", "Away" },
     33        { "BSY", "Busy" },
     34        { "IDL", "Idle" },
     35        { "BRB", "Be Right Back" },
     36        { "PHN", "On the Phone" },
     37        { "LUN", "Out to Lunch" },
     38        { "HDN", "Hidden" },
     39        { "",    "" }
    4040};
    41 
    42 const struct msn_away_state *msn_away_state_by_number( int number )
    43 {
    44         int i;
    45        
    46         for( i = 0; msn_away_state_list[i].number > -1; i ++ )
    47                 if( msn_away_state_list[i].number == number )
    48                         return( msn_away_state_list + i );
    49        
    50         return( NULL );
    51 }
    5241
    5342const struct msn_away_state *msn_away_state_by_code( char *code )
     
    5544        int i;
    5645       
    57         for( i = 0; msn_away_state_list[i].number > -1; i ++ )
     46        for( i = 0; *msn_away_state_list[i].code; i ++ )
    5847                if( g_strcasecmp( msn_away_state_list[i].code, code ) == 0 )
    5948                        return( msn_away_state_list + i );
    6049       
    61         return( NULL );
     50        return NULL;
    6251}
    6352
     
    6655        int i;
    6756       
    68         for( i = 0; msn_away_state_list[i].number > -1; i ++ )
     57        for( i = 0; *msn_away_state_list[i].code; i ++ )
    6958                if( g_strcasecmp( msn_away_state_list[i].name, name ) == 0 )
    7059                        return( msn_away_state_list + i );
    7160       
    72         return( NULL );
     61        return NULL;
    7362}
    7463
  • protocols/nogaim.c

    r08e5bb2 rbe609ff  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2006 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    268268        ic->flags |= OPT_LOGGED_IN;
    269269       
    270         /* Also necessary when we're not away, at least for some of the
    271            protocols. */
    272         imc_set_away( ic, u->away );
     270        /* Necessary to send initial presence status, even if we're not away. */
     271        imc_away_send_update( ic );
    273272       
    274273        /* Apparently we're connected successfully, so reset the
     
    10701069}
    10711070
    1072 static char *imc_away_alias_find( GList *gcm, char *away );
    1073 
    1074 int imc_set_away( struct im_connection *ic, char *away )
    1075 {
    1076         GList *m, *ms;
    1077         char *s;
    1078        
    1079         if( !away ) away = "";
    1080         ms = m = ic->acc->prpl->away_states( ic );
    1081        
    1082         while( m )
    1083         {
    1084                 if( *away )
    1085                 {
    1086                         if( g_strncasecmp( m->data, away, strlen( m->data ) ) == 0 )
    1087                                 break;
    1088                 }
    1089                 else
    1090                 {
    1091                         if( g_strcasecmp( m->data, "Available" ) == 0 )
    1092                                 break;
    1093                         if( g_strcasecmp( m->data, "Online" ) == 0 )
    1094                                 break;
    1095                 }
    1096                 m = m->next;
    1097         }
    1098        
    1099         if( m )
    1100         {
    1101                 ic->acc->prpl->set_away( ic, m->data, *away ? away : NULL );
    1102         }
    1103         else
    1104         {
    1105                 s = imc_away_alias_find( ms, away );
    1106                 if( s )
    1107                 {
    1108                         ic->acc->prpl->set_away( ic, s, away );
    1109                         if( set_getbool( &ic->irc->set, "debug" ) )
    1110                                 imcb_log( ic, "Setting away state to %s", s );
    1111                 }
    1112                 else
    1113                         ic->acc->prpl->set_away( ic, GAIM_AWAY_CUSTOM, away );
    1114         }
    1115        
    1116         return( 1 );
     1071static char *imc_away_state_find( GList *gcm, char *away, char **message );
     1072
     1073int imc_away_send_update( struct im_connection *ic )
     1074{
     1075        char *away, *msg = NULL;
     1076       
     1077        away = set_getstr( &ic->acc->set, "away" ) ?
     1078             : set_getstr( &ic->irc->set, "away" );
     1079        if( away && *away )
     1080        {
     1081                GList *m = ic->acc->prpl->away_states( ic );
     1082                msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL;
     1083                away = imc_away_state_find( m, away, &msg ) ? : m->data;
     1084        }
     1085        else if( ic->acc->flags & ACC_FLAG_STATUS_MESSAGE )
     1086        {
     1087                away = NULL;
     1088                msg = set_getstr( &ic->acc->set, "status" ) ?
     1089                    : set_getstr( &ic->irc->set, "status" );
     1090        }
     1091       
     1092        ic->acc->prpl->set_away( ic, away, msg );
     1093       
     1094        return 1;
    11171095}
    11181096
     
    11291107};
    11301108
    1131 static char *imc_away_alias_find( GList *gcm, char *away )
     1109static char *imc_away_state_find( GList *gcm, char *away, char **message )
    11321110{
    11331111        GList *m;
    11341112        int i, j;
    11351113       
     1114        for( m = gcm; m; m = m->next )
     1115                if( g_strncasecmp( m->data, away, strlen( m->data ) ) == 0 )
     1116                {
     1117                        /* At least the Yahoo! module works better if message
     1118                           contains no data unless it adds something to what
     1119                           we have in state already. */
     1120                        if( strlen( m->data ) == strlen( away ) )
     1121                                *message = NULL;
     1122                       
     1123                        return m->data;
     1124                }
     1125       
    11361126        for( i = 0; *imc_away_alias_list[i]; i ++ )
    11371127        {
     1128                int keep_message;
     1129               
    11381130                for( j = 0; imc_away_alias_list[i][j]; j ++ )
    11391131                        if( g_strncasecmp( away, imc_away_alias_list[i][j], strlen( imc_away_alias_list[i][j] ) ) == 0 )
     1132                        {
     1133                                keep_message = strlen( away ) != strlen( imc_away_alias_list[i][j] );
    11401134                                break;
     1135                        }
    11411136               
    11421137                if( !imc_away_alias_list[i][j] )        /* If we reach the end, this row */
     
    11461141                for( j = 0; imc_away_alias_list[i][j]; j ++ )
    11471142                {
    1148                         m = gcm;
    1149                         while( m )
    1150                         {
     1143                        for( m = gcm; m; m = m->next )
    11511144                                if( g_strcasecmp( imc_away_alias_list[i][j], m->data ) == 0 )
    1152                                         return( imc_away_alias_list[i][j] );
    1153                                 m = m->next;
    1154                         }
    1155                 }
    1156         }
    1157        
    1158         return( NULL );
     1145                                {
     1146                                        if( !keep_message )
     1147                                                *message = NULL;
     1148                                       
     1149                                        return imc_away_alias_list[i][j];
     1150                                }
     1151                }
     1152               
     1153                /* No need to look further, apparently this state doesn't
     1154                   have any good alias for this protocol. */
     1155                break;
     1156        }
     1157       
     1158        return NULL;
    11591159}
    11601160
  • protocols/nogaim.h

    r08e5bb2 rbe609ff  
    4949
    5050#define WEBSITE "http://www.bitlbee.org/"
    51 #define GAIM_AWAY_CUSTOM "Custom"
    5251
    5352/* Sharing flags between all kinds of things. I just hope I won't hit any
     
    218217       
    219218        /* You can tell what away states your protocol supports, so that
    220          * BitlBee will try to map the IRC away reasons to them, or use
    221          * GAIM_AWAY_CUSTOM when calling skype_set_away(). */
     219         * BitlBee will try to map the IRC away reasons to them. If your
     220         * protocol doesn't have any, just return one generic "Away". */
    222221        GList *(* away_states)(struct im_connection *ic);
    223222       
     
    315314
    316315/* Actions, or whatever. */
    317 int imc_set_away( struct im_connection *ic, char *away );
     316int imc_away_send_update( struct im_connection *ic );
    318317int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags );
    319318int imc_chat_msg( struct groupchat *c, char *msg, int flags );
  • protocols/oscar/oscar.c

    r08e5bb2 rbe609ff  
    380380                s->flags |= ACC_SET_OFFLINE_ONLY;
    381381        }
     382       
     383        acc->flags |= ACC_FLAG_AWAY_MESSAGE;
    382384}
    383385
     
    19521954static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message)
    19531955{
     1956        if (state == NULL)
     1957                state = "";
    19541958
    19551959        if (!g_strcasecmp(state, _("Visible"))) {
     
    19591963                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
    19601964                return;
    1961         } /* else... */
     1965        } else if (message == NULL) {
     1966                message = state;
     1967        }
    19621968
    19631969        if (od->rights.maxawaymsglen == 0)
     
    20022008        }
    20032009
    2004         if (!g_strcasecmp(state, "Online")) {
     2010        if (state == NULL) {
    20052011                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
    20062012        } else if (!g_strcasecmp(state, "Away")) {
     
    20272033                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
    20282034                ic->away = g_strdup(msg);
    2029         } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) {
     2035        } else {
    20302036                if (no_message) {
    20312037                        aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
     
    22762282{
    22772283        struct oscar_data *od = ic->proto_data;
    2278         GList *m = NULL;
    2279 
    2280         if (!od->icq)
    2281                 return g_list_append(m, GAIM_AWAY_CUSTOM);
    2282 
    2283         m = g_list_append(m, "Online");
    2284         m = g_list_append(m, "Away");
    2285         m = g_list_append(m, "Do Not Disturb");
    2286         m = g_list_append(m, "Not Available");
    2287         m = g_list_append(m, "Occupied");
    2288         m = g_list_append(m, "Free For Chat");
    2289         m = g_list_append(m, "Invisible");
    2290 
    2291         return m;
     2284
     2285        if (od->icq) {
     2286                static GList *m = NULL;
     2287                m = g_list_append(m, "Away");
     2288                m = g_list_append(m, "Do Not Disturb");
     2289                m = g_list_append(m, "Not Available");
     2290                m = g_list_append(m, "Occupied");
     2291                m = g_list_append(m, "Free For Chat");
     2292                m = g_list_append(m, "Invisible");
     2293                return m;
     2294        } else {
     2295                static GList *m = NULL;
     2296                m = g_list_append(m, "Away");
     2297                return m;
     2298        }
    22922299}
    22932300
  • protocols/yahoo/libyahoo2.c

    r08e5bb2 rbe609ff  
    15301530                        newbud = y_new0(struct yahoo_buddy, 1);
    15311531                        newbud->id = strdup(pair->value);
    1532                         if(cur_group)
     1532                        if (cur_group) {
    15331533                                newbud->group = strdup(cur_group);
    1534                         else {
    1535                                 struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth(
    1536                                                                 yd->buddies, y_list_length(yd->buddies)-1)->data;
    1537                                 newbud->group = strdup(lastbud->group);
     1534                        } else {
     1535                                YList *last;
     1536                                struct yahoo_buddy *lastbud;
     1537                               
     1538                                for (last = yd->buddies; last && last->next; last = last->next);
     1539                                if (last) {
     1540                                        lastbud = last->data;
     1541                                        newbud->group = strdup(lastbud->group);
     1542                                } else {
     1543                                        newbud->group = strdup("Buddies");
     1544                                }
    15381545                        }
    15391546
     
    23932400{
    23942401        struct yahoo_https_auth_data *had = req->data;
    2395         struct yahoo_input_data *yid = had->yid;
    2396         struct yahoo_data *yd = yid->yd;
     2402        struct yahoo_input_data *yid;
     2403        struct yahoo_data *yd;
    23972404        int st;
     2405       
     2406        if (y_list_find(inputs, had->yid) == NULL)
     2407                return;
     2408       
     2409        yid = had->yid;
     2410        yd = yid->yd;
    23982411       
    23992412        if (req->status_code != 200) {
     
    24362449{
    24372450        struct yahoo_https_auth_data *had = req->data;
    2438         struct yahoo_input_data *yid = had->yid;
    2439         struct yahoo_data *yd = yid->yd;
     2451        struct yahoo_input_data *yid;
     2452        struct yahoo_data *yd;
    24402453        struct yahoo_packet *pack;
    2441         char *crumb;
     2454        char *crumb = NULL;
    24422455        int st;
     2456       
     2457        if (y_list_find(inputs, had->yid) == NULL)
     2458                return;
     2459       
     2460        yid = had->yid;
     2461        yd = yid->yd;
    24432462       
    24442463        md5_byte_t result[16];
     
    40804099
    40814100        yd = yid->yd;
    4082 
    40834101        old_status = yd->current_status;
    4084 
    4085         if (msg && strncmp(msg,"Invisible",9)) {
    4086                 yd->current_status = YAHOO_STATUS_CUSTOM;
    4087         } else {
    4088                 yd->current_status = state;
    4089         }
     4102        yd->current_status = state;
    40904103
    40914104        /* Thank you libpurple :) */
     
    41024115        snprintf(s, sizeof(s), "%d", yd->current_status);
    41034116        yahoo_packet_hash(pkt, 10, s);
    4104          
    4105         if (yd->current_status == YAHOO_STATUS_CUSTOM) {
    4106                 yahoo_packet_hash(pkt, 19, msg);
    4107         } else {
    4108                 yahoo_packet_hash(pkt, 19, "");
    4109         }
    4110        
     4117        yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : "");
    41114118        yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0");
    4112 
    41134119        yahoo_send_packet(yid, pkt, 0);
    41144120        yahoo_packet_free(pkt);
  • protocols/yahoo/yahoo.c

    r08e5bb2 rbe609ff  
    130130{
    131131        set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
     132       
     133        acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
    132134}
    133135
     
    197199{
    198200        struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
    199         char *away;
    200        
    201         away = NULL;
    202        
    203         if( state && msg && g_strcasecmp( state, msg ) != 0 )
    204         {
    205                 yd->current_status = YAHOO_STATUS_CUSTOM;
    206                 away = "";
    207         }
    208         else if( state )
    209         {
    210                 /* Set msg to NULL since (if it isn't NULL already) it's equal
    211                    to state. msg must be empty if we want to use an existing
    212                    away state. */
    213                 msg = NULL;
    214                
    215                 away = "";
    216                 if( g_strcasecmp( state, "Available" ) == 0 )
    217                 {
    218                         yd->current_status = YAHOO_STATUS_AVAILABLE;
    219                         away = NULL;
    220                 }
    221                 else if( g_strcasecmp( state, "Be Right Back" ) == 0 )
     201       
     202        if( state && msg == NULL )
     203        {
     204                /* Use these states only if msg doesn't contain additional
     205                   info since away messages are only supported with CUSTOM. */
     206                if( g_strcasecmp( state, "Be Right Back" ) == 0 )
    222207                        yd->current_status = YAHOO_STATUS_BRB;
    223208                else if( g_strcasecmp( state, "Busy" ) == 0 )
     
    239224                else if( g_strcasecmp( state, "Invisible" ) == 0 )
    240225                        yd->current_status = YAHOO_STATUS_INVISIBLE;
    241                 else if( g_strcasecmp( state, GAIM_AWAY_CUSTOM ) == 0 )
    242                 {
    243                         yd->current_status = YAHOO_STATUS_AVAILABLE;
    244                        
    245                         away = NULL;
    246                 }
    247         }
     226                else
     227                        yd->current_status = YAHOO_STATUS_CUSTOM;
     228        }
     229        else if( state )
     230                yd->current_status = YAHOO_STATUS_CUSTOM;
    248231        else
    249232                yd->current_status = YAHOO_STATUS_AVAILABLE;
    250233       
    251         yahoo_set_away( yd->y2_id, yd->current_status, msg, away != NULL ? 2 : 0 );
     234        yahoo_set_away( yd->y2_id, yd->current_status, msg, state ? 2 : 0 );
    252235}
    253236
     
    258241        if( m == NULL )
    259242        {
    260                 m = g_list_append( m, "Available" );
    261243                m = g_list_append( m, "Be Right Back" );
    262244                m = g_list_append( m, "Busy" );
     
    269251                m = g_list_append( m, "Stepped Out" );
    270252                m = g_list_append( m, "Invisible" );
    271                 m = g_list_append( m, GAIM_AWAY_CUSTOM );
    272253        }
    273254       
  • root_commands.c

    r08e5bb2 rbe609ff  
    11151115                irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] );
    11161116        }
    1117 
    1118 
    1119 
    1120 #if 0
    1121         account_t *a;
    1122         struct im_connection *ic;
    1123         char *chat, *channel, *nick = NULL, *password = NULL;
    1124         struct groupchat *c;
    1125        
    1126         if( !( a = account_get( irc, cmd[1] ) ) )
    1127         {
    1128                 irc_usermsg( irc, "Invalid account" );
    1129                 return;
    1130         }
    1131         else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) )
    1132         {
    1133                 irc_usermsg( irc, "That account is not on-line" );
    1134                 return;
    1135         }
    1136         else if( a->prpl->chat_join == NULL )
    1137         {
    1138                 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
    1139                 return;
    1140         }
    1141         ic = a->ic;
    1142        
    1143         chat = cmd[2];
    1144         if( cmd[3] )
    1145         {
    1146                 if( strchr( CTYPES, cmd[3][0] ) == NULL )
    1147                         channel = g_strdup_printf( "&%s", cmd[3] );
    1148                 else
    1149                         channel = g_strdup( cmd[3] );
    1150         }
    1151         else
    1152         {
    1153                 char *s;
    1154                
    1155                 channel = g_strdup_printf( "&%s", chat );
    1156                 if( ( s = strchr( channel, '@' ) ) )
    1157                         *s = 0;
    1158         }
    1159         if( cmd[3] && cmd[4] )
    1160                 nick = cmd[4];
    1161         else
    1162                 nick = irc->nick;
    1163         if( cmd[3] && cmd[4] && cmd[5] )
    1164                 password = cmd[5];
    1165        
    1166         if( !nick_ok( channel + 1 ) )
    1167         {
    1168                 irc_usermsg( irc, "Invalid channel name: %s", channel );
    1169                 g_free( channel );
    1170                 return;
    1171         }
    1172         else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) )
    1173         {
    1174                 irc_usermsg( irc, "Channel already exists: %s", channel );
    1175                 g_free( channel );
    1176                 return;
    1177         }
    1178        
    1179         if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) )
    1180         {
    1181                 g_free( c->channel );
    1182                 c->channel = channel;
    1183         }
    1184         else
    1185         {
    1186                 irc_usermsg( irc, "Tried to join chat, not sure if this was successful" );
    1187                 g_free( channel );
    1188         }
    1189 #endif
    11901117}
    11911118
  • unix.c

    r08e5bb2 rbe609ff  
    2525
    2626#include "bitlbee.h"
     27
     28#include "arc.h"
     29#include "base64.h"
    2730#include "commands.h"
    28 #include "crypting.h"
    2931#include "protocols/nogaim.h"
    3032#include "help.h"
    3133#include "ipc.h"
     34#include "md5.h"
     35#include "misc.h"
    3236#include <signal.h>
    3337#include <unistd.h>
     
    4044static void sighandler( int signal );
    4145
     46static int crypt_main( int argc, char *argv[] );
     47
    4248int main( int argc, char *argv[] )
    4349{
     
    4551        char *old_cwd = NULL;
    4652        struct sigaction sig, old;
     53       
     54        if( argc > 1 && strcmp( argv[1], "-x" ) == 0 )
     55                return crypt_main( argc, argv );
    4756       
    4857        log_init();
     
    159168}
    160169
     170static int crypt_main( int argc, char *argv[] )
     171{
     172        int pass_len;
     173        unsigned char *pass_cr, *pass_cl;
     174       
     175        if( argc < 4 || ( strcmp( argv[2], "hash" ) != 0 &&
     176                          strcmp( argv[2], "unhash" ) != 0 && argc < 5 ) )
     177        {
     178                printf( "Supported:\n"
     179                        "  %s -x enc <key> <cleartext password>\n"
     180                        "  %s -x dec <key> <encrypted password>\n"
     181                        "  %s -x hash <cleartext password>\n"
     182                        "  %s -x unhash <hashed password>\n"
     183                        "  %s -x chkhash <hashed password> <cleartext password>\n",
     184                        argv[0], argv[0], argv[0], argv[0], argv[0] );
     185        }
     186        else if( strcmp( argv[2], "enc" ) == 0 )
     187        {
     188                pass_len = arc_encode( argv[4], strlen( argv[4] ), (unsigned char**) &pass_cr, argv[3], 12 );
     189                printf( "%s\n", base64_encode( pass_cr, pass_len ) );
     190        }
     191        else if( strcmp( argv[2], "dec" ) == 0 )
     192        {
     193                pass_len = base64_decode( argv[4], (unsigned char**) &pass_cr );
     194                arc_decode( pass_cr, pass_len, (char**) &pass_cl, argv[3] );
     195                printf( "%s\n", pass_cl );
     196        }
     197        else if( strcmp( argv[2], "hash" ) == 0 )
     198        {
     199                md5_byte_t pass_md5[21];
     200                md5_state_t md5_state;
     201               
     202                random_bytes( pass_md5 + 16, 5 );
     203                md5_init( &md5_state );
     204                md5_append( &md5_state, (md5_byte_t*) argv[3], strlen( argv[3] ) );
     205                md5_append( &md5_state, pass_md5 + 16, 5 ); /* Add the salt. */
     206                md5_finish( &md5_state, pass_md5 );
     207               
     208                printf( "%s\n", base64_encode( pass_md5, 21 ) );
     209        }
     210        else if( strcmp( argv[2], "unhash" ) == 0 )
     211        {
     212                printf( "Hash %s submitted to a massive Beowulf cluster of\n"
     213                        "overclocked 486s. Expect your answer next year somewhere around this time. :-)\n", argv[3] );
     214        }
     215        else if( strcmp( argv[2], "chkhash" ) == 0 )
     216        {
     217                char *hash = strncmp( argv[3], "md5:", 4 ) == 0 ? argv[3] + 4 : argv[3];
     218                int st = md5_verify_password( argv[4], hash );
     219               
     220                printf( "Hash %s given password.\n", st == 0 ? "matches" : "does not match" );
     221               
     222                return st;
     223        }
     224       
     225        return 0;
     226}
     227
    161228static void sighandler( int signal )
    162229{
     
    214281        return( (double) time->tv_sec + (double) time->tv_usec / 1000000 );
    215282}
    216 
    217 
Note: See TracChangeset for help on using the changeset viewer.