Mercurial > hg > nnchat
view libnnchat.h @ 64:6a3a917303e4
Some random cleanups, bring back WinSock support.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Nov 2008 22:33:35 +0200 |
parents | ff5d74f0d428 |
children | e763ef5cfd53 |
line wrap: on
line source
/* * NNChat - Custom chat client for NewbieNudes.com chatrooms * Written by Matti 'ccr' Hämäläinen * (C) Copyright 2008 Tecnic Software productions (TNSP) */ #ifndef LIBNNCHAT_H #define LIBNNCHAT_H #include <stdio.h> #include <unistd.h> #ifdef __WIN32 #warning Compiling for Windows #include <winsock.h> #else #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> #endif #include <sys/types.h> #include <errno.h> #include "th_string.h" #define SET_BUFSIZE (4096) #define SET_ALLOC_SIZE (128) int openConnection(struct in_addr *addr, const int port); void closeConnection(const int sock); BOOL sendToSocket(const int sock, char *buf, const size_t bufLen); BOOL sendUserMsg(const int sock, const char *user, const char *fmt, ...); char *encodeStr1(const char *str); char *decodeStr1(const char *str); char *encodeStr2(const char *str); char *decodeStr2(const char *str); char *stripXMLTags(const char *str); #endif