From 0cc9b20c15460213e488bf5e70963b941482f628 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 14 Jan 2025 16:06:02 -0600 Subject: Add source. --- sdk/net/stream.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sdk/net/stream.h (limited to 'sdk/net/stream.h') 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 +#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 + -- cgit v1.2.3-54-g00ecf