"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.1/include/tnntp.h" (12 Oct 2016, 4346 Bytes) of archive /linux/misc/tin-2.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "tnntp.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.4.0_vs_2.4.1.

    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   : 2006-02-15
    7  *  Notes     : #include files, #defines & struct's
    8  *
    9  * Copyright (c) 1997-2017 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  * 1. Redistributions of source code must retain the above copyright
   16  *    notice, this list of conditions and the following disclaimer.
   17  * 2. Redistributions in binary form must reproduce the above copyright
   18  *    notice, this list of conditions and the following disclaimer in the
   19  *    documentation and/or other materials provided with the distribution.
   20  * 3. The name of the author may not be used to endorse or promote
   21  *    products derived from this software without specific prior written
   22  *    permission.
   23  *
   24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
   25  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
   28  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   30  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   32  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   35  */
   36 
   37 
   38 #ifndef TNNTP_H
   39 #define TNNTP_H 1
   40 
   41 #define s_fdopen    fdopen
   42 #define s_flush fflush
   43 #define s_fclose    fclose
   44 #define s_gets  fgets
   45 #if 0 /* __BEOS__ port in progress */
   46 #   ifdef HAVE_CLOSESOCKET
   47 #       define s_close  closesocket
   48 #   else
   49 #       define s_close  close
   50 #   endif /* HAVE_CLOSESOCKET */
   51 #   ifdef __BEOS__
   52 #       define s_puts(s,fd) write(fileno(fd),s,strlen(s))
   53 #   else
   54 #       define s_puts   fputs
   55 #   endif /* __BEOS__ */
   56 #else
   57 #   define s_close  close
   58 #   define s_puts   fputs
   59 #endif /* 0 */
   60 #define s_dup   dup
   61 #define s_end()
   62 
   63 #if defined(NNTP_ABLE) || defined(HAVE_GETHOSTBYNAME)
   64 #   ifdef HAVE_NETDB_H
   65 #       include <netdb.h>
   66 #   endif /* HAVE_NETDB_H */
   67 #   define IPPORT_NNTP ((unsigned short) 119)
   68 #   ifdef TLI
   69 #       ifdef HAVE_FCNTL_H
   70 #           include <fcntl.h>
   71 #       endif /* HAVE_FCNTL_H */
   72 #       include <tiuser.h>
   73 #       ifdef HAVE_STROPTS_H
   74 #           include <stropts.h>
   75 #       endif /* HAVE_STROPTS_H */
   76 #       ifdef HAVE_NET_SOCKET_H /* __BEOS__ fd_* macros */
   77 #           include <net/socket.h>
   78 #       else
   79 #           ifdef HAVE_SYS_SOCKET_H
   80 #               include <sys/socket.h>
   81 #           else
   82 #               ifdef HAVE_SOCKET_H
   83 #                   include <socket.h>
   84 #               endif /* HAVE_SOCKET_H */
   85 #           endif /* HAVE_SYS_SOCKET_H */
   86 #       endif /* HAVE_NET_SOCKET_H */
   87 #       ifdef HAVE_NETINET_IN_H
   88 #           include <netinet/in.h>
   89 #       endif /* HAVE_NETINET_IN_H */
   90 #   else
   91 #       ifdef HAVE_SYS_SOCKET_H
   92 #           include <sys/socket.h>
   93 #       else
   94 #           ifdef HAVE_SOCKET_H
   95 #               include <socket.h>
   96 #           endif /* HAVE_SOCKET_H */
   97 #       endif /* HAVE_SYS_SOCKET_H */
   98 #       ifdef HAVE_NETINET_IN_H
   99 #           include <netinet/in.h>
  100 #       endif /* HAVE_NETINET_IN_H */
  101 #       ifdef HAVE_NETLIB_H
  102 #           include <netlib.h>
  103 #       endif /* HAVE_NETLIB_H */
  104 #       ifdef HAVE_ARPA_INET_H
  105 #           include <arpa/inet.h>
  106 #       endif /* HAVE_ARPA_INET_H */
  107 #   endif /* TLI */
  108 
  109 #   ifdef EXCELAN
  110         extern int connect (int, struct sockaddr *);
  111         extern unsigned short htons (unsigned short);
  112         extern unsigned long rhost (char **);
  113         extern int rresvport (int);
  114         extern int socket (int, struct sockproto *, struct sockaddr_in *, int);
  115 #   endif /* EXCELAN */
  116 
  117 #   ifdef DECNET
  118 #       include <netdnet/dn.h>
  119 #       include <netdnet/dnetdb.h>
  120 #   endif /* DECNET */
  121 
  122 #endif /* NNTP_ABLE || HAVE_GETHOSTBYNAME */
  123 
  124 #if defined(HOST_NAME_MAX) && !defined(MAXHOSTNAMELEN)
  125 #   define MAXHOSTNAMELEN   HOST_NAME_MAX
  126 #endif /* HOST_NAME_MAX && !MAXHOSTNAMELEN */
  127 #ifndef MAXHOSTNAMELEN
  128 #   define MAXHOSTNAMELEN 255
  129 #endif /* !MAXHOSTNAMELEN */
  130 
  131 #ifndef SOCKS
  132 #   ifdef DECL_CONNECT
  133     extern int connect(int sockfd, struct sockaddr *serv_addr, int addrlen);
  134 #   endif /* DECL_CONNECT */
  135 #endif /* !SOCKS */
  136 
  137 #ifdef DECL_INET_NTOA
  138     extern char *inet_ntoa (struct in_addr);
  139 #endif /* DECL_INET_NTOA */
  140 
  141 #endif /* TNNTP_H */