Skip to content

Instantly share code, notes, and snippets.

@matejuh
matejuh / embeded_struct.c
Created January 19, 2012 17:14
Embedding a Ruby Interpreter- working with struct
struct Address {
char * town;
};
struct Person {
struct Address * address;
char * name;
};
static VALUE wrap_person_get_address(VALUE self) {
@matejuh
matejuh / Makefile
Created January 18, 2012 20:31
Embedding a Ruby Interpreter
LIB=/home/matej/.rvm/rubies/ruby-1.9.2-p290/lib
INC=/home/matej/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/
CFLAGS=-I$(INC) -I/home/matej/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux/ -g
LDFLAGS=-L$(LIB) -ldl -lruby1.9
embed2: embed2.o
$(CC) -o embed2 embed2.o $(LDFLAGS)