Began removing $Id$ tags. This will be an ongoing process.
[citadel.git] / citadel / clientsocket.h
1 /*
2  * Header file for TCP client socket library
3  *
4  * Copyright (c) 1987-2009 by the citadel.org team
5  *
6  *  This program 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 3 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program 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.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 int sock_connect(char *host, char *service);
22 int sock_read_to(int *sock, char *buf, int bytes, int timeout, int keep_reading_until_full);
23 int sock_read(int *sock, char *buf, int bytes, int keep_reading_until_full);
24 int sock_write(int *sock, const char *buf, int nbytes);
25 int ml_sock_gets(int *sock, char *buf);
26 int sock_getln(int *sock, char *buf, int bufsize);
27 int CtdlSockGetLine(int *sock, StrBuf *Target);
28 int sock_puts(int *sock, char *buf);
29
30
31 /* 
32  * This looks dumb, but it's being done for future portability
33  */
34 #define sock_close(sock)                close(sock)
35 #define sock_shutdown(sock, how)        shutdown(sock, how)
36
37 /* 
38  * Default timeout for client sessions
39  */
40 #define CLIENT_TIMEOUT          600