aboutsummaryrefslogtreecommitdiffstats
path: root/socket.h
blob: a69f36bc57b2c54c7c4b9b7ba5db83750c010204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * socket.h -- declarations for socket library functions
 *
 * For license terms, see the file COPYING in this directory.
 */

#ifndef SOCKET__
#define SOCKET__

/*
Create a new client socket 
returns (FILE *)NULL on error 
*/
FILE *Socket(char *host, int clientPort);

/* 
Get a string terminated by an '\n', delete any '\r' and the '\n'.
Pass it a valid socket, a buffer for the string, and
the length of the buffer (including the trailing \0)
returns 0 for success. 
*/
int SockGets(char *buf, int len, FILE *sockfp);

#endif /* SOCKET__ */