On c-code side it goes:
/* Declarations */
DATABLOCK *new_db ();
edit_db(DATABLOCK **db);
/* Usage */
db = new_db();
edit_db(&db);
How this goes on Ruby? https://github.com/ffi/ffi/wiki/Examples mentions about MemoryPointer but on my case I already have that buffer (created by new_db()), so how to pass reference to buffer for edit_db() or how it should go? Bit lost here..
edit_db() takes a pointer to a pointer as its parameter.
So, you need something like: