liberty-eiffel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Liberty-eiffel] Question about plugins


From: Cyril ADRIAN
Subject: Re: [Liberty-eiffel] Question about plugins
Date: Fri, 18 Dec 2015 20:38:35 +0100

I am not sure I understand correctly.

Variadic functions are not supported. You will have to pass the pointer and its size.

If you want to pass only the array, you will have to resort to the same kind of trick as STRING – which force-adds a NUL character at the end of the storage area.

Cheers,

Cyril

2015-12-18 19:27 GMT+01:00 Germán Arias <address@hidden>:
Thanks. Now I have a problem with a c function of the form:

cFucntion(arg1, arg2, arg3, ...., argN, NULL)

The problem is the NULL at the end. How add this? I'm using a
NATIVE_ARRAY for the arguments, but seems that this class don't add the
NULL at the end when use feature .to_external. Any advice?

Thanks
Germán

El jue, 17-12-2015 a las 18:30 +0100, Cyril ADRIAN escribió:
> Hi Germán,
>
>
> It is indeed the recommended way.
>
>
> Note: avoid modifying the char array because it is the raw STRING
> storage. The object would be inconsistent.
>
>
>
> Cheers,
>
>
> Cyril
>
>
>
> 2015-12-17 8:04 GMT+01:00 Germán Arias <address@hidden>:
>         Hi all,
>
>         I need call a c function with char arguments. So I need
>         convert STRING
>         object into chars. To do this I'm using two features, like
>         these:
>
>         feature {}
>            message (title: STRING; text: STRING)
>               do
>                 int_message (title.to_external, text.to_external)
>               end
>
>            int_message (title: POINTER; text: POINTER)
>               external "plug_in"
>               alias "{
>                  location: "."
>                  module_name: "my_plugin"
>                  feature_name: "c_function"
>                  }"
>               end
>         end
>
>         My question is: Is this the appropriate way? Or there is a
>         more
>         easy/recommended way?
>
>         Thanks
>         Germán
>
>
>
>
>
>
> --
> Cyril ADRIAN
>





--
Cyril ADRIAN

reply via email to

[Prev in Thread] Current Thread [Next in Thread]