[cairo-commit] rcairo/gen gen.rb,1.4,1.5 load_api.rb,1.2,1.3
Evan Martin
commit at pdx.freedesktop.org
Mon Apr 19 14:35:59 PDT 2004
Committed by: martine
Update of /cvs/cairo/rcairo/gen
In directory pdx:/tmp/cvs-serv32455/gen
Modified Files:
gen.rb load_api.rb
Log Message:
Minor changes to update generation code to work with latest cairo.h.
Still doesn't handle new types like glyph_t, pattern_t, etc.
Index: gen.rb
===================================================================
RCS file: /cvs/cairo/rcairo/gen/gen.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** a/gen.rb 25 Nov 2003 04:35:42 -0000 1.4
--- b/gen.rb 19 Apr 2004 21:35:57 -0000 1.5
***************
*** 7,10 ****
--- 7,15 ----
require 'load_api'
+ if ARGV.length < 1
+ puts "usage: #{$0} path/to/cairo.h"
+ exit 1
+ end
+
$FILE_HEADER = '/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
Index: load_api.rb
===================================================================
RCS file: /cvs/cairo/rcairo/gen/load_api.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/load_api.rb 19 Nov 2003 18:51:51 -0000 1.2
--- b/load_api.rb 19 Apr 2004 21:35:57 -0000 1.3
***************
*** 24,28 ****
#puts "-->decl<-- #{decl}"
case decl
! when /^extern (.+?) (?:__external_linkage) (\w+) \((.+?)\)$/
ret, func, args = $1, $2, $3.strip
ret = nil if ret == 'void'
--- 24,28 ----
#puts "-->decl<-- #{decl}"
case decl
! when /^(.+?) (\w+) \((.+?)\)$/
ret, func, args = $1, $2, $3.strip
ret = nil if ret == 'void'
***************
*** 47,52 ****
#puts "-->type<-- #{type}"
structs << type
! when /^typedef enum (.*?) \{(.*?)\} (\w+)$/
! tag, content, type = $1, $2, $3
defs = content.split(/,\s*/).map { |value|
value.gsub!(/^\s*(\w+).*?$/) { $1 }
--- 47,52 ----
#puts "-->type<-- #{type}"
structs << type
! when /^typedef enum .*?\{(.*?)\} (\w+)$/
! content, type = $1, $2
defs = content.split(/,\s*/).map { |value|
value.gsub!(/^\s*(\w+).*?$/) { $1 }
More information about the cairo-commit
mailing list