Ignore:
Timestamp:
May 19, 2003, 4:41:00 AM (22 years ago)
Author:
bird
Message:

#434: Initial tcpip header merges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/netdb.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/*- Modified for emx by hv and em 1994-1997
     2 *- Modified for gcc by bird 2003
    23 *
    34 * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
     
    3334 *
    3435 *      from: @(#)netdb.h       5.15 (Berkeley) 4/3/91
    35  *      netdb.h,v 1.1 2003/04/16 15:53:07 bird Exp
     36 *      netdb.h,v 1.2 2003/05/19 02:41:00 bird Exp
    3637 */
    3738
    3839#ifndef _NETDB_H_
    3940#define _NETDB_H_
     41#ifdef TCPV40HDRS
     42#define __NETDB_32H
     43#endif
    4044
    4145#if defined (__cplusplus)
    4246extern "C" {
    4347#endif
     48
     49/* toolkit compatibility - start */
     50#include <sys/param.h>
     51#include <sys/cdefs.h>
     52/* toolkit compatibility - end */
    4453
    4554#ifndef _EMX_TCPIP
     
    5463#endif
    5564
    56 extern int h_errno;
    57 
    58 #define _PATH_HEQUIV    "/tcpip/etc/hosts.equiv"
    59 #define _PATH_HOSTS     "/tcpip/etc/hosts"
    60 #define _PATH_NETWORKS  "/tcpip/etc/networks"
    61 #define _PATH_PROTOCOLS "/tcpip/etc/protocols"
    62 #define _PATH_SERVICES  "/tcpip/etc/services"
     65
     66#define _PATH_HEQUIV    "/mptn/etc/hosts.equiv"
     67#define _PATH_HOSTS     "/mptn/etc/hosts"
     68#define _PATH_NETWORKS  "/mptn/etc/networks"
     69#define _PATH_PROTOCOLS "/mptn/etc/protocols"
     70#define _PATH_SERVICES  "/mptn/etc/services"
     71
     72#ifdef TCPV40HDRS
     73#define h_errno         (tcp_h_errno())   /* __MT__ safe */
     74#else
     75#define h_errno         (*tcp_h_errno1()) /* __MT__ safe */
     76#endif
    6377
    6478/*
     
    104118 * (left in extern int h_errno).
    105119 */
    106 #if 0
    107 #define h_errno (tcp_h_errno()) /* thread safe */
     120#ifndef TCPV40HDRS
     121#define NETDB_INTERNAL  -1      /* see errno */
     122#define NETDB_SUCCESS   0       /* no problem */
    108123#endif
    109124#define HOST_NOT_FOUND  1 /* Authoritative Answer Host not found */
     
    113128#define NO_ADDRESS      NO_DATA         /* no address, look for MX record */
    114129
    115 int             gethostname (char *, int);
    116 void            endhostent (void);
    117 void            endnetent (void);
    118 void            endprotoent (void);
    119 void            endservent (void);
    120 struct hostent  *gethostbyaddr (__const__ char *, int, int);
    121 struct hostent  *gethostbyname (__const__ char *);
    122 struct hostent  *gethostent (void);
    123 struct netent   *getnetbyaddr (u_long, int);
    124 struct netent   *getnetbyname (__const__ char *);
    125 struct netent   *getnetent (void);
    126 struct protoent *getprotobyname (__const__ char *);
    127 struct protoent *getprotobynumber (int);
    128 struct protoent *getprotoent (void);
    129 struct servent  *getservbyname (__const__ char *, __const__ char *);
    130 struct servent  *getservbyport (int, __const__ char *);
    131 struct servent  *getservent (void);
    132 void            herror (__const__ char *);
    133 void            sethostent (int);
    134 void            setnetent (int);
    135 void            setprotoent (int);
    136 void            setservent (int);
    137 
    138 #ifdef NETDB_IBM_ADDENDUM
     130
     131#ifdef TCPV40HDRS
     132#include <stdio.h>
     133#include <string.h>
     134#include <netinet\in.h>
    139135
    140136/* IBM addendum structures and functions */
     
    144140#define _MAXLINELEN     1024
    145141
    146 /* this is the internally used data structure to which pointers of 
     142/* this is the internally used data structure to which pointers of
    147143 * struct hostent ponit to, after gethostbyname_r/gethostbyaddr_r were
    148144 * called. ATTENTION EMX: The component _opaque_ is a pointer to a data
     
    159155        int     stayopen;                       /* AIX addon */
    160156        u_long  host_addresses[_MAXADDRS];      /* Actual Addresses. */
    161 };                                             
     157};
    162158
    163159struct servent_data {
     
    167163        int     _serv_stayopen;
    168164};
    169 
    170 int gethostbyname_r(char*, struct hostent*, struct hostent_data*);
    171 int gethostbyaddr_r(char*, int, int, struct hostent*, struct hostent_data*);
    172 int getservbyname_r(char*, char*, struct servent*, struct servent_data*);
    173 struct hostent *_gethtbyname(char*);
    174 struct hostent *_gethtbyaddr(char*, int, int);
    175 int tcp_h_errno(void);  /* thread safe h_errno */
    176 
    177 #endif /* NETDB_IBM_ADDENDUM */
     165#endif
     166
     167
     168/* BSD */
     169int                 _System gethostname( char *, int );
     170struct hostent *    _System gethostbyname( __const__ char * );
     171struct hostent *    _System gethostbyaddr( __const__ char *, int, int );
     172struct netent *     _System getnetbyname( __const__ char * );
     173struct netent *     _System getnetbyaddr( unsigned long, int );
     174struct servent *    _System getservbyname( __const__ char *, char * );
     175struct servent *    _System getservbyport( int, __const__ char * );
     176struct servent *    _System getservent( void );
     177struct protoent *   _System getprotobyname( __const__ char * );
     178struct protoent *   _System getprotobynumber( int );
     179void                _System sethostent( int );
     180struct hostent *    _System gethostent( void );
     181void                _System endhostent(void);
     182void                _System setnetent( int );
     183struct netent *     _System getnetent( void );
     184void                _System endnetent(void);
     185void                _System setprotoent( int );
     186struct protoent *   _System getprotoent( void );
     187void                _System endprotoent(void);
     188void                _System setservent( int );
     189struct servent *    _System getservent( void );
     190void                _System endservent(void);
     191#ifndef TCPV40HDRS
     192struct hostent *    _System gethostbyname2( __const__ char *, int );
     193#endif
     194
     195
     196/* OS2 Additions */
     197#ifdef TCPV40HDRS
     198int                 _System tcp_h_errno(void);
     199struct hostent *    _System Rgethostbyname(char *); /* Socks additions */
     200#else
     201const char *        _System hstrerror(int);
     202/* void               _System sethostfile(const char *); */
     203int *               _System tcp_h_errno1(void);
     204#endif
     205
     206/* EMX/BSD additions. */
     207void                herror (__const__ char *);
     208
     209/* EMX/BSD stuff which isn't implemeneted  */
     210#ifndef TCPV40HDRS
     211struct hostent_data;
     212struct servent_data;
     213#endif
     214int                 gethostbyname_r(char*, struct hostent*, struct hostent_data*);
     215int                 gethostbyaddr_r(char*, int, int, struct hostent*, struct hostent_data*);
     216int                 getservbyname_r(char*, char*, struct servent*, struct servent_data*);
     217struct hostent *    _gethtbyname(char*);
     218struct hostent *    _gethtbyaddr(char*, int, int);
     219
    178220
    179221#ifdef __RSXNT__
     
    187229
    188230#endif /* !_NETDB_H_ */
     231
Note: See TracChangeset for help on using the changeset viewer.