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 | 6050298ffd0c9e8b7fe3c483bcf825d56a22d96a (patch) | |
| tree | dc22ba0d8d5d8f40e161cbb68f297bc6a50427a3 /template | |
| parent | 9315bc11674a764db4f54c56c3ac5155d4edd1a3 (diff) | |
| download | ruby-6050298ffd0c9e8b7fe3c483bcf825d56a22d96a.tar.gz ruby-6050298ffd0c9e8b7fe3c483bcf825d56a22d96a.tar.xz ruby-6050298ffd0c9e8b7fe3c483bcf825d56a22d96a.zip | |
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: http://svn.ruby-lang.org/repos/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 e65b65105..4275a4c2f 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 |
