diff options
-rw-r--r-- | tools/sed-callbacks | 1 | ||||
-rw-r--r-- | tools/sed-enums | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/sed-callbacks b/tools/sed-callbacks new file mode 100644 index 0000000..6fe6e5e --- /dev/null +++ b/tools/sed-callbacks @@ -0,0 +1 @@ +/^\s*typedef\s+([a-zA-Z0-9_\* ]+?)\s+(\(\*)?(\w+)\)?\s*\(.*\);\s*$/p diff --git a/tools/sed-enums b/tools/sed-enums index ea7c5f7..3b6c7a5 100644 --- a/tools/sed-enums +++ b/tools/sed-enums @@ -1,14 +1,14 @@ -s/.*(enum\s+[a-zA-Z0-9_]+).*$/typedef \1 { / +s/.*(enum\s+\w+).*$/typedef \1 { / T;h :attrs;n s/^\s*([A-Z0-9_]+).*$/\1, / T next;H;b attrs :next /^\s*\}/ ! b attrs -s/^\s*}\s*([a-zA-Z0-9_]+).*$/ } \1;/ +s/^\s*}\s*(\w+).*$/ } \1;/ t finish :close -s/^\s*typedef\s+enum\s+[a-zA-Z0-9_]+\s+([a-zA-Z0-9_]+)\s+;/ } \1/ +s/^\s*typedef\s+enum\s+\w+\s+(\w+)\s+;/ } \1/ t finish;n;T close :finish H;x |