You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
657 B

%module marisa
%include "cstring.i"
%include "exception.i"
%{
#include "marisa-swig.h"
%}
%apply (char *STRING, int LENGTH) { (const char *ptr, std::size_t length) };
%cstring_output_allocate_size(const char **ptr_out, std::size_t *length_out, );
%cstring_output_allocate_size(const char **ptr_out_to_be_deleted,
std::size_t *length_out, delete [] (*$1));
%exception {
try {
$action
} catch (const marisa::Exception &ex) {
SWIG_exception(SWIG_RuntimeError, ex.what());
} catch (...) {
SWIG_exception(SWIG_UnknownError,"Unknown exception");
}
}
%include "marisa-swig.h"
%constant size_t INVALID_KEY_ID = MARISA_INVALID_KEY_ID;