aboutsummaryrefslogtreecommitdiffstats
path: root/hxtool
diff options
context:
space:
mode:
Diffstat (limited to 'hxtool')
-rw-r--r--hxtool42
1 files changed, 42 insertions, 0 deletions
diff --git a/hxtool b/hxtool
new file mode 100644
index 000000000..2c5d77368
--- /dev/null
+++ b/hxtool
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+hxtoh()
+{
+ flag=1
+ while read str; do
+ case $str in
+ HXCOMM*)
+ ;;
+ STEXI*|ETEXI*) flag=$(($flag^1))
+ ;;
+ *)
+ test $flag -eq 1 && echo $str
+ ;;
+ esac
+ done
+}
+
+hxtotexi()
+{
+ flag=0
+ while read str; do
+ case "$str" in
+ HXCOMM*)
+ ;;
+ STEXI*|ETEXI*) flag=$(($flag^1))
+ ;;
+ DEFHEADING*)
+ echo $(expr "$str" : "DEFHEADING(\(.*\))")
+ ;;
+ *)
+ test $flag -eq 1 && echo $str
+ ;;
+ esac
+ done
+}
+
+case "$1" in
+"-h") hxtoh ;;
+"-t") hxtotexi ;;
+*) exit 1 ;;
+esac