summaryrefslogtreecommitdiff
path: root/hxtool
diff options
context:
space:
mode:
Diffstat (limited to 'hxtool')
-rw-r--r--hxtool44
1 files changed, 44 insertions, 0 deletions
diff --git a/hxtool b/hxtool
new file mode 100644
index 000000000..8dbeb76f6
--- /dev/null
+++ b/hxtool
@@ -0,0 +1,44 @@
+#!/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
+
+exit 0