mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
638ba47303
* enc/encinit.c.erb (Init_enc): initialize encdb and transdb directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
37 lines
882 B
Text
37 lines
882 B
Text
/* Copyright 2012 Google Inc. Some Rights Reserved.
|
|
* Author: yugui@google.com (Yugui Sonoda)
|
|
*/
|
|
#include <stdio.h>
|
|
|
|
#define init(func, name) { \
|
|
extern void func(void); \
|
|
ruby_init_ext(name, func); \
|
|
}
|
|
|
|
#define init_enc(name) init(Init_##name, "enc/"#name".so")
|
|
#define init_trans(name) init(Init_trans_##name, "enc/trans/"#name".so")
|
|
#define provide(func, name) { \
|
|
extern void Init_##func(void); \
|
|
Init_##func(); \
|
|
rb_provide(name".so"); \
|
|
}
|
|
|
|
void ruby_init_ext(const char *name, void (*init)(void));
|
|
void rb_provide(const char *feature);
|
|
|
|
void
|
|
Init_enc(void)
|
|
{
|
|
provide(encdb, "encdb");
|
|
% ENCS.each do |enc|
|
|
% next if enc == 'encdb'
|
|
init_enc(<%= enc %>);
|
|
% end
|
|
|
|
provide(transdb, "trans/transdb");
|
|
% TRANS.each do |trans|
|
|
% next if trans == 'trans/transdb'
|
|
init_trans(<%= File.basename trans %>);
|
|
% end
|
|
}
|
|
<%# vim: set ft=eruby sw=2 : -%>
|