The documentation in this area is weak and incomplete. This will be
corrected in the J602 release, but that doesn't do you much good right
now.
Take a look at system/examples/dll/jdll.ijs. Studying it will make clear
the basic sequence.
The J Socket Protocal is a socket layer applied on top of the dll
interface. Studying User Manual|Sockets|J Socket Protocol can provide
some insights.
The interface for basic use if very simple and gets more complicated
only as the requirements of a general programming type front end are
added on. In particular the callbacks required for wd comamnds.
For simple use all you need are.
Jinit - load and init the J Engine
Jdo- execute J sentences
JGetM/JsetM - read and write J arrays
Jfree - release shared library and resource when done (not required if
release at app exit is satisfactory)
Rather than JGetM/JSetM it might be easier and more effieicnt to to use
mapped files and memory address to pass data between the app and the
library.
----- Original Message -----
From: "Yuri Burger" <[EMAIL PROTECTED]>
To: "General forum" <[email protected]>
Sent: Thursday, November 23, 2006 9:31 AM
Subject: Re: [Jgeneral] embedded J
Thanks, but I can't find good description of functions exported by
libj601.so .. I found some partial descriptions, something from wiki
pages, something from forums, something from J examples, something
directly from libj601.so ... but why there is no good solid page with
description of interface, and maybe with several examples for unix?
I found following exported functions: JSM, JFree, JErrorTextM, Jga,
JGetM, JGetLocale, JInit, JDo, JFree, JSetM
I found following definitions:
typedef int(*f_JInit)(void);
typedef int(*f_JDo)(int handle, char* sentence);
typedef int(*f_JFree)(int);
typedef int(*f_JGetM)(int handle, char*, int*, int*, int*, int*);
typedef int(*f_JSetM)(int handle, char* name, int* type, int* rank,
int** shape, int* data);
Could somebody, please, show me definitions of rest functions, and
describe their arguments?
Also, could somebody show example of normal flow. What should be
executed first (JInit?), and what should be executed at the end
(JFree?), and how use each function, how set/get varriables, how exec
sentences, etc...
Thanks...
Yes, it is possible (and fairly easy) to use the J Engine (j.dll or
libj601.so) from C/C++ (or any other language or environment that can
use shared libraries).
See User Manual|DLLSs and Memory Management|Calling J.DLL.
The documentation and the dll script (system/examples/dll/jdll.ijs)
are for windows, but with minor and obvious changes apply equally to
the Unix libj601.so.
----- Original Message ----- From: "Yuri Burger"
<[EMAIL PROTECTED]>
To: "General forum" <[email protected]>
Sent: Thursday, November 23, 2006 5:18 AM
Subject: [Jgeneral] embedded J
Is it possible to use J as embedded language? I mean, is it possible
to to use libj601.so from C/C++ application?
--
Yuri Burger,
Senior Researcher
Kiev Zoral Development Center
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
--
Yuri Burger,
Senior Researcher
Kiev Zoral Development Center
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm