|
From: | Paolo Redælli |
Subject: | Re: Intro for newbie |
Date: | Tue, 12 May 2020 15:59:41 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Hello.I'd want to meet eiffel. One person takes me one project on Eiffel and I trying build this one. I am absolutely newbie in Eiffel but have some skills in general (C, python, VHDL ).Lot of programmers liten about eiffel, but nobody who tryied to use it. First my question - how to use external C prorams?
There are two separate mechanics to interface with another
language such as C.
The first one belongs to another era, predating the creation of
Java, when Windows was at release 3.11 or something like this. It
is the external "C" or external "C++". It is detailed in the
standard but it is quite limited, to the point that Andreas
Leitner many years ago built an entire pre-processor program to
deal with it.
You can read about them at https://wiki.liberty-eiffel.org/index.php/Externals
where you see that we propose a "plug-in" approach, detailed
in https://wiki.liberty-eiffel.org/index.php/Plugins
You write something likeFor example - I have some interface like void generate(char* ); and what should I do next?
feature {} -- Implementation generate (a_char: POINTER) external "C the_header_where_generate_is_declared.h" end feature -- public interface my_generate (a_string: ABSTRACT_STRING) do generate(a_string.to_external) end
or you use my wrappers_generator tool. :)
I see how I left fading my tools reading its README which refers
to Ubuntu **ten**
wrappers_generator read the output of castxml which produces an xml description of C/C++ code. This way we can automatically generate low-level wrappers which we use to write high-level interface to external libraries.
You place a libs file in the directory of the plugin.How to say where placed C-sources, headers and other classes on my filesystem?
I have read about c_include_c and c_include_h but it isn't clean for me. Can you explain me litle bit more?
I would suggest to avoid it. Try reading https://github.com/LibertyEiffel/Liberty/tree/master/src/wrappers/readline
it's short enough to be understandable but it is fully usable.
It uses wrappers_generator
[Prev in Thread] | Current Thread | [Next in Thread] |