comparison libnnchat.h @ 97:218efd2f0641

Rename functions for clarity.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 17 Nov 2009 19:20:25 +0200
parents 6e47426efb6a
children b096ae97fc7d
comparison
equal deleted inserted replaced
96:7c9538e71c89 97:218efd2f0641
48 48
49 49
50 #ifdef __WIN32 50 #ifdef __WIN32
51 const char *hstrerror(int err); 51 const char *hstrerror(int err);
52 #endif 52 #endif
53 int getSocketErrno(void); 53 int nn_get_socket_errno(void);
54 const char *getSocketErrStr(int err); 54 const char *nn_get_socket_errstr(int err);
55 BOOL initNetwork(void); 55 BOOL nn_network_init(void);
56 void closeNetwork(void); 56 void nn_network_close(void);
57 57
58 int openConnection(struct in_addr *addr, const int port); 58 int nn_open_connection(struct in_addr *addr, const int port);
59 void closeConnection(const int sock); 59 void nn_close_connection(const int sock);
60 BOOL sendToSocket(const int sock, char *buf, const size_t bufLen); 60 BOOL nn_send_to_socket(const int sock, char *buf, const size_t bufLen);
61 BOOL sendUserMsg(const int sock, const char *user, const char *fmt, ...); 61 BOOL nn_send_msg(const int sock, const char *user, const char *fmt, ...);
62 62
63 int addUserToHash(nn_userhash_t **, char *encname); 63 int addUserToHash(nn_userhash_t **, char *encname);
64 void freeUserHash(nn_userhash_t *); 64 void freeUserHash(nn_userhash_t *);
65 void freeUserList(nn_user_t *); 65 void freeUserList(nn_user_t *);
66 nn_user_t * copyUser(nn_user_t *src); 66 nn_user_t * copyUser(nn_user_t *src);
67 nn_user_t * findUserEnc(nn_userhash_t *list, char *encname); 67 nn_user_t * findUserEnc(nn_userhash_t *list, char *encname);
68 nn_user_t * matchUsersEnc(nn_userhash_t *list, char *encname, int index); 68 nn_user_t * matchUsersEnc(nn_userhash_t *list, char *encname, int index);
69 69
70 char * encodeStr1(const char *str); 70 char * nn_encode_str1(const char *str);
71 char * decodeStr1(const char *str); 71 char * nn_decode_str1(const char *str);
72 char * encodeStr2(const char *str); 72 char * nn_encode_str2(const char *str);
73 char * decodeStr2(const char *str); 73 char * nn_decode_str2(const char *str);
74 char * stripXMLTags(const char *str); 74 char * nn_strip_tags(const char *str);
75 char * doubleDecodeStr(const char *str); 75 char * nn_dbldecode_str(const char *str);
76 char * doubleEncodeStr(const char *str); 76 char * nn_dblencode_str(const char *str);
77 77
78 78
79 nn_ringbuf_t * newRingBuf(const size_t size); 79 nn_ringbuf_t * nn_ringbuf_new(const size_t size);
80 void freeRingBuf(nn_ringbuf_t *buf); 80 void nn_ringbuf_free(nn_ringbuf_t *buf);
81 void addRingBuf(nn_ringbuf_t *buf, const char *str); 81 void nn_ringbuf_add(nn_ringbuf_t *buf, const char *str);
82 82
83 int writeBuf(nn_editbuf_t *buf, ssize_t pos, int ch); 83 int nn_editbuf_write(nn_editbuf_t *buf, ssize_t pos, int ch);
84 int insertBuf(nn_editbuf_t *buf, ssize_t pos, int ch); 84 int nn_editbuf_insert(nn_editbuf_t *buf, ssize_t pos, int ch);
85 int deleteBuf(nn_editbuf_t *buf, ssize_t pos); 85 int nn_editbuf_delete(nn_editbuf_t *buf, ssize_t pos);
86 void clearBuf(nn_editbuf_t *buf); 86 void nn_editbuf_clear(nn_editbuf_t *buf);
87 nn_editbuf_t * newBuf(ssize_t n); 87 nn_editbuf_t * nn_editbuf_new(ssize_t n);
88 void freeBuf(nn_editbuf_t *buf); 88 void nn_editbuf_free(nn_editbuf_t *buf);
89 nn_editbuf_t * copyBuf(nn_editbuf_t *src); 89 nn_editbuf_t * nn_editbuf_copy(nn_editbuf_t *src);
90 void setBufPos(nn_editbuf_t *buf, ssize_t pos); 90 void nn_editbuf_setpos(nn_editbuf_t *buf, ssize_t pos);
91 91
92 92
93 #endif 93 #endif