Hello,
Engine - A handle to a MATLAB engine object.
int engClose(Engine *ep);
int engEvalString(Engine *ep,const char *string);
int engGetVisible(Engine *ep, bool *value);
Engine *engOpen(const char *startcmd);
Engine *engOpenSingleUse(const char *startcmd, void *dcom, int
*retstatus);
int engOutputBuffer(Engine *ep, char *p, int n);
int engSetVisible(Engine *ep, bool value);
Here's my first untested attempt for the Engine part, minus a Structure for
mxArray (presently just wrapped as a Pointer):
public interface EngineLibrary extends Library {
EngineLibrary INSTANCE = (EngineLibrary2) Native.loadLibrary("libeng",
EngineLibrary.class);
int engEvalString(Pointer ep, String string);
Pointer engOpenSingleUse(String startcmd, Pointer reserved,
IntByReference retstatus);
int engSetVisible(Pointer ep, boolean newVal);
int engGetVisible(Pointer ep, ByteByReference bVal);
Pointer engOpen(String startcmd);
int engClose(String ep);
Pointer engGetVariable(Pointer ep, String name);
int engPutVariable(Pointer ep, String name, Pointer ap);
int engOutputBuffer(Pointer ep, ByteBuffer buffer, int buflen);
}
Once you set an output buffer with engOutputBuffer, you're going to have
make sure you keep around a reference to it for as long as the engine is
open. I think you'll also have to allocate it as a direct buffer so that you
will be able to see the output MATLAB writes.
Next up, mxArray...
Regards,
Albert