dynwatch

view socklib.h @ 0:ce3c5e4c75bf

dynwatch DynDNS updater for windows
author John Tsiombikas <nuclear@siggraph.org>
date Wed, 18 May 2011 05:53:29 +0300
parents
children
line source
1 /*
2 This file is part of socklib, a cross-platform socket library.
4 Copyright (c) 2004 John Tsiombikas <nuclear@siggraph.org>
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
21 #ifndef _SOCKLIB_H_
22 #define _SOCKLIB_H_
25 #define SL_CHK_BLOCK 0
26 #define SL_CHK_IMMED 1
27 #define SL_CHK_READ 2
28 #define SL_CHK_WRITE 4
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
35 int sl_listen(int port);
36 int sl_accept(int listening_socket);
37 int sl_connect_tcp(char *ipaddr, const char *hostname, int port);
38 void sl_close_socket(int s);
39 int sl_send_data(int s, const char *buffer, int size);
40 int sl_recv_data(int s, char *buffer, int size);
41 int sl_check_socket(int s, int flags, unsigned int timeout);
42 void sl_set_verbosity(int vlevel);
44 #ifdef __cplusplus
45 }
46 #endif /* __cplusplus */
48 #endif /* _SOCKLIB_H_ */