Mercurial > hg > nnchat
diff libnnchat.h @ 102:b096ae97fc7d
Renamed functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 11 Oct 2010 15:48:05 +0300 |
parents | 218efd2f0641 |
children | eaa524e153f9 |
line wrap: on
line diff
--- a/libnnchat.h Mon Oct 11 15:47:48 2010 +0300 +++ b/libnnchat.h Mon Oct 11 15:48:05 2010 +0300 @@ -1,7 +1,7 @@ /* * NNChat - Custom chat client for NewbieNudes.com chatrooms * Written by Matti 'ccr' Hämäläinen - * (C) Copyright 2008 Tecnic Software productions (TNSP) + * (C) Copyright 2008-2010 Tecnic Software productions (TNSP) */ #ifndef LIBNNCHAT_H #define LIBNNCHAT_H @@ -24,22 +24,26 @@ #define SET_BUFSIZE (4096) #define SET_ALLOC_SIZE (128) + typedef struct { char **data; size_t n, size; } nn_ringbuf_t; + typedef struct { ssize_t pos, len, size; char *data; } nn_editbuf_t; + typedef struct _nn_user_t { char *name, *encname; time_t lastspoke, joined; struct _nn_user_t *next; } nn_user_t; + #define NN_NUM_BUCKETS (256) typedef struct { @@ -60,12 +64,12 @@ BOOL nn_send_to_socket(const int sock, char *buf, const size_t bufLen); BOOL nn_send_msg(const int sock, const char *user, const char *fmt, ...); -int addUserToHash(nn_userhash_t **, char *encname); -void freeUserHash(nn_userhash_t *); -void freeUserList(nn_user_t *); -nn_user_t * copyUser(nn_user_t *src); -nn_user_t * findUserEnc(nn_userhash_t *list, char *encname); -nn_user_t * matchUsersEnc(nn_userhash_t *list, char *encname, int index); +int nn_user_add_to_hash(nn_userhash_t **, const char *encname); +void nn_user_free_hash(nn_userhash_t *); +void nn_user_free_list(nn_user_t *); +nn_user_t * nn_user_copy(const nn_user_t *src); +nn_user_t * nn_user_find_enc(const nn_userhash_t *list, const char *encname); +nn_user_t * nn_user_match_enc(const nn_userhash_t *list, const char *encname, const int index); char * nn_encode_str1(const char *str); char * nn_decode_str1(const char *str);