#include <ctype.h>
#include <stdio.h>
#include <h/utils.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
/*
** static prototypes
*/
static char *getcpy(char *);
-static int isat(char *);
static int parse_address(void);
static int phrase(char *);
static int route_addr(char *);
static char *
getcpy(char *s)
{
- register char *p;
+ char *p;
if (!s) {
/*
}
-#define CHKADR 0 /* undertermined address style */
-#define UNIXDR 1 /* UNIX-style address */
-#define ARPADR 2 /* ARPAnet-style address */
-
-
-static int
-isat(char *p)
-{
- return (strncmp(p, " AT ", 4)
- && strncmp(p, " At ", 4)
- && strncmp(p, " aT ", 4)
- && strncmp(p, " at ", 4) ? FALSE : TRUE);
-}
-
-
/*
**
** getadrx() implements a partial 822-style address parser. The parser
** is neither complete nor correct. It does however recognize nearly all
-** of the 822 address syntax. In addition it handles the majority of the
+** of the 822 address syntax.
+** Historically, it handled the majority (and still handles parts) of the
** 733 syntax as well. Most problems arise from trying to accomodate both.
**
** In terms of 822, the route-specification in
** via source-routing. Recursive groups are not allowed as per the
** standard.
**
-** In terms of 733, " at " is recognized as equivalent to "@".
-**
** In terms of both the parser will not complain about missing hosts.
**
** -----
struct adrx *
getadrx(char *addrs)
{
- register char *bp;
- register struct adrx *adrxp = &adrxs2;
+ char *bp;
+ struct adrx *adrxp = &adrxs2;
if (pers)
free(pers);
static int
route_addr(char *buffer)
{
- register char *pp = cp;
+ char *pp = cp;
if (my_lex(buffer) == LX_AT) {
if (route(buffer) == NOTOK)
default:
sprintf(err, "no at-sign found for next domain in route (%s)",
- buffer);
+ buffer);
}
break;
}
my_lex(char *buffer)
{
/* buffer should be at least BUFSIZ bytes long */
- int i, gotat = 0;
- register unsigned char c;
- register char *bp;
+ int i;
+ unsigned char c;
+ char *bp;
/*
** Add C to the buffer bp. After use of this macro *bp is guaranteed
if (!cp)
return (last_lex = LX_END);
- gotat = isat(cp);
c = *cp++;
while (isspace(c))
c = *cp++;
else
cp--;
*bp = 0;
- last_lex = !gotat || cp == NULL || strchr(cp, '<') != NULL
- ? LX_ATOM : LX_AT;
- return last_lex;
+ return LX_ATOM;
my_lex_buffull:
/* Out of buffer space. *bp is the last byte in the buffer */
legal_person(char *p)
{
int i;
- register char *cp;
+ char *cp;
static char buffer[BUFSIZ];
if (*p == '"')