Creating a LeanLisp DLL:
% Filename "LeanLisp.dll"
% DLL
includepath "$\inc\"
include rtl32.inc
include console.inc
includepath ""
% UseSystemConsole
% NoOxygenCompile
include LispishUtil.inc
extern export
function lispB(string s) as string
==================================
return lisp s
end function
function lispC(char *ib,*ob, sys lb)
====================================
string s=ib
string t=lisp s
sys lt=1+len t
if lt>lb then
lt=lb : mid t,lt, chr(0)
end if
if @ob then
copy @ob, strptr t, lt
end if
end function
end extern
Accessing the DLL (Oxygen)
extern lib "LeanLisp.dll"
! lispB(string s) as string
! lispC(char*ib,*ob, sys lb)
end extern
'BSTR / OLESTRING INTERFACE
===========================
'string s=lispB getfile "LispishTest3.txt"
'CHAR* INTERFACE
================
sys lb=0x10000 'length of output buffer ob
string ib=getfile "LispishTest3.txt"
string ob=nuls lb
lispC ib,ob,lb
Test Code: (LispishTest3.txt)
(eval
(print "Enter Lispish Expressions:" (cr) )
(loop
( do
(color 0xb)
(let e (input) )
(case (get e) "" (exit) )
(color 0xe)
(print e (cr) ) ; evaluated
(color 0x7)
)
)
(cr)
)
32 bit DLL included:
.