2024-02-21 13:26:22 +03:00
|
|
|
// This file is used by dynamically-linked ruby, which has no
|
|
|
|
// statically-linked encodings other than the builtin encodings.
|
|
|
|
//
|
|
|
|
// - miniruby does not use this Init_enc. Instead, "miniinit.c"
|
|
|
|
// provides Init_enc, which defines only the builtin encodings.
|
|
|
|
//
|
|
|
|
// - Dynamically-linked ruby uses this Init_enc, which requires
|
|
|
|
// "enc/encdb.so" to load the builtin encodings and set up the
|
|
|
|
// optional encodings.
|
|
|
|
//
|
|
|
|
// - Statically-linked ruby does not use this Init_enc. Instead,
|
|
|
|
// "enc/encinit.c" (which is a generated file) defines Init_enc,
|
|
|
|
// which activates the encodings.
|
2024-02-21 11:14:49 +03:00
|
|
|
|
2014-12-03 08:51:28 +03:00
|
|
|
#define require(name) ruby_require_internal(name, (unsigned int)sizeof(name)-1)
|
|
|
|
int ruby_require_internal(const char *, int);
|
|
|
|
|
2014-11-27 23:02:32 +03:00
|
|
|
void
|
|
|
|
Init_enc(void)
|
|
|
|
{
|
2014-12-03 09:13:58 +03:00
|
|
|
if (require("enc/encdb.so") == 1) {
|
2014-12-03 08:51:28 +03:00
|
|
|
require("enc/trans/transdb.so");
|
|
|
|
}
|
2014-11-27 23:02:32 +03:00
|
|
|
}
|