Project

General

Profile

Bug #17788 ยป testgem.cc

memel (Maia Engeli), 04/08/2021 11:02 PM

 
1
#include <stdio.h>
2
#include <ruby.h>
3
#include <iostream>
4

    
5
VALUE says(VALUE _self, VALUE str) {
6
    Check_Type(str, T_STRING);
7
    puts(StringValueCStr(str));
8
    return Qnil;
9
}
10

    
11
void Init_testgem() {
12
    VALUE mod = rb_define_module("Simon");
13
    const int num_args = 1;
14
    std::cout << "*** testgem initialized ***" << std::endl;
15
    rb_define_module_function(mod, "says", says, num_args);
16
}