11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or (at
14 * your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 * Copyright © 2007 Pierre Habouzit
29 /***** THIS FILE IS AUTOGENERATED DO NOT MODIFY DIRECTLY ! *****/
37 #ifndef MUTT_LIB_LUA_LUA_TOKEN_H
38 #define MUTT_LIB_LUA_LUA_TOKEN_H
42 `tr 'a-z-/' 'A-Z__' | sed -e 's/.*/ LTK_&,/'`
46 enum lua_token lua_which_token(const char *s, ssize_t len);
47 #endif /* MUTT_LIB_LUA_LUA_TOKEN_H */
52 cat <<EOF | gperf -m16 -l -t -C -F",0" -Nlua_which_token_aux
56 #include <lib-lib/lib-lib.h>
57 #include "lua-token.h"
59 static const struct tok *
60 lua_which_token_aux(const char *str, unsigned int len);
63 struct tok { const char *name; int val; };
65 `awk '{print $0 ", " NR }'`
68 enum lua_token lua_which_token(const char *s, ssize_t len)
74 const struct tok *res = lua_which_token_aux(s, len);
75 return res ? res->val : LTK_UNKNOWN;
84 grep '^## ' "$1" | cut -d' ' -f2
87 trap "rm -f $1" 1 2 3 15
91 *.h) grep_self "$0" | do_h > $1;;
92 *.c) grep_self "$0" | do_c > $1;;
93 *) die "you must ask for the 'h' or 'c' generation";;
99 ############ Put tokens here ############