Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

altsocklib.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * $Id: altsocklib.h,v 1.4 2004/01/05 17:46:23 gareuselesinge Exp $
00003  * This file is part of liberopops (http://liberopops.sf.net)                 *
00004  * This file is distributed under the terms of GNU GPL license.               *
00005  ******************************************************************************/
00006 
00007 
00008 /******************************************************************************/
00016 /******************************************************************************/
00017 
00018 
00019 
00020 #ifndef _ALTSOCKLIB_H_
00021 #define _ALTSOCKLIB_H_
00022 
00023 #include <stdlib.h>
00024 #ifndef WIN32
00025         #include <sys/socket.h>
00026         #include <netinet/in.h>
00027         #include <arpa/inet.h>
00028 #else
00029         #include <winsock.h>
00030 #endif
00031 
00041 int sockopen(char *host, struct in_addr bind_add, unsigned short port);
00042 int sockinfo(int sock, char *info);
00043 int sockclose(int sock);
00044 int senddata(int socket, char *buffer, int length);
00045 int senddata_raw(int socket, char *buffer, int length);
00046 int recvdata(int socket, char *buffer, int maxsize);
00047 void sockerror(char *msg);
00048 
00050 typedef struct {
00051         char *recvbuffer;
00052         char *bufp;
00053         char *bufe;
00054         int   size;
00055 } recvbuffer_t;
00056 
00057 recvbuffer_t *recvBufferCreate(int size);
00058 void recvBufferDestroy(recvbuffer_t *rb);
00059 int recvstring(int socket, char *buffer, int maxsize, recvbuffer_t *r);
00060 int recvstring_with_timeout(int socket, char *buffer, int maxsize, recvbuffer_t *r, int timeout);
00061 int sendstring(int socket, char *string);
00062 int sendstring_raw(int socket, char *string);
00063 #ifdef WIN32
00064 void sockinit();
00065 #endif
00066 
00067 
00068 #endif

Generated on Wed May 5 15:48:03 2004 for LiberoPOPs by doxygen 1.3.6-20040222