X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=mts%2Fmmdf%2Fhosts.c;fp=mts%2Fmmdf%2Fhosts.c;h=0000000000000000000000000000000000000000;hb=b779fc0797de650993f5f8ec15c23ca9a7b3c9e2;hp=a6d3139ad7aace846aee1a06968fe64a4b8353ca;hpb=51d3c1179979615d85205399a392fcc3ef1c4384;p=mmh diff --git a/mts/mmdf/hosts.c b/mts/mmdf/hosts.c deleted file mode 100644 index a6d3139..0000000 --- a/mts/mmdf/hosts.c +++ /dev/null @@ -1,72 +0,0 @@ - -/* - * hosts.c -- use MMDF to get hostname information - * - * $Id$ - */ - -#include "../../h/strings.h" -#include "util.h" -#include "mmdf.h" -#include "ch.h" - -#ifdef MMDFII -# include "dm.h" -#endif /* MMDFII */ - -#include - -/* - * We really should be careful with the number of fd's that this routine - * opens: the ch_seq ch_table.c module likes to keep 6 (yes, SIX) fds around - * to speed-up host lookups in the channel table. Unfortunately, after all - * of them get opened, six are always open (ch_table may close one to open - * another). The bottom line is that if repl calls post, then we get 12 - * (yes, TWELVE) fds open, with only six usable. - * - * send will close all fds >= 3 prior to invoking post. It would be nice - * if one could control ch_seq's use of fds for table lookups, but such is - * life. - * - */ - -#ifndef MMDFII -char * -OfficialName (char *name) -{ - register Chan *ch; - static char buffer[BUFSIZ]; - - return ((ch = ch_h2chan (name, buffer)) == (Chan *) (-1) ? NULL - : ch == (Chan *) NULL ? LocalName () - : buffer); -} -#else /* MMDFII */ - -extern char *invo_name; - -extern short ch_yloc; /* ok to intercept local names */ - -static int inited = 0; - -char * -OfficialName (char *name) -{ - Dmn_route route; - static char buffer[BUFSIZ]; - - if (!inited) { - mmdf_init (invo_name); - inited = 1; - } - switch (dm_v2route (name, buffer, &route)) { - case NOTOK: - case OK: - return ((ch_yloc && lexequ (name, LocalName ())) ? LocalName () - : NULL); - - default: - return buffer; - } -} -#endif /* MMDFII */