/* gethostnamadr.c 4.7 85/01/16 */
static char HOSTDB
[] = "/etc/hosts";
DBM
*_host_db
= (DBM
*)NULL
;
static struct hostent host
;
static char *host_aliases
[MAXALIASES
];
static char hostbuf
[BUFSIZ
+1];
int _host_stayopen
; /* set by sethostent(), cleared by endhostent() */
register char *cp
, *tp
, **ap
;
return ((struct hostent
*)NULL
);
key
= dbm_fetch(_host_db
, key
);
return ((struct hostent
*)NULL
);
naliases
= *(int *)cp
; cp
+= sizeof (int);
for (ap
= host_aliases
; naliases
> 0; naliases
--) {
host
.h_aliases
= host_aliases
;
bcopy(cp
, (char *)&host
.h_addrtype
, sizeof (int));
bcopy(cp
, (char *)&host
.h_length
, sizeof (int));
bcopy(cp
, tp
, host
.h_length
);
register struct hostent
*hp
;
if ((_host_db
== (DBM
*)NULL
)
&& ((_host_db
= dbm_open(HOSTDB
, O_RDONLY
)) == (DBM
*)NULL
))
return ((struct hostent
*)NULL
);
gethostbyaddr(addr
, length
)
register struct hostent
*hp
;
if ((_host_db
== (DBM
*)NULL
)
&& ((_host_db
= dbm_open(HOSTDB
, O_RDONLY
)) == (DBM
*)NULL
))
return ((struct hostent
*)NULL
);