summaryrefslogtreecommitdiffstats
path: root/tools/sed-types
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sed-types')
-rw-r--r--tools/sed-types14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/sed-types b/tools/sed-types
new file mode 100644
index 0000000..7ac79a2
--- /dev/null
+++ b/tools/sed-types
@@ -0,0 +1,14 @@
+s/^\s*typedef\s+(struct\s+)?((\w+\**\s+)*)(\w+)\s*;.*$/typedef \1 \2 \4;/
+t finish
+s/^\s*typedef\s+(struct.*[^;].*)/typedef \1/
+T
+h
+:loop
+n
+/^\s*\}/ ! b loop
+s/^\s*\}\s*(\w+)\s*;.*$/\1;/
+H;x
+s/\n/ /g
+:finish
+s/ {2,}/ /g
+p