aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas/smtp/smtp.h
blob: 836192237d97db9a6e5935617c67cd18d117eb8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
typedef struct Node Node;
typedef struct Field Field;
typedef Node *Nodeptr;
#define YYSTYPE Nodeptr

struct Node {
	Node	*next;
	int	c;	/* token type */
	char	addr;	/* true if this is an address */
	String	*s;	/* string representing token */
	String	*white;	/* white space following token */
	char	*start;	/* first byte for this token */
	char	*end;	/* next byte in input */
};

struct Field {
	Field	*next;
	Node	*node;
	int	source;
};

typedef struct DS	DS;
struct DS {
	/* dist string */
	char	buf[128];
	char	expand[128];
	char	*netdir;
	char	*proto;
	char	*host;
	char	*service;
};

extern Field	*firstfield;
extern Field	*lastfield;
extern Node	*usender;
extern Node	*usys;
extern Node	*udate;
extern int	originator;
extern int	destination;
extern int	date;
extern int	messageid;

Node*	anonymous(Node*);
Node*	address(Node*);
int	badfieldname(Node*);
Node*	bang(Node*, Node*);
Node*	colon(Node*, Node*);
int	cistrcmp(char*, char*);
Node*	link2(Node*, Node*);
Node*	link3(Node*, Node*, Node*);
void	freenode(Node*);
void	newfield(Node*, int);
void	freefield(Field*);
void	yyinit(char*, int);
int	yyparse(void);
int	yylex(void);
String*	yywhite(void);
Node*	whiten(Node*);
void	yycleanup(void);
int	mxdial(char*, char*, char*);
void	dial_string_parse(char*, DS*);