diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-04 00:50:59 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-04 00:50:59 +0000 |
commit | b3d7273dc1f7e29a759de8dd88cd00f99a66bed1 (patch) | |
tree | dc22ba0d8d5d8f40e161cbb68f297bc6a50427a3 /template | |
parent | e00b83ceb91048da8549399c11618345ce32d9cc (diff) | |
download | ruby-b3d7273dc1f7e29a759de8dd88cd00f99a66bed1.tar.gz |
Add functions and macros for second encoding definitions.
* encoding.c (rb_enc_set_base): Add for setting base encoding
with their names. this is internal function.
* template/encdb.h.tmpl: specify ENC_SET_BASE for second
encodings in each encoding files.
* enc/encdb.c (rb_enc_set_base): add a declaration.
(ENC_SET_BASE): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r-- | template/encdb.h.tmpl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/template/encdb.h.tmpl b/template/encdb.h.tmpl index e65b651050..4275a4c2f0 100644 --- a/template/encdb.h.tmpl +++ b/template/encdb.h.tmpl @@ -34,11 +34,15 @@ encdirs.each do |encdir| next if files[fn] files[fn] = true open(File.join(encdir,fn)) do |f| - orig = nil name = nil f.each_line do |line| if (/^OnigEncodingDefine/ =~ line)..(/"(.*?)"/ =~ line) if $1 + if name + lines << %[ENC_SET_BASE("#$1", "#{name}");] + else + name = $1 + end check_duplication(defs, $1, fn, $.) encodings << $1 count += 1 |