Skip to content

Instantly share code, notes, and snippets.

@whiteley
Created July 26, 2014 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whiteley/1c071e17ed06289d7339 to your computer and use it in GitHub Desktop.
Save whiteley/1c071e17ed06289d7339 to your computer and use it in GitHub Desktop.
%module mdb
%{
#include "db_cxx.h"
%}
%include "std_string.i"
%include "db_cxx.h"
#include <cstdlib>
#include <db_cxx.h>
int main(int argc, const char **argv) {
Db *db = new Db(NULL, 0);
db->close(0);
delete db;
return EXIT_SUCCESS;
}
package main
import (
"./mdb"
"fmt"
)
func main() {
var zero mdb.SwigcptrU_int32_t = 0
db := mdb.NewDb(nil, zero)
fmt.Println("mdb-t1")
db.Close(zero)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment