From b3d7273dc1f7e29a759de8dd88cd00f99a66bed1 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 4 Aug 2009 00:50:59 +0000 Subject: 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 --- template/encdb.h.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'template') 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 -- cgit v1.2.3