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_&,/'`
47 enum lua_token lua_which_token(const char *s, ssize_t len);
48 #endif /* MUTT_LIB_LUA_LUA_TOKEN_H */
54 echo "$tok, LTK_`echo $tok | tr 'a-z-' 'A-Z_'`"
59 cat <<EOF | gperf -m16 -l -t -C -F",0" -Nlua_which_token_aux
63 #include <lib-lib/lib-lib.h>
64 #include "lua-token.h"
66 static const struct tok *
67 lua_which_token_aux(const char *str, unsigned int len);
70 struct tok { const char *name; int val; };
75 enum lua_token lua_which_token(const char *s, ssize_t len)
81 const struct tok *res = lua_which_token_aux(s, len);
82 return res ? res->val : LTK_UNKNOWN;
91 grep '^## ' "$1" | cut -d' ' -f2
94 trap "rm -f $1" 1 2 3 15
98 *.h) grep_self "$0" | do_h > $1;;
99 *.c) grep_self "$0" | do_c > $1;;
100 *) die "you must ask for the 'h' or 'c' generation";;
106 ############ Put tokens here ############