netdb.mh

来自「开放源码的编译器open watcom 1.6.0版的源代码」· MH 代码 · 共 61 行

MH
61
字号
/*
 *  netdb.h      Net database functions.
 *
:include crwat.sp
 */
#ifndef _NETDB_H_INCLUDED
#define _NETDB_H_INCLUDED
#include <sys/socket.h>        /* for AF_INET */
:include readonly.sp
:include cpluspro.sp
:include lnxkpack.sp

struct protoent {
    char    *p_name;        /* official protocol name */
    char    **p_aliases;    /* alias list */
    int     p_proto;        /* protocol number */
};

struct servent {
    char    *s_name;        /* official service name */
    char    **s_aliases;    /* alias list */
    int     s_port;         /* port number */
    char    *s_proto;       /* protocol to use */
};


struct hostent {
    char    *h_name;        /* official name of host */
    char    **h_aliases;    /* alias list */
    int     h_addrtype;     /* host address type */
    int     h_length;       /* length of address */
    char    **h_addr_list;  /* list of addresses */
};
#define h_addr  h_addr_list[0]  /* for backward compatibility */

_WCRTDATA extern int h_errno;

_WCRTLINK extern struct protoent *getprotoent( void );
_WCRTLINK extern struct protoent *getprotobyname( const char *__name );
_WCRTLINK extern struct protoent *getprotobynumber( int __proto );
_WCRTLINK extern void            setprotoent( int __stayopen );
_WCRTLINK extern void            endprotoent( void );

_WCRTLINK extern struct servent  *getservent( void );
_WCRTLINK extern struct servent  *getservbyname( const char *__name, const char *__proto );
_WCRTLINK extern struct servent  *getservbyport( int __port, const char *__proto );
_WCRTLINK extern void            setservent( int __stayopen );
_WCRTLINK extern void            endservent( void );

_WCRTLINK extern struct hostent  *gethostbyname( const char *__name );
_WCRTLINK extern struct hostent  *gethostbyaddr( const char *__addr, int __len, int __type );
_WCRTLINK extern void            sethostent( int __stayopen );
_WCRTLINK extern void            endhostent( void );
_WCRTLINK extern void            herror( const char *__s );
_WCRTLINK extern const char      *hstrerror( int __err );

:include poppack.sp
:include cplusepi.sp
#endif /* !_NETDB_H_INCLUDED */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?