Lisp HUG Maillist Archive

newline in fli call

Hi list
I have a Mac framework and a Windows DLL which I pass a string including a #\Newline (character code 10) at the end. At the arrival in the framework the character code is 10, but in the DLL it arrives as character code 13.

What can I do to get rid of this unwanted character translation on Windows?

Here is the fli function I use:

(fli:define-foreign-function (my-string "my_string" :source)
    ((string (:reference-pass :ef-mb-string))
     (return-string (:reference-return (:ef-mb-string :limit 48))))
  :result-type :boolean
  :language :c
  :lambda-list (string &aux return-string)
  :calling-convention :cdecl)

I use LW6.
Regards,
Sven

Re: newline in fli call

Sven Emtell wrote:
> What can I do to get rid of this unwanted character translation on Windows?
> 
> Here is the fli function I use:
> 
> (fli:define-foreign-function (my-string "my_string" :source)
>     ((string (:reference-pass :ef-mb-string))
>      (return-string (:reference-return (:ef-mb-string :limit 48))))
>   :result-type :boolean
>   :language :c
>   :lambda-list (string &aux return-string)
>   :calling-convention :cdecl)

What about specifying the external format (and EOL style) in the foreign 
type specification?  E.G.,

(:reference-pass
   (:ef-mb-string
     :external-format (:utf-8 :eol-style :LF)))


Mike


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