File: dmyenc.c

package info (click to toggle)
ruby3.4 3.4.9-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 152,040 kB
  • sloc: ruby: 1,262,509; ansic: 831,188; yacc: 28,233; pascal: 7,359; sh: 3,910; python: 1,799; cpp: 1,158; makefile: 827; asm: 808; javascript: 414; lisp: 109; perl: 62; awk: 36; xml: 4; sed: 4
file content (24 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 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.

#define require(name) ruby_require_internal(name, (unsigned int)sizeof(name)-1)
int ruby_require_internal(const char *, int);

void
Init_enc(void)
{
    if (require("enc/encdb.so") == 1) {
        require("enc/trans/transdb.so");
    }
}