9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.01.31.21.37.07; author jromine; state Exp;
19 date 90.04.05.15.30.01; author sources; state Exp;
24 date 90.04.05.14.43.18; author sources; state Exp;
29 date 90.02.05.14.51.51; author sources; state Exp;
34 date 90.02.05.14.51.25; author sources; state Exp;
48 @/* hosts.c - find out the official name of a host */
50 static char ident[] = "@@(#)$Id: hosts.c,v 1.5 1992/01/31 21:37:07 jromine Exp jromine $";
56 #if defined(BSD41A) || defined(BSD42) || defined(SOCKETS)
58 #endif /* not (defined(BSD41A) || defined(BSD42) || defined(SOCKETS)) */
60 #include "../h/strings.h"
62 #include "../zotnet/mts.h"
64 #if defined(BSD42) || defined(SOCKETS)
66 #endif /* BSD42 or SOCKETS */
73 char *OfficialName (name)
80 static char buffer[BUFSIZ];
81 #if defined(BSD42) || defined(SOCKETS)
82 register struct hostent *hp;
83 #endif /* BSD42 or SOCKETS */
86 for (p = name, q = site; *p; p++, q++)
87 *q = isupper (*p) ? tolower (*p) : *p;
91 if (uleq (LocalName (), site))
95 if (rhost (&q) != NOTOK) {
96 (void) strcpy (buffer, q);
101 #if defined(BSD42) || defined(SOCKETS)
102 if (hp = gethostbyname (q)) {
103 (void) strcpy (buffer, hp -> h_name);
106 #endif /* BSD42 or SOCKETS */
120 static char ident[] = "@@(#)$Id: hosts.c,v 1.4 1990/04/05 15:30:01 sources Exp jromine $";
124 #endif not (defined(BSD41A) || defined(BSD42) || defined(SOCKETS))
127 #endif BSD42 or SOCKETS
130 #endif BSD42 or SOCKETS
137 #endif BSD42 or SOCKETS
148 static char ident[] = "@@(#)$Id:$";
162 static char ident[] = "$Id:";
182 #if defined(BSD41A) || defined(BSD42)
185 #endif not (defined(BSD41A) || defined(BSD42))