No empty .Rs/.Re
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / util / attr.h
blob0ca8c7703ade7f6fa463c6cd37216312610609d7
1 /* $NetBSD$ */
3 #ifndef _ATTR_H_INCLUDED_
4 #define _ATTR_H_INCLUDED_
6 /*++
7 /* NAME
8 /* attr 3h
9 /* SUMMARY
10 /* attribute list manipulations
11 /* SYNOPSIS
12 /* #include "attr.h"
13 DESCRIPTION
14 .nf
17 * System library.
19 #include <stdarg.h>
22 * Utility library.
24 #include <vstream.h>
27 * Attribute types. See attr_scan(3) for documentation.
29 #define ATTR_TYPE_END 0 /* end of data */
30 #define ATTR_TYPE_INT 1 /* Unsigned integer */
31 #define ATTR_TYPE_NUM ATTR_TYPE_INT
32 #define ATTR_TYPE_STR 2 /* Character string */
33 #define ATTR_TYPE_HASH 3 /* Hash table */
34 #define ATTR_TYPE_NV 3 /* Name-value table */
35 #define ATTR_TYPE_LONG 4 /* Unsigned long */
36 #define ATTR_TYPE_DATA 5 /* Binary data */
37 #define ATTR_TYPE_FUNC 6 /* Function pointer */
39 #define ATTR_HASH_LIMIT 1024 /* Size of hash table */
42 * Flags that control processing. See attr_scan(3) for documentation.
44 #define ATTR_FLAG_NONE 0
45 #define ATTR_FLAG_MISSING (1<<0) /* Flag missing attribute */
46 #define ATTR_FLAG_EXTRA (1<<1) /* Flag spurious attribute */
47 #define ATTR_FLAG_MORE (1<<2) /* Don't skip or terminate */
49 #define ATTR_FLAG_STRICT (ATTR_FLAG_MISSING | ATTR_FLAG_EXTRA)
50 #define ATTR_FLAG_ALL (07)
53 * Delegation for better data abstraction.
55 typedef int (*ATTR_SCAN_MASTER_FN) (VSTREAM *, int, ...);
56 typedef int (*ATTR_SCAN_SLAVE_FN) (ATTR_SCAN_MASTER_FN, VSTREAM *, int, void *);
57 typedef int (*ATTR_PRINT_MASTER_FN) (VSTREAM *, int,...);
58 typedef int (*ATTR_PRINT_SLAVE_FN) (ATTR_PRINT_MASTER_FN, VSTREAM *, int, void *);
61 * Default to null-terminated, as opposed to base64-encoded.
63 #define attr_print attr_print0
64 #define attr_vprint attr_vprint0
65 #define attr_scan attr_scan0
66 #define attr_vscan attr_vscan0
69 * attr_print64.c.
71 extern int attr_print64(VSTREAM *, int,...);
72 extern int attr_vprint64(VSTREAM *, int, va_list);
75 * attr_scan64.c.
77 extern int attr_scan64(VSTREAM *, int,...);
78 extern int attr_vscan64(VSTREAM *, int, va_list);
81 * attr_print0.c.
83 extern int attr_print0(VSTREAM *, int,...);
84 extern int attr_vprint0(VSTREAM *, int, va_list);
87 * attr_scan0.c.
89 extern int attr_scan0(VSTREAM *, int,...);
90 extern int attr_vscan0(VSTREAM *, int, va_list);
93 * attr_scan_plain.c.
95 extern int attr_print_plain(VSTREAM *, int,...);
96 extern int attr_vprint_plain(VSTREAM *, int, va_list);
99 * attr_print_plain.c.
101 extern int attr_scan_plain(VSTREAM *, int,...);
102 extern int attr_vscan_plain(VSTREAM *, int, va_list);
106 * Attribute names for testing the compatibility of the read and write
107 * routines.
109 #ifdef TEST
110 #define ATTR_NAME_INT "number"
111 #define ATTR_NAME_STR "string"
112 #define ATTR_NAME_LONG "long_number"
113 #define ATTR_NAME_DATA "data"
114 #endif
116 /* LICENSE
117 /* .ad
118 /* .fi
119 /* The Secure Mailer license must be distributed with this software.
120 /* AUTHOR(S)
121 /* Wietse Venema
122 /* IBM T.J. Watson Research
123 /* P.O. Box 704
124 /* Yorktown Heights, NY 10598, USA
125 /*--*/
127 #endif