2012-05-16 09:39:06 +04:00
|
|
|
/* 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); \
|
|
|
|
}
|
|
|
|
|
2014-12-03 10:47:37 +03:00
|
|
|
#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"); \
|
|
|
|
}
|
|
|
|
|
2012-05-16 09:39:06 +04:00
|
|
|
void ruby_init_ext(const char *name, void (*init)(void));
|
2014-12-03 10:47:37 +03:00
|
|
|
void rb_provide(const char *feature);
|
2012-05-16 09:39:06 +04:00
|
|
|
|
2012-05-19 07:44:04 +04:00
|
|
|
void
|
|
|
|
Init_enc(void)
|
2012-05-16 09:39:06 +04:00
|
|
|
{
|
2014-12-03 10:47:37 +03:00
|
|
|
provide(encdb, "encdb");
|
2012-05-17 05:39:39 +04:00
|
|
|
% ENCS.each do |enc|
|
2014-12-03 10:47:37 +03:00
|
|
|
% next if enc == 'encdb'
|
|
|
|
init_enc(<%= enc %>);
|
2012-05-17 05:39:39 +04:00
|
|
|
% end
|
2012-05-16 09:39:06 +04:00
|
|
|
|
2014-12-03 10:47:37 +03:00
|
|
|
provide(transdb, "trans/transdb");
|
2012-05-17 05:39:39 +04:00
|
|
|
% TRANS.each do |trans|
|
|
|
|
% next if trans == 'trans/transdb'
|
2014-12-03 10:47:37 +03:00
|
|
|
init_trans(<%= File.basename trans %>);
|
2012-05-17 05:39:39 +04:00
|
|
|
% end
|
2012-05-16 09:39:06 +04:00
|
|
|
}
|
2012-05-17 05:39:39 +04:00
|
|
|
<%# vim: set ft=eruby sw=2 : -%>
|