summaryrefslogtreecommitdiffstats
path: root/tools/extract-api.sh
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy.zurcher@heraeus.com>2011-04-15 11:56:04 +0200
committerJérémy Zurcher <jeremy.zurcher@heraeus.com>2011-04-15 11:56:04 +0200
commit4b845a0950d2e17fa18c36ca3c399b7ca3a70fac (patch)
treef6e78be03772eac21c7c662030b73d44197e0c32 /tools/extract-api.sh
parent6bebc30cc42be2a02c7c95f8553d8be20822dcc3 (diff)
downloadffi-efl-4b845a0950d2e17fa18c36ca3c399b7ca3a70fac.zip
ffi-efl-4b845a0950d2e17fa18c36ca3c399b7ca3a70fac.tar.gz
add tool/extract-api.sh
Diffstat (limited to 'tools/extract-api.sh')
-rwxr-xr-xtools/extract-api.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
new file mode 100755
index 0000000..3335fd7
--- /dev/null
+++ b/tools/extract-api.sh
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+for header in \
+ '/opt/e17/include/eet-1/Eet.h' \
+ '/opt/e17/include/edje-1/Edje.h' \
+ '/opt/e17/include/evas-1/Evas.h' \
+ '/opt/e17/include/evas-1/Evas_GL.h' \
+ '/opt/e17/include/ecore-1/Ecore.h' \
+ '/opt/e17/include/ecore-1/Ecore_Con.h' \
+ '/opt/e17/include/ecore-1/Ecore_Evas.h' \
+ '/opt/e17/include/ecore-1/Ecore_Fb.h' \
+ '/opt/e17/include/ecore-1/Ecore_File.h' \
+ '/opt/e17/include/elementary-0/Elementary.h' \
+ ; do
+ #
+ DIR=$(dirname $header)
+ FILE=$(basename $header)
+ #
+ [ -f $FILE-diff ] && rm $FILE-diff
+ [ -f $FILE ] && mv $FILE $FILE.prev
+ # loop1 : fix EAPI with return type on separate line
+ # loop2 : fix EAPI with multilines arguments
+ cat $header | sed -ne ':loop1;/EAPI.*[^;]$/N;s/\n//;s/ \{2,\}/ /g;t loop1;' -e ':loop2;/,$/N;s/,\n/ /;s/ \{2,\}/ /g;t loop2;' -e 's/^ *EAPI/EAPI/p' > $FILE
+ # sed -r 's/EAPI ([a-zA-Z][a-zA-Z_ ]*[a-zA-Z]( \*+ ?| ))([a-z[a-z_0-9]*[a-z]) ?\(([a-zA-Z0-9_ \*,\.]+)\) */#\1#\3#\4#/' > $FILE
+ #
+ if [ -f $FILE.prev ]; then
+ diff -u0 $FILE.prev $FILE > $FILE-diff
+ N=$(cat $FILE-diff | wc -l)
+ [ $N -eq 0 ] && rm $FILE-diff
+ fi
+ #
+done