X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lua%2Flua-token.sh;h=a3ba223f352def113df4aa47b736335618e0512a;hp=8dc5a8356e88b5a9f5ee28ab1feeb6c56295e68c;hb=1410cfc03a04ccce7aac48a62f9d465ab341cef1;hpb=0dd5b492f18e549ef95b0ac6765329473e426633 diff --git a/lib-lua/lua-token.sh b/lib-lua/lua-token.sh index 8dc5a83..a3ba223 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,9 +110,21 @@ chmod -w $1 exit 0 ############ Put tokens here ############ +## beep +## beep_new +## bindir +## docdir ## dotlock +## dsn_notify +## dsn_return ## editor +## hcache_backend +## homedir ## quit ## sendmail ## shell +## sysconfdir ## tmpdir +## username +## version +## alias_format