summaryrefslogtreecommitdiffstats
path: root/tools/extract-api.sh
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-16 09:57:18 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-16 09:57:18 +0200
commitb8fb8382d1d472199970241900a30384a71b8060 (patch)
tree1cb6b415b98020922bf23f96c1f2967c6cc1eca0 /tools/extract-api.sh
parent4b845a0950d2e17fa18c36ca3c399b7ca3a70fac (diff)
downloadffi-efl-b8fb8382d1d472199970241900a30384a71b8060.zip
ffi-efl-b8fb8382d1d472199970241900a30384a71b8060.tar.gz
extract-api.sh uses external sed scripts
Diffstat (limited to 'tools/extract-api.sh')
-rwxr-xr-xtools/extract-api.sh36
1 files changed, 20 insertions, 16 deletions
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 3335fd7..ecf3edd 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -1,27 +1,31 @@
#! /bin/bash
-
+#
+# TODO : use pkg-config
+#
+INCLUDE=$(pkg-config --libs ecore |gawk '{ print substr($1,3) }' | sed s/lib/include/)
+#
+rm *-diff 2>/dev/null
+#
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' \
+ "${INCLUDE}/eet-1/Eet.h" \
+ "${INCLUDE}/edje-1/Edje.h" \
+ "${INCLUDE}/evas-1/Evas.h" \
+ "${INCLUDE}/evas-1/Evas_GL.h" \
+ "${INCLUDE}/ecore-1/Ecore.h" \
+ "${INCLUDE}/ecore-1/Ecore_Con.h" \
+ "${INCLUDE}/ecore-1/Ecore_Evas.h" \
+ "${INCLUDE}/ecore-1/Ecore_Fb.h" \
+ "${INCLUDE}/ecore-1/Ecore_File.h" \
+ "${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
+ #
+ cat $header | sed -n -f sed-functions > $FILE
+ cat $header | sed -r -n -f sed-enums > $FILE-enum
#
if [ -f $FILE.prev ]; then
diff -u0 $FILE.prev $FILE > $FILE-diff