Skip to content

Commit

Permalink
Add odgi.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Oct 21, 2023
1 parent 645887e commit 5164f11
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@
*.lock
mkmf.log

/ext/odgi/*.cpp
/ext/odgi/*.h

39 changes: 39 additions & 0 deletions ext/odgi/odgi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include <rice/rice.hpp>
#include <rice/stl.hpp>

#include "version.hpp"

using namespace Rice;

// version.hpp

String get_version()
{
return String(odgi::Version::get_version());
}

String get_release()
{
return String(odgi::Version::get_release());
}

String get_codename()
{
return String(odgi::Version::get_codename());
}

String get_short()
{
return String(odgi::Version::get_short());
}

// odgi.hpp

extern "C" void Init_odgi(void)
{
define_module("Odgi")
.define_module_function("get_version", &get_version)
.define_module_function("get_release", &get_release)
.define_module_function("get_codename", &get_codename)
.define_module_function("get_short", &get_short);
}

0 comments on commit 5164f11

Please sign in to comment.