]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/mts/mmdf/hosts.c
1 /* hosts.c - use MMDF to get hostname information */
3 static char ident
[] = "@(#)$Id: hosts.c,v 1.3 1992/12/15 00:20:22 jromine Exp $";
8 #include "../h/strings.h"
15 #include "../zotnet/mts.h"
18 * We really should be careful with the number of fd's that this routine
19 * opens: the ch_seq ch_table.c module likes to keep 6 (yes, SIX) fds around
20 * to speed-up host lookups in the channel table. Unfortunately, after all
21 * of them get opened, six are always open (ch_table may close one to open
22 * another). The bottom line is that if repl calls post, then we get 12
23 * (yes, TWELVE) fds open, with only six usable.
25 * send will close all fds >= 3 prior to invoking post. It would be nice
26 * if one could control ch_seq's use of fds for table lookups, but such is
32 char *OfficialName (name
)
36 static char buffer
[BUFSIZ
];
38 return ((ch
= ch_h2chan (name
, buffer
)) == (Chan
*) (-1) ? NULL
39 : ch
== (Chan
*) NULL
? LocalName ()
44 extern char *invo_name
;
46 extern short ch_yloc
; /* ok to intercept local names */
48 static int inited
= 0;
50 char *OfficialName (name
)
54 static char buffer
[BUFSIZ
];
57 mmdf_init (invo_name
);
60 switch (dm_v2route (name
, buffer
, &route
)) {
63 return ((ch_yloc
&& lexequ (name
, LocalName ())) ? LocalName ()