generalize the idea of tokens a bit more, don't restrict it to the rfc822
[apps/madmutt.git] / lib-mime / rfc822hdrs.sh
diff --git a/lib-mime/rfc822hdrs.sh b/lib-mime/rfc822hdrs.sh
deleted file mode 100644 (file)
index 1124536..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-
-die() {
-    echo "$@" 1>&2
-    exit 2
-}
-
-do_h() {
-    echo "#ifndef MUTT_LIB_MIME_RFC822HDRS_H"
-    echo "#define MUTT_LIB_MIME_RFC822HDRS_H"
-    echo "/* THIS FILE IS AUTOGENERATED FROM $< DO NOT MODIFY */"
-    echo "enum rfc822hdr {"
-    echo "    HDR_UNKNOWN,"
-    tr 'a-z-' 'A-Z_' | sed -e 's/.*/    HDR_&,/'
-    echo "};"
-    echo
-    echo "enum rfc822hdr rfc822_well_known(const char *s);"
-    echo "#endif /* MUTT_LIB_MIME_RFC822HDRS_H */"
-}
-
-do_c() {
-    echo "%{"
-    echo "#include <string.h>"
-    echo "#include \"rfc822hdrs.h\""
-    echo "%}"
-    echo "struct hdr { const char *name; int val; };"
-    echo "%%"
-    awk '{print $$0 ", " NR }'
-    echo "%%"
-    echo "enum rfc822hdr rfc822_well_known(const char *s) {"
-    echo "    const struct hdr *res = in_word_set(s, strlen(s));"
-    echo "    return res ? res->val : HDR_UNKNOWN;"
-    echo "}"
-}
-
-case "$1" in
-    *.h) do_h > "$1" ;;
-    *.c) do_c | gperf --ignore-case -t -C -F,0 > "$1" ;;
-    *)  die "you must ask for the 'h' or 'c' generation" ;;
-esac
-
-exit 0