File: bang.cpp

package info (click to toggle)
ruby-mkrf 0.2.3%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,752 kB
  • ctags: 4,291
  • sloc: ansic: 12,494; ruby: 6,984; sh: 790; yacc: 374; makefile: 57; cpp: 10
file content (15 lines) | stat: -rw-r--r-- 301 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <ruby.h>

VALUE rk_mBang;

static VALUE t_bang(VALUE self) {
  return rb_str_new2("Bang !");
}

extern "C" void Init_bang() {
  // define the class 'Hello'
  rk_mBang = rb_define_module("Bang");
  rb_define_singleton_method(rk_mBang, "bang", (VALUE(*)(...))t_bang, 0);
}