No empty .Rs/.Re
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / tok822.h
blob67e0fd5fa8771eb9a2e926cd47038e66891a55e6
1 /* $NetBSD$ */
3 #ifndef _TOK822_H_INCLUDED_
4 #define _TOK822_H_INCLUDED_
6 /*++
7 /* NAME
8 /* tok822 3h
9 /* SUMMARY
10 /* RFC822 token structures
11 /* SYNOPSIS
12 /* #include <tok822.h>
13 /* DESCRIPTION
14 /* .nf
17 * Utility library.
19 #include <vstring.h>
22 * Global library.
24 #include <resolve_clnt.h>
27 * Internal address representation: a token tree.
29 typedef struct TOK822 {
30 int type; /* token value, see below */
31 VSTRING *vstr; /* token contents */
32 struct TOK822 *prev; /* peer */
33 struct TOK822 *next; /* peer */
34 struct TOK822 *head; /* group members */
35 struct TOK822 *tail; /* group members */
36 struct TOK822 *owner; /* group owner */
37 } TOK822;
40 * Token values for multi-character objects. Single-character operators are
41 * represented by their own character value.
43 #define TOK822_MINTOK 256
44 #define TOK822_ATOM 256 /* non-special character sequence */
45 #define TOK822_QSTRING 257 /* stuff between "", not nesting */
46 #define TOK822_COMMENT 258 /* comment including (), may nest */
47 #define TOK822_DOMLIT 259 /* stuff between [] not nesting */
48 #define TOK822_ADDR 260 /* actually a token group */
49 #define TOK822_STARTGRP 261 /* start of named group */
50 #define TOK822_MAXTOK 261
53 * tok822_node.c
55 extern TOK822 *tok822_alloc(int, const char *);
56 extern TOK822 *tok822_free(TOK822 *);
59 * tok822_tree.c
61 extern TOK822 *tok822_append(TOK822 *, TOK822 *);
62 extern TOK822 *tok822_prepend(TOK822 *, TOK822 *);
63 extern TOK822 *tok822_cut_before(TOK822 *);
64 extern TOK822 *tok822_cut_after(TOK822 *);
65 extern TOK822 *tok822_unlink(TOK822 *);
66 extern TOK822 *tok822_sub_append(TOK822 *, TOK822 *);
67 extern TOK822 *tok822_sub_prepend(TOK822 *, TOK822 *);
68 extern TOK822 *tok822_sub_keep_before(TOK822 *, TOK822 *);
69 extern TOK822 *tok822_sub_keep_after(TOK822 *, TOK822 *);
70 extern TOK822 *tok822_free_tree(TOK822 *);
72 typedef int (*TOK822_ACTION) (TOK822 *);
73 extern int tok822_apply(TOK822 *, int, TOK822_ACTION);
74 extern TOK822 **tok822_grep(TOK822 *, int);
77 * tok822_parse.c
79 extern TOK822 *tok822_scan_limit(const char *, TOK822 **, int);
80 extern TOK822 *tok822_scan_addr(const char *);
81 extern TOK822 *tok822_parse_limit(const char *, int);
82 extern VSTRING *tok822_externalize(VSTRING *, TOK822 *, int);
83 extern VSTRING *tok822_internalize(VSTRING *, TOK822 *, int);
85 #define tok822_scan(cp, ptr) tok822_scan_limit((cp), (ptr), 0)
86 #define tok822_parse(cp) tok822_parse_limit((cp), 0)
88 #define TOK822_STR_NONE (0)
89 #define TOK822_STR_WIPE (1<<0)
90 #define TOK822_STR_TERM (1<<1)
91 #define TOK822_STR_LINE (1<<2)
92 #define TOK822_STR_TRNC (1<<3)
93 #define TOK822_STR_DEFL (TOK822_STR_WIPE | TOK822_STR_TERM)
94 #define TOK822_STR_HEAD (TOK822_STR_TERM | TOK822_STR_LINE | TOK822_STR_TRNC)
97 * tok822_find.c
99 extern TOK822 *tok822_find_type(TOK822 *, int);
100 extern TOK822 *tok822_rfind_type(TOK822 *, int);
103 * tok822_rewrite.c
105 extern TOK822 *tok822_rewrite(TOK822 *, const char *);
108 * tok822_resolve.c
110 #define tok822_resolve(t, r) tok822_resolve_from(RESOLVE_NULL_FROM, (t), (r))
112 extern void tok822_resolve_from(const char *, TOK822 *, RESOLVE_REPLY *);
114 /* LICENSE
115 /* .ad
116 /* .fi
117 /* The Secure Mailer license must be distributed with this software.
118 /* AUTHOR(S)
119 /* Wietse Venema
120 /* IBM T.J. Watson Research
121 /* P.O. Box 704
122 /* Yorktown Heights, NY 10598, USA
123 /*--*/
125 #endif