Author:admin

Date:2008-09-17T13:53:28.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@3 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
jfiat
2008-09-17 13:53:28 +00:00
parent 4fee9356ea
commit 2ee31ab9c7
763 changed files with 36576 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
[[Property:title|Definition file]]
[[Property:weight|2]]
The syntax is pretty simple when you understand what you need to export a feature: you need the name of the '''feature''', the name of the concerned '''class''', and the name of a '''creation procedure'''. What is optional is to specify an '''alias''', an '''index''' and a '''calling convention'''. The index and calling convention are mainly used to create a DLL for windows, and the alias to export the feature under a different name.
===Syntax===
{|
|-
| '''Export_feature'''
| Class_name [Creation_part] ":" Feature [Optional_part]
|-
| '''Creation_part'''
| "(" feature_name ")"
|-
| '''Optional_part'''
| [Index_part] [Alias_part]
|-
| '''Index_part'''
| "@" integer
|-
| '''Alias_part'''
| "Alias" alias_name
|-
| '''Call_type_part'''
| "call_type" call_type_name
|}
===Example===
<code>ROOT_CLASS (make): foo @ 4 Alias my_foo call_type __stdcall</code>
===Constraint===
<div>
* on the class: <div>The class cannot be deferred or generic.</div>
* on the feature: <div>It could be any feature except an attribute, an external feature or a deferred feature.</div>
* on the creation procedure: <div>It must have zero argument, and no return type.</div>
* on the alias name: <div>It must be a valid name for a C function.</div>
* on the index: <div>It must be strictly positive.</div>
* on the call type: <div>It must be a valid call type for the targeted platform (useful for Windows only). For Visual C++, the valid calling conventions are __stdcall, __cdecl and __fastcall.</div>
For each feature the required fields are the '''class''', the '''creation procedure''', and of course the '''feature''' itself.
* If the feature is a creation procedure then do not specify any creation, it will use the feature as creation. For example '''ROOT_CLASS: make'''.
* If the class has no creation procedure, do not specify any creation. default_create will be automatically used.
===A definition file===
<code>
-- EXPORTED FEATURE(s) OF THE SHARED LIBRARY
-- SYSTEM : demo
-- CLASS [BAR]
-- Here get_string uses make_b as creation
BAR (make_b) : get_string
-- Here print_bar uses make_a as creation
BAR (make_a) : print_bar
-- CLASS [ROOT_CLASS]
-- Here the feature is also a creation
ROOT_CLASS : make
ROOT_CLASS (make) : foo
ROOT_CLASS (make) : test_bar</code>
</div>

View File

@@ -0,0 +1,29 @@
[[Property:title|Dynamic library builder]]
[[Property:weight|1]]
In order to facilitate the creation of C dynamic libraries using EiffelStudio, a wizard helps generate the definition files used to define the contents of the shared library. If for some reason you need to override the wizard, the [[Definition file|syntactic rules]] of the definition files are available, but their knowledge is not necessary to use the generation of dynamic libraries in EiffelStudio.
The wizard is accessible in the '''Tools'''/ '''Dynamic library builder''' menu.
The dynamic library window that appears when selecting this menu is mainly composed of a list which contains all features that should be exported. This list is course empty at first.
[[Image:shared-library-window]]
{{note| '''Note''': The layout of this wizard is slightly different on Windows and on Unix systems, because the index and calling convention fields never appear on Unix systems. }}
To add a new feature to the definition file, you can either:
* Pick the feature from any place in EiffelStudio and drop it into the list. If several creation procedures exists in the container class, a dialog is popped up to give the choice between all possible creation procedures.
* Or, use the Add command [[Image:16x16--general-add-icon]] in the '''Edit'''/ '''Add''' menu. This pops up a dialog where it is possible to enter manually all parameters for the exported feature.
[[Image:new-exported-feature]]
Other commands of the '''Edit''' menu allow you to remove [[Image:16x16--general-delete-icon]] exported features or to modify their export parameters [[Image:16x16--general-edit-icon]] .
It is also possible to check the validity of the definition file. This command [[Image:view-unmodified-icon]] performs both a global check, to ensure that for example two features do not have the same name or same index in the library, and also local checks, that check for each feature that the parameters are valid.
Other commands, located in the '''File''' menu, give standard file operations, such as opening [[Image:general-open-icon]] a definition file, creating a new definition file [[Image:new-document-icon]] ,or saving the current definition file [[Image:16x16--general-save-icon]] .
{{tip| '''Tip''': Although the wizard can handle several files during the same EiffelStudio session, remember that only one file can be used in the project settings to effectively generate a shared library. }}

View File

@@ -0,0 +1,46 @@
[[Property:title|Dynamic library: Generated files]]
[[Property:weight|3]]
Basically, once the Eiffel definition file is created, the compiler will generate a set of files and will compile them to generate the Dynamic library into the ''EIFGENs/target_name/W_code'' or ''EIFGENs/target_name/F_code'' directory.
{{note| '''Note''': To generate and compile these files, you have to indicate the definition file that should be used in the [[Advanced Options|advanced node of the project settings]] of your system. This way EiffelStudio will know which one to use. If you do not specify any definition file, nothing will be generated. }}
The set of files is composed of:
<div>
* EIFGENs/target_name/W_code/'''system.def''' (or F_code)
* EIFGENs/target_name/W_code/'''edynlib.c''' (or F_code)
* $(ISE_EIFFEL)/studio/spec/$(ISE_PLATFORM)/templates/'''egc_dynlib.template''' <br/>
this file will be copied during the compilation into the EIFGENs/target_name/W_code/E1 directory as '''egc_dynlib.c'''
* $(ISE_EIFFEL)/studio/spec/$(ISE_PLATFORM)/include/'''egc_dynlib.h'''
* and the Makefile
</div>
The ''system.def'' is only used on windows, it is the definition file used to generate a DLL when linking.<br/>
Information about the DLL
<code>LIBRARY demo.dll
DESCRIPTION DEMO.DLL</code>
The following are EXPORTed functions.
<code>EXPORTS</code>
This part concerns the run-time. It initializes the run-time and reclaim Eiffel objects.
<code>
;System
init_rt
reclaim_rt
</code>
The exported for the BAR class:
<code>; CLASS [BAR]
get_string
print_bar
</code>
The exported for the ROOT_CLASS class:
<code>; CLASS [ROOT_CLASS]
make
foo
test_bar</code>
The ''edynlib.c'' file is the interface between the Eiffel system and the C code. It contains the declaration and the implementation of the function used to directly call the eiffel feature with its real name.
The <span> ''egc_dynlib.c'' </span> and <span> ''egc_dynlib.h'' </span> files are used for operations performed by the run-time.

View File

@@ -0,0 +1,10 @@
[[Property:title|Dynamic library generation]]
[[Property:weight|-12]]
* [[Dynamic library generation: Introduction|Introduction]]
* [[Dynamic library builder|Dynamic library builder]]
* [[Definition file|Definition file]]
* [[Dynamic library: Generated files|Generated files]]