diff options
author | William Harrington <kb0iic@berzerkula.org> | 2025-01-14 16:06:02 -0600 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2025-01-14 16:06:02 -0600 |
commit | 0cc9b20c15460213e488bf5e70963b941482f628 (patch) | |
tree | bb0143245583ec846630f39bfa2258dba640ccd7 /sdk/net/stream.h | |
parent | 0e084ade5069756d487b5c948c48b777e37c00c9 (diff) |
Add source.
Diffstat (limited to 'sdk/net/stream.h')
-rw-r--r-- | sdk/net/stream.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sdk/net/stream.h b/sdk/net/stream.h new file mode 100644 index 0000000..268d881 --- /dev/null +++ b/sdk/net/stream.h @@ -0,0 +1,45 @@ +/* + * Stream oriented TCP session routines. + * $Id$ + * Copyright (c) 1997 by Tycho Softworks. + * For conditions of distribution and reuse see product license. + */ + +#ifndef __NET_STREAM_H__ +#define __NET_STREAM_H__ + +#ifndef __NET_SOCKET_H__ +#include <net/socket.h> +#endif + +#define tcppeer(fp) peername(fileno(fp)) +#define tcphome(fp) homename(fileno(fp)) + +typedef FILE *STREAM; + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __NAMESPACE +#define opentcp __NAMESPACE(opentcp) +#define accepttcp __NAMESPACE(accepttcp) +#define gettcp __NAMESPACE(gettcp) +#define puttcp __NAMESPACE(puttcp) +#define closetcp __NAMESPACE(closetcp) +#define buftcp __NAMESPACE(buftcp) +#endif + +STREAM opentcp(const char *hostname, int port); +STREAM accepttcp(SOCKET so); +char *gettcp(char *buf, size_t count, STREAM fp); +int puttcp(char *str, STREAM fp); +void closetcp(STREAM fp); +int buftcp(STREAM fp, int size); + +#ifdef __cplusplus +} +#endif + +#endif + |