X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lua%2Flua-token.sh;h=5c61d66b35ec867d6a7f2516471c524f73220608;hp=b715c370715734ade5e75fd1f1e628a1af44f5db;hb=b1c9f537b475b3bc8f6517bb4d7008a411bb478e;hpb=56ac9bea51f338d488828ad1114d58b4a9542209 diff --git a/lib-lua/lua-token.sh b/lib-lua/lua-token.sh index b715c37..5c61d66 100644 --- a/lib-lua/lua-token.sh +++ b/lib-lua/lua-token.sh @@ -37,14 +37,16 @@ do_h() { #ifndef MUTT_LIB_LUA_LUA_TOKEN_H #define MUTT_LIB_LUA_LUA_TOKEN_H -enum lua_token { +typedef enum mlua_token { LTK_UNKNOWN = -1, -`tr 'a-z-/' 'A-Z__' | sed -e 's/.*/ LTK_&,/'` +`grep_self "$0" | tr 'a-z-/' 'A-Z__' | sed -e 's/.*/ LTK_&,/'` LTK_count, -}; +} mlua_token; + +extern const char *__mlua_token[LTK_count]; __attribute__((pure)) -enum lua_token lua_which_token(const char *s, ssize_t len); +mlua_token mlua_which_token(const char *s, ssize_t len); #endif /* MUTT_LIB_LUA_LUA_TOKEN_H */ EOF } @@ -56,7 +58,7 @@ do_tokens() { } do_c() { - cat <val : LTK_UNKNOWN; } else { return LTK_UNKNOWN; @@ -95,8 +101,8 @@ trap "rm -f $1" 1 2 3 15 rm -f $1 case "$1" in - *.h) grep_self "$0" | do_h > $1;; - *.c) grep_self "$0" | do_c > $1;; + *.h) do_h > $1;; + *.c) do_c > $1;; *) die "you must ask for the 'h' or 'c' generation";; esac chmod -w $1 @@ -104,8 +110,12 @@ chmod -w $1 exit 0 ############ Put tokens here ############ +## bindir +## docdir ## dotlock ## editor ## quit ## sendmail ## shell +## sysconfdir +## version