10 /******************************************************************************/
11 /* postlicyd: a postfix policy daemon with a lot of features */
13 /* ________________________________________________________________________ */
15 /* Redistribution and use in source and binary forms, with or without */
16 /* modification, are permitted provided that the following conditions */
19 /* 1. Redistributions of source code must retain the above copyright */
20 /* notice, this list of conditions and the following disclaimer. */
21 /* 2. Redistributions in binary form must reproduce the above copyright */
22 /* notice, this list of conditions and the following disclaimer in the */
23 /* documentation and/or other materials provided with the distribution. */
24 /* 3. The names of its contributors may not be used to endorse or promote */
25 /* products derived from this software without specific prior written */
28 /* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS */
29 /* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
30 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
31 /* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY */
32 /* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL */
33 /* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS */
34 /* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
35 /* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */
36 /* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
37 /* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
38 /* POSSIBILITY OF SUCH DAMAGE. */
39 /******************************************************************************/
41 /***** THIS FILE IS AUTOGENERATED DO NOT MODIFY DIRECTLY ! *****/
49 #ifndef PFIXTOOLS_POLICY_TOKENS_H
50 #define PFIXTOOLS_POLICY_TOKENS_H
52 typedef enum postlicyd_token {
54 `grep_self "$0" | tr 'a-z-/' 'A-Z__' | sed -e 's/.*/ PTK_&,/'`
58 extern const char *ptokens[PTK_count];
61 postlicyd_token policy_tokenize(const char *s, ssize_t len);
62 #endif /* PFIXTOOLS_POLICY_TOKENS_H */
68 echo "$tok, PTK_`echo $tok | tr 'a-z-' 'A-Z_'`"
74 cat <<EOF | gperf -m16 -l -t -C -F",0" -Ntokenize_aux | \
75 sed -e '/__gnu_inline__/d;s/\<\(__\|\)inline\>//g'
80 #include "`echo "${this%.sh}"`.h"
82 static const struct tok *
83 tokenize_aux(const char *str, unsigned int len);
86 struct tok { const char *name; int val; };
88 `grep_self "$0" | do_tokens`
91 const char *ptokens[PTK_count] = {
92 `grep_self "$0" | sed -e 's/.*/ "&",/'`
95 postlicyd_token policy_tokenize(const char *s, ssize_t len)
101 const struct tok *res = tokenize_aux(s, len);
102 return res ? res->val : PTK_UNKNOWN;
111 grep '^## ' "$1" | cut -d' ' -f2
114 trap "rm -f $1" 1 2 3 15
119 *) die "you must ask for the 'h' or 'c' generation";;
125 ############ Put tokens here ############
137 ## reverse_client_name
154 ## encryption_protocol
156 ## encryption_keysize
163 ## smtpd_access_policy
165 # protocol_name values
169 # protocol_state values