summaryrefslogtreecommitdiff
path: root/template/extinit.c.tmpl
blob: e0b076b03c8c9b7900d8bb57f20d2a76132a6ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
%# -*- C -*-
% extinits = ARGV.map {|n| [n.tr('/', '_'), n]}
#include "ruby/ruby.h"

#define init(func, name) {	\
    extern void func(void);	\
    ruby_init_ext(name".so", func); \
}

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

void Init_ext(void)
{
% extinits.each do |f, n|
    init(Init_<%=f%>, <%=n.dump%>);
% end
}