-#include "common.h"
-#include "fileio.h"
-
-RCSTAG_CC("$Id$");
-
-#ifndef HAVE_STRTOKEN
-/*
- * strtoken.c
- *
- * Walk through a string of tokens, using a set of separators.
- * -argv 9/90
- */
-char *strtoken(char **save, char *str, char *fs)
-{
- char *pos = *save; /* keep last position across calls */
- Reg1 char *tmp;
-
- if (str)
- pos = str; /* new string scan */
-
- while (pos && *pos && strchr(fs, *pos) != NULL)
- pos++; /* skip leading separators */
-
- if (!pos || !*pos)
- return (pos = *save = NULL); /* string contains only sep's */
-
- tmp = pos; /* now, keep position of the token */
-
- while (*pos && strchr(fs, *pos) == NULL)
- pos++; /* skip content of the token */
-
- if (*pos)
- *pos++ = '\0'; /* remove first sep after the token */
- else
- pos = NULL; /* end of string */
-
- *save = pos;
- return (tmp);
-}
-#endif /* !HAVE_STRTOKEN */
-
-#ifndef HAVE_STRERROR
-/*
- * strerror
- *
- * Returns an appropriate system error string to a given errno.
- * -argv 11/90
- */
-
-char *strerror(int err_no)
-{
- static char buff[40];
- char *errp;
-
- errp = (err_no > sys_nerr ? (char *)NULL : sys_errlist[err_no]);
-
- if (errp == (char *)NULL)
- {
- errp = buff;
- sprintf_irc(errp, "Unknown Error %d", err_no);
- }
- return errp;
-}
-
-#endif /* !HAVE_STRERROR */
-
-/*
- * inetntoa -- Changed the parameter to NOT take a pointer.
- * -Run 4/8/97
- * inetntoa -- Changed name to remove collision possibility and
- * so behaviour is garanteed to take a pointer arg.
- * -avalon 23/11/92
- * inet_ntoa -- Returned the dotted notation of a given
- * internet number (some ULTRIX don't have this)
- * -argv 11/90.
- * inet_ntoa -- Its broken on some Ultrix/Dynix too. -avalon
- */
-char *inetntoa(struct in_addr in)
-{
- static char buf[16];
- Reg1 unsigned char *s = (unsigned char *)&in.s_addr;
- Reg2 unsigned char a, b, c, d;
-
- a = *s++;
- b = *s++;
- c = *s++;
- d = *s++;
- sprintf_irc(buf, "%u.%u.%u.%u", a, b, c, d);
-
- return buf;
-}
-
-#ifndef HAVE_INET_NETOF
-/*
- * inet_netof -- return the net portion of an internet number
- * argv 11/90
- */
-int inet_netof(struct in_addr in)
-{
- int addr = in.s_net;
-
- if (addr & 0x80 == 0)
- return ((int)in.s_net);
-
- if (addr & 0x40 == 0)
- return ((int)in.s_net * 256 + in.s_host);
-
- return ((int)in.s_net * 256 + in.s_host * 256 + in.s_lh);
-}
-
-#endif /* !HAVE_INET_NETOF */