Changeset 1eddf6b


Ignore:
Timestamp:
2005-12-08T12:30:43Z (14 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
c2295f7
Parents:
c3ffa45
Message:

Add some const

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    rc3ffa45 r1eddf6b  
    244244}
    245245
    246 int bitlbee_load( irc_t *irc, char* password )
     246int bitlbee_load( irc_t *irc, const char* password )
    247247{
    248248        char s[512];
  • bitlbee.h

    rc3ffa45 r1eddf6b  
    127127int root_command_string( irc_t *irc, user_t *u, char *command, int flags );
    128128int root_command( irc_t *irc, char *command[] );
    129 int bitlbee_load( irc_t *irc, char *password );
     129int bitlbee_load( irc_t *irc, const char *password );
    130130int bitlbee_save( irc_t *irc );
    131131void bitlbee_shutdown( gpointer data );
  • crypting.c

    rc3ffa45 r1eddf6b  
    6767/* USE WITH CAUTION!
    6868   Sets pass without checking */
    69 void setpassnc (irc_t *irc, char *pass) {
     69void setpassnc (irc_t *irc, const char *pass)
     70{
    7071        if (!set_find (irc, "password"))
    7172                set_add (irc, "password", NULL, passchange);
     
    8182}
    8283
    83 char *passchange (irc_t *irc, void *set, char *value) {
     84char *passchange (irc_t *irc, void *set, const char *value) {
    8485        setpassnc (irc, value);
    8586        return (NULL);
    8687}
    8788
    88 int setpass (irc_t *irc, char *pass, char* md5sum) {
     89int setpass (irc_t *irc, const char *pass, const char* md5sum)
     90{
    8991        md5_state_t md5state;
    9092        md5_byte_t digest[16];
  • crypting.h

    rc3ffa45 r1eddf6b  
    2424*/
    2525
    26 void setpassnc (irc_t *irc, char *pass); /* USE WITH CAUTION! */
    27 char *passchange (irc_t *irc, void *set, char *value);
    28 int setpass (irc_t *irc, char *pass, char* md5sum);
     26void setpassnc (irc_t *irc, const char *pass); /* USE WITH CAUTION! */
     27char *passchange (irc_t *irc, void *set, const char *value);
     28int setpass (irc_t *irc, const char *pass, const char* md5sum);
    2929char *hashpass (irc_t *irc);
    3030char *obfucrypt (irc_t *irc, char *line);
  • nick.c

    rc3ffa45 r1eddf6b  
    2727#include "bitlbee.h"
    2828
    29 void nick_set( irc_t *irc, char *handle, int proto, char *nick )
     29void nick_set( irc_t *irc, const char *handle, int proto, const char *nick )
    3030{
    3131        nick_t *m = NULL, *n = irc->nicks;
     
    5656}
    5757
    58 char *nick_get( irc_t *irc, char *handle, int proto, const char *realname )
     58char *nick_get( irc_t *irc, const 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, char *nick )
     131void nick_del( irc_t *irc, const char *nick )
    132132{
    133133        nick_t *l = NULL, *n = irc->nicks;
     
    176176}
    177177
    178 int nick_ok( char *nick )
    179 {
    180         char *s;
     178int nick_ok( const char *nick )
     179{
     180        const char *s;
    181181       
    182182        /* Empty/long nicks are not allowed */
     
    237237}
    238238
    239 int nick_cmp( char *a, char *b )
     239int nick_cmp( const char *a, const char *b )
    240240{
    241241        char aa[1024] = "", bb[1024] = "";
     
    253253}
    254254
    255 char *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 }
     255char *nick_dup( const char *nick )
     256{
     257        return g_strndup( nick, MAX_NICK_LENGTH );
     258}
  • nick.h

    rc3ffa45 r1eddf6b  
    3232} nick_t;
    3333
    34 void nick_set( irc_t *irc, char *handle, int proto, char *nick );
    35 char *nick_get( irc_t *irc, char *handle, int proto, const char *realname );
    36 void nick_del( irc_t *irc, char *nick );
     34void nick_set( irc_t *irc, const char *handle, int proto, const char *nick );
     35char *nick_get( irc_t *irc, const char *handle, int proto, const char *realname );
     36void nick_del( irc_t *irc, const char *nick );
    3737void nick_strip( char *nick );
    3838
    39 int nick_ok( char *nick );
     39int nick_ok( const char *nick );
    4040int nick_lc( char *nick );
    4141int nick_uc( char *nick );
    42 int nick_cmp( char *a, char *b );
    43 char *nick_dup( char *nick );
     42int nick_cmp( const char *a, const char *b );
     43char *nick_dup( const char *nick );
Note: See TracChangeset for help on using the changeset viewer.