[fetter-devel] Verrazano and ncurses

Brad Beveridge brad.beveridge at gmail.com
Tue Dec 6 03:46:57 UTC 2005


Well, although I am an idiot, and I was using the wrong function. 
However, my question still stands.  How do I easily convert a lisp
string to the :pointer type that the Verrazano generated function
expects?
As another question, how come VZN generated in this particular way?
The C header describes addstr as
extern NCURSES_EXPORT(int) addstr (const char *);

The VZN generated signature is
(cffi:defcfun ("addstr" addstr) :int (anonymous939 :pointer))

If I change the (anonymous939 :pointer) section to (anon... :string)
then I can happily call (addstr "blah")

Should VZN have automatically generated :string instead of :pointer?
I suspect that I maybe ought to be able to write a CFFI type
translator, but that is beyond me right now.

Thanks
Brad


On 12/5/05, Brad Beveridge <brad.beveridge at gmail.com> wrote:
> Arg - I am a dolt!  I should not have been using addchstr to try and
> add a string to the screen - I should have been using addstr, which
> does accept a char *.  I am at work now & can't test my "I am an idiot
> & am using the wrong function" hypotheses - but please don't expend
> effort on my last question.
>
> Cheers
> Brad
>
>
> On 12/5/05, Brad Beveridge <brad.beveridge at gmail.com> wrote:
> > > Also - how do I pass a NULL pointer to a function?
> >
> > Figured this out - cffi:null-ptr.
> > Next question :)
> > ncurses defines a function addchstr(const chtype*), chtype is an int
> > type.  I'd like to call it as
> > (addchstr "test"), but I cant manage to convince SBCL's type system to
> > pass the address of the string elements - though I suspect it would
> > Just Work if the function took a char *.  Any thoughts?
> >
> > Thanks again (the help has been wonderful)
> > Brad
> >
>



More information about the fetter-devel mailing list