Changes in / [8efa2f4:7989fcf3]


Ignore:
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • crypting.c

    r8efa2f4 r7989fcf3  
    4646} irc_t;
    4747
     48#define set_add( a, b, c, d )
     49#define set_find( a, b ) NULL
     50
    4851#include "md5.h"
    4952#include "crypting.h"
     
    6669void setpassnc (irc_t *irc, const char *pass)
    6770{
     71        if (!set_find (irc, "password"))
     72                set_add (irc, "password", NULL, passchange);
     73       
    6874        if (irc->password) g_free (irc->password);
    6975       
     
    7682}
    7783
    78 int setpass (irc_t *irc, const char *pass, const char* md5sum)
    79 {
     84char *passchange (irc_t *irc, void *set, char *value) {
     85        setpassnc (irc, value);
     86        return (NULL);
     87}
     88
     89int setpass (irc_t *irc, const char *pass, char* md5sum) {
    8090        md5_state_t md5state;
    8191        md5_byte_t digest[16];
  • crypting.h

    r8efa2f4 r7989fcf3  
    2525
    2626void setpassnc (irc_t *irc, const char *pass); /* USE WITH CAUTION! */
    27 int setpass (irc_t *irc, const char *pass, const char* md5sum);
     27char *passchange (irc_t *irc, void *set, char *value);
     28int setpass (irc_t *irc, const char *pass, char* md5sum);
    2829char *hashpass (irc_t *irc);
    2930char *obfucrypt (irc_t *irc, char *line);
  • irc.c

    r8efa2f4 r7989fcf3  
    3131
    3232GSList *irc_connection_list = NULL;
    33 
    34 char *passchange (irc_t *irc, void *set, char *value)
    35 {
    36         setpassnc (irc, value);
    37         return (NULL);
    38 }
    3933
    4034irc_t *irc_new( int fd )
     
    135129        set_add( irc, "to_char", ": ", set_eval_to_char );
    136130        set_add( irc, "typing_notice", "false", set_eval_bool );
    137         set_add( irc, "password", NULL, passchange);
    138131       
    139132        conf_loaddefaults( irc );
  • nick.c

    r8efa2f4 r7989fcf3  
    2727#include "bitlbee.h"
    2828
    29 void nick_set( irc_t *irc, const char *handle, int proto, const char *nick )
     29void nick_set( irc_t *irc, char *handle, int proto, char *nick )
    3030{
    3131        nick_t *m = NULL, *n = irc->nicks;
     
    5656}
    5757
    58 char *nick_get( irc_t *irc, const char *handle, int proto, const char *realname )
     58char *nick_get( irc_t *irc, char *handle, int proto, const char *realname )
    5959{
    6060        static char nick[MAX_NICK_LENGTH+1];
     
    129129}
    130130
    131 void nick_del( irc_t *irc, const char *nick )
     131void nick_del( irc_t *irc, char *nick )
    132132{
    133133        nick_t *l = NULL, *n = irc->nicks;
     
    176176}
    177177
    178 int nick_ok( const char *nick )
    179 {
    180         const char *s;
     178int nick_ok( char *nick )
     179{
     180        char *s;
    181181       
    182182        /* Empty/long nicks are not allowed */
     
    237237}
    238238
    239 int nick_cmp( const char *a, const char *b )
     239int nick_cmp( char *a, char *b )
    240240{
    241241        char aa[1024] = "", bb[1024] = "";
     
    253253}
    254254
    255 char *nick_dup( const char *nick )
    256 {
    257         return g_strndup( nick, MAX_NICK_LENGTH );
    258 }
     255char *nick_dup( char *nick )
     256{
     257        char *cp;
     258       
     259        cp = g_new0 ( char, MAX_NICK_LENGTH + 1 );
     260        strncpy( cp, nick, MAX_NICK_LENGTH );
     261       
     262        return( cp );
     263}
  • nick.h

    r8efa2f4 r7989fcf3  
    3232} nick_t;
    3333
    34 void nick_set( irc_t *irc, const char *handle, int proto, const char *nick );
    35 char *nick_get( irc_t *irc, const char *handle, int proto, const char *realname );
    36 void nick_del( irc_t *irc, const char *nick );
     34void nick_set( irc_t *irc, char *handle, int proto, char *nick );
     35char *nick_get( irc_t *irc, char *handle, int proto, const char *realname );
     36void nick_del( irc_t *irc, char *nick );
    3737void nick_strip( char *nick );
    3838
    39 int nick_ok( const char *nick );
     39int nick_ok( char *nick );
    4040int nick_lc( char *nick );
    4141int nick_uc( char *nick );
    42 int nick_cmp( const char *a, const char *b );
    43 char *nick_dup( const char *nick );
     42int nick_cmp( char *a, char *b );
     43char *nick_dup( char *nick );
  • protocols/proxy.c

    r8efa2f4 r7989fcf3  
    5050#define GAIM_ERR_COND   (G_IO_HUP | G_IO_ERR | G_IO_NVAL)
    5151
     52/*FIXME*               
     53        #ifndef _WIN32
     54                if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
     55                        closesocket(fd);
     56                        g_free(phb);
     57                        return -1;
     58                }
     59                fcntl(fd, F_SETFL, 0);
     60#endif*/
     61
    5262char proxyhost[128] = "";
    5363int proxyport = 0;
     
    7383
    7484
    75 static struct sockaddr_in *gaim_gethostbyname(const char *host, int port)
     85static struct sockaddr_in *gaim_gethostbyname(char *host, int port)
    7686{
    7787        static struct sockaddr_in sin;
     
    144154}
    145155
    146 static int proxy_connect_none(const char *host, unsigned short port, struct PHB *phb)
     156static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)
    147157{
    148158        struct sockaddr_in *sin;
     
    271281}
    272282
    273 static int proxy_connect_http(const char *host, unsigned short port, struct PHB *phb)
     283static int proxy_connect_http(char *host, unsigned short port, struct PHB *phb)
    274284{
    275285        phb->host = g_strdup(host);
     
    355365}
    356366
    357 static int proxy_connect_socks4(const char *host, unsigned short port, struct PHB *phb)
     367static int proxy_connect_socks4(char *host, unsigned short port, struct PHB *phb)
    358368{
    359369        phb->host = g_strdup(host);
     
    537547}
    538548
    539 static int proxy_connect_socks5(const char *host, unsigned short port, struct PHB *phb)
     549static int proxy_connect_socks5(char *host, unsigned short port, struct PHB *phb)
    540550{
    541551        phb->host = g_strdup(host);
     
    578588}
    579589
    580 int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data)
     590int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data)
    581591{
    582592        struct PHB *phb;
  • protocols/proxy.h

    r8efa2f4 r7989fcf3  
    5656G_MODULE_EXPORT void gaim_input_remove(gint);
    5757
    58 G_MODULE_EXPORT int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data);
     58G_MODULE_EXPORT int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data);
    5959
    6060#endif /* _PROXY_H_ */
Note: See TracChangeset for help on using the changeset viewer.