summaryrefslogtreecommitdiff
path: root/enc/encinit.c.erb
blob: fd3ade0c4b714655f4f202e9db7e3d710646405c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* 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);	\
}

void ruby_init_ext(const char *name, void (*init)(void));

void
Init_enc(void)
{
% ENCS.each do |enc|
    init(Init_<%= enc %>, "enc/<%= enc %>.so");
% end

    init(Init_transdb, "enc/trans/transdb.so");
% TRANS.each do |trans|
%   next if trans == 'trans/transdb'
    init(Init_trans_<%= File.basename trans %>, "enc/<%= trans %>.so");
% end
}
<%# vim: set ft=eruby sw=2 : -%>