From: Frederic Bastenaire
Subject: FFI in CLISP for WIN32
Date: 
Message-ID: <d977c973.0305150111.5bbed37c@posting.google.com>
Hello,

I have been browsing CLISP doc, the Internet, and this NG about FFI in
CLISP/win32, but I found no practical examples.
The CLISP-LINK utility is always mentionned and does not seem to be
included in the WIN32 release; is it LINUX specific?
Has anybody already used CLISP's FFI interface in WIN32? Would it
be possible to see an example?
I would simply like to call a C function that creates a YES/NO 
menu box and returns a boolean for example.

Thank you in advance,

Frederic Bastenaire (···@free.fr)

From: OCID
Subject: Re: FFI in CLISP for WIN32
Date: 
Message-ID: <ba0ju4$q5o$1@mozo.cc.purdue.edu>
Its bundled with the cygwin version of Clisp on Win2K and is very well
documented at this site for an example ...

http://www.niksula.cs.hut.fi/~tsiivola/html/clisp-ffi-howto.html

And the clisp docs.

Take Care

"Frederic Bastenaire" <···@free.fr> wrote in message
·································@posting.google.com...
> Hello,
>
> I have been browsing CLISP doc, the Internet, and this NG about FFI in
> CLISP/win32, but I found no practical examples.
> The CLISP-LINK utility is always mentionned and does not seem to be
> included in the WIN32 release; is it LINUX specific?
> Has anybody already used CLISP's FFI interface in WIN32? Would it
> be possible to see an example?
> I would simply like to call a C function that creates a YES/NO
> menu box and returns a boolean for example.
>
> Thank you in advance,
>
> Frederic Bastenaire (···@free.fr)
From: Frederic Bastenaire
Subject: Re: FFI in CLISP for WIN32
Date: 
Message-ID: <ba3a3u$nal$1@news-reader14.wanadoo.fr>
Hi!

thank you for this interesting reference.
Actually, this sites talks about CLISP FFI on Debian. I could not find
anything about win32.
I'll try Cygwin, but I would prefer to use MINGW and "native" win32 code.
Any idea?

Yours,


 Frederic Bastenaire (···@free.fr)


----- Original Message -----
From: "OCID" <······@purdue.edu>
Newsgroups: comp.lang.lisp
Sent: Thursday, May 15, 2003 7:48 PM
Subject: Re: FFI in CLISP for WIN32


> Its bundled with the cygwin version of Clisp on Win2K and is very well
> documented at this site for an example ...
>
> http://www.niksula.cs.hut.fi/~tsiivola/html/clisp-ffi-howto.html
>
> And the clisp docs.
>
From: Sam Steingold
Subject: Re: FFI in CLISP for WIN32
Date: 
Message-ID: <m3u1bu1y50.fsf@loiso.podval.org>
> * In message <············@news-reader14.wanadoo.fr>
> * On the subject of "Re: FFI in CLISP for WIN32"
> * Sent on Fri, 16 May 2003 20:19:00 +0200
> * Honorable "Frederic Bastenaire" <···················@wanadoo.fr> writes:
>
> I'll try Cygwin, but I would prefer to use MINGW and "native" win32 code.

Jorg Hohle published _vast_ and very helpful tutorials on CLISP FFI.
Search <clisp-list> archives on <http://clisp.cons.org>.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Small languages require big programs, large languages enable small programs.
From: Michael J. Ferrador
Subject: Re: FFI in CLISP for WIN32
Date: 
Message-ID: <3EC70710.2F3ADFE6@orn.com>
I know zero about Win32 prgramming...

...I was looking into CLISP on CygWin, because it now has Xfree86
But came across the /dev/windows (message queue) device.

I'm not sure it's limitations compared to the Win API,
but it might be interesting from serve-event (select()) style.
From: Joerg-Cyril Hoehle
Subject: Re: FFI in CLISP for WIN32
Date: 
Message-ID: <u65nba8id.fsf@T-Systems.com>
···@free.fr (Frederic Bastenaire) writes:
> I have been browsing CLISP doc, the Internet, and this NG about FFI in
> CLISP/win32, but I found no practical examples.

Indeed, they are lacking. CLISP FFI on native win32 was the forgotten
stepdaughter until I showed last year in clisp-list how to bring it to
life ("how to use the regexp module on MS-Windows").
I hope that since then, the regexp module has become part of
MS-Windows binary distributions, but I haven't checked.

> I would simply like to call a C function that creates a YES/NO 
> menu box and returns a boolean for example.

Esp. GUI examples are lacking, since AFAIK nobody ever used the
MS-Windows API via CLISP's FFI and there's nothing like CAPI (known
from lispworks). Dan Stanger wrote a gdi module (which uses the FFI)
to use OpenGL to do GUI stuff: that's independent on the OS' native
GUI. I enjoyed running his demo on my MS-w2k box. I haven't used gdi
for quite some time now.


> The CLISP-LINK utility is always mentionned and does not seem to be
> included in the WIN32 release; is it LINUX specific?
UNIX-specific. But you don't need it.


> Has anybody already used CLISP's FFI interface in WIN32? Would it
> be possible to see an example?

I did, but only for toy examples (call "sleep" from
kernel.dll). You'll most probably need my last-year's patches (see
clisp-list archives) to enable calling foreign functions from
arbitrary foreign libraries, which I have not yet found time to
finalize into a portable (OS independent across at least UNIX,
MS-Windows and AmigaOS) system for calling arbitrary functions in
shared libraries from CLISP.

Or you get a CLISP with gdi module and write GUI stuff using
gdi/OpenGL.

Or you compile CLISP from sources and link your C function which does
GUI stuff, since your code already exists. I have an article about
"extending CLISP via external modules" which goes into details, but
the FFI section from impnotes.html and my e-mail about enabling regexp
on MS-Windows should be enough for the simple interface your describe.
(def-call-out ask-user
  (:arguments (message c-string))
  (:return-type boolean) (:language :stdc))

Or you investigate the cygwin approach, which gives you a CLISP in a
UNIX environment, maybe X, but no native MS-Windows library calls.

Regards,
	Joerg Hoehle
TSI ITC-Security
From: Sam Steingold
Subject: Re: FFI in CLISP for WIN32
Date: 
Message-ID: <u3cib12kb.fsf@gnu.org>
> * In message <·············@T-Systems.com>
> * On the subject of "Re: FFI in CLISP for WIN32"
> * Sent on 12 Jun 2003 12:35:22 +0200
> * Honorable Joerg-Cyril Hoehle <······@users.sourceforge.net> writes:
>
> > The CLISP-LINK utility is always mentionned and does not seem to be
> > included in the WIN32 release; is it LINUX specific?
> UNIX-specific. But you don't need it.

indeed.

OTOH, it is very convenient, and with mingw there is no reason not to
use it (except that the binary it creates crashes on startup).

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Old Age Comes at a Bad Time.