X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lua%2Flua-token.sh;h=e524119c82f59af377397c7d373ef905c6dab1d4;hp=4a73f32ddfb7ffa71871aa417380e66fd7b34a4f;hb=68d92974c5785799ffb24f6577ae030594f91b29;hpb=488a60c8ef78872f38bbb3439a75cb2cda985a12 diff --git a/lib-lua/lua-token.sh b/lib-lua/lua-token.sh index 4a73f32..e524119 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,45 @@ chmod -w $1 exit 0 ############ Put tokens here ############ +## alias_file +## alias_format +## ask-no +## ask-yes +## assumed_charset +## beep +## beep_new +## bindir +## charset +## docdir ## dotlock +## dsn_notify +## dsn_return ## editor +## envelope_from_address +## file_charset +## gecos_mask +## hcache_backend +## homedir +## hostname +## mailcap_path +## mailcap_sanitize +## mail_check +## no +## operating_system +## quit +## record +## send_charset ## sendmail +## sendmail_wait ## shell +## shorthost +## signature +## spam_separator +## sysconfdir ## tmpdir +## use_8bitmime +## use_domain +## use_envelope_from +## username +## version +## yes