X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lua%2Flua-token.sh;h=a7d9916824fd60d9522039bb697756e746783993;hp=4bf256f018eaeb5bc41a6ad17d55d16d1512d986;hb=e80bef3a43b0f679b6fff30cbecce56539b7980e;hpb=88d22daa9c1316d5ccc4b4bb60d40cc96c767757 diff --git a/lib-lua/lua-token.sh b/lib-lua/lua-token.sh index 4bf256f..a7d9916 100644 --- a/lib-lua/lua-token.sh +++ b/lib-lua/lua-token.sh @@ -37,19 +37,28 @@ do_h() { #ifndef MUTT_LIB_LUA_LUA_TOKEN_H #define MUTT_LIB_LUA_LUA_TOKEN_H -enum lua_token { - LTK_UNKNOWN, -`tr 'a-z-/' 'A-Z__' | sed -e 's/.*/ LTK_&,/'` -}; +typedef enum mlua_token { + LTK_UNKNOWN = -1, +`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 } +do_tokens() { + while read tok; do + echo "$tok, LTK_`echo $tok | tr 'a-z-' 'A-Z_'`" + done +} + do_c() { - cat <val : LTK_UNKNOWN; } else { return LTK_UNKNOWN; @@ -88,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 @@ -97,5 +110,28 @@ chmod -w $1 exit 0 ############ Put tokens here ############ -## shell +## alias_file +## alias_format +## ask-no +## ask-yes +## beep +## beep_new +## bindir +## docdir +## dotlock +## dsn_notify +## dsn_return +## editor +## gecos_mask +## hcache_backend +## homedir +## no +## quit ## sendmail +## shell +## sysconfdir +## tmpdir +## use_domain +## username +## version +## yes