summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-12-26 00:08:42 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-12-26 00:08:42 +0100
commitdd6596f933b277f7b9106d955bae5e63418c338a (patch)
tree6c892c7b5cfd1ad9fb502c46606929faa91657e0 /tools
parent1c3383b56aa1eac236a8c9f388a2450ec8d779e9 (diff)
downloadffi-efl-dd6596f933b277f7b9106d955bae5e63418c338a.zip
ffi-efl-dd6596f933b277f7b9106d955bae5e63418c338a.tar.gz
tools/genruby: accept spaces in callback typedefs name
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genruby.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/genruby.rb b/tools/genruby.rb
index ede2c7e..7a7c469 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -140,7 +140,7 @@ def gen_callbacks path, indent
r = []
open(path+'-callbacks','r').readlines.each do |l|
l.strip!
- if not l=~/^\s*typedef\s+(.*)((?:\(\*?\w+\)| \*?\w+))\s*\((.*)\);/
+ if not l=~/^\s*typedef\s+(.*)((?:\(\*\s*?\w+\)| \*?\w+))\s*\((.*)\);/
printf "\033[0;31m# #{l}\n#{indent}# FIXME\033[0m\n"
r << indent+"# #{l}\n#{indent}# FIXME"
next
@@ -148,7 +148,7 @@ def gen_callbacks path, indent
ret = $1.strip
name = $2.strip
args = $3.split(',').collect { |arg| get_type_from_arg arg, l }.join ', '
- t = name.sub(/\(/,'').sub(/\)/,'').sub(/\*/,'')
+ t = name.sub(/^\(\* */,'').sub(/\)$/,'')
sym = ( t.downcase=~/_cb$/ ? t : t+'_cb' )
tsym = set_type t, sym
r << indent+"# #{l}"