tin  2.6.1
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.6.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

tnntp.h
Go to the documentation of this file.
1/*
2 * Project : tin - a Usenet reader
3 * Module : tnntp.h
4 * Author : Thomas Dickey <dickey@invisible-island.net>
5 * Created : 1997-03-05
6 * Updated : 2019-02-18
7 * Notes : #include files, #defines & struct's
8 *
9 * Copyright (c) 1997-2022 Thomas Dickey <dickey@invisible-island.net>
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 *
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * 3. Neither the name of the copyright holder nor the names of its
24 * contributors may be used to endorse or promote products derived from
25 * this software without specific prior written permission.
26 *
27 * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40
41#ifndef TNNTP_H
42#define TNNTP_H 1
43
44#define s_fdopen fdopen
45#define s_flush fflush
46#define s_fclose fclose
47#define s_gets fgets
48#define s_close close
49#define s_puts fputs
50#define s_dup dup
51#define s_end()
52
53#if defined(NNTP_ABLE) || defined(HAVE_GETHOSTBYNAME)
54# ifdef HAVE_NETDB_H
55# include <netdb.h>
56# endif /* HAVE_NETDB_H */
57# define IPPORT_NNTP ((unsigned short) 119)
58# ifdef TLI
59# ifdef HAVE_FCNTL_H
60# include <fcntl.h>
61# endif /* HAVE_FCNTL_H */
62# include <tiuser.h>
63# ifdef HAVE_STROPTS_H
64# include <stropts.h>
65# endif /* HAVE_STROPTS_H */
66# ifdef HAVE_SYS_SOCKET_H
67# include <sys/socket.h>
68# else
69# ifdef HAVE_SOCKET_H
70# include <socket.h>
71# endif /* HAVE_SOCKET_H */
72# endif /* HAVE_SYS_SOCKET_H */
73# ifdef HAVE_NETINET_IN_H
74# include <netinet/in.h>
75# endif /* HAVE_NETINET_IN_H */
76# else
77# ifdef HAVE_SYS_SOCKET_H
78# include <sys/socket.h>
79# else
80# ifdef HAVE_SOCKET_H
81# include <socket.h>
82# endif /* HAVE_SOCKET_H */
83# endif /* HAVE_SYS_SOCKET_H */
84# ifdef HAVE_NETINET_IN_H
85# include <netinet/in.h>
86# endif /* HAVE_NETINET_IN_H */
87# ifdef HAVE_NETLIB_H
88# include <netlib.h>
89# endif /* HAVE_NETLIB_H */
90# ifdef HAVE_ARPA_INET_H
91# include <arpa/inet.h>
92# endif /* HAVE_ARPA_INET_H */
93# endif /* TLI */
94
95# ifdef EXCELAN
96 extern int connect (int, struct sockaddr *);
97 extern unsigned short htons (unsigned short);
98 extern unsigned long rhost (char **);
99 extern int rresvport (int);
100 extern int socket (int, struct sockproto *, struct sockaddr_in *, int);
101# endif /* EXCELAN */
102
103# ifdef DECNET
104# include <netdnet/dn.h>
105# include <netdnet/dnetdb.h>
106# endif /* DECNET */
107
108#endif /* NNTP_ABLE || HAVE_GETHOSTBYNAME */
109
110#if defined(HOST_NAME_MAX) && !defined(MAXHOSTNAMELEN)
111# define MAXHOSTNAMELEN HOST_NAME_MAX
112#endif /* HOST_NAME_MAX && !MAXHOSTNAMELEN */
113#ifndef MAXHOSTNAMELEN
114# define MAXHOSTNAMELEN 255
115#endif /* !MAXHOSTNAMELEN */
116
117#ifndef SOCKS
118# ifdef DECL_CONNECT
119 extern int connect(int sockfd, struct sockaddr *serv_addr, int addrlen);
120# endif /* DECL_CONNECT */
121#endif /* !SOCKS */
122
123#ifdef DECL_INET_NTOA
124 extern char *inet_ntoa (struct in_addr);
125#endif /* DECL_INET_NTOA */
126
127#endif /* TNNTP_H */