Lisp HUG Maillist Archive

char *name != (:pointer :char)

I have a function that expects 'char *name' as a parameter. The parser-generator
converts this to (name (:pointer :char)).

However (fli:convert-to-foreign-string), and (fli:with-foreign-string) both
create pointers to (:unsigned :char).

Is it legal to coerce the value returned by convert-to-foreign-string, or should
I add ':no-check t' to the foreign function definition?

-Luke



Re: char *name != (:pointer :char)

Luke J Crook <luke <at> balooga.com> writes:

> 
> I have a function that expects 'char *name' as a parameter. 
> The parser-generator converts this to (name (:pointer :char)).

I believe I found the correct answer at
lispworks.com/kb/f09ebf846e59ccec802568e80045a18d.html

(name (:reference (:ef-mb-string :limit 256)))

-Luke


Updated at: 2020-12-10 08:50 UTC