mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 07:12:25 +01:00
Replace occurrences of ..' by ..` (backtick+text+quote replaced by backtick+text+backtick).
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1597 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -16,7 +16,7 @@ Generally, you should use these types when implementing external C functions bou
|
||||
|
||||
{{note|In the following code samples, the class <eiffel>OBJECT</eiffel> is a placeholder for one of your type that you wish to use via CECIL.}}
|
||||
|
||||
{{sample|Calling C external `foo' from Eiffel, which takes a pointer and an eiffel object of type OBJECT as arguments and returns an INTEGER. }}
|
||||
{{sample|Calling C external `foo` from Eiffel, which takes a pointer and an eiffel object of type OBJECT as arguments and returns an INTEGER. }}
|
||||
<div>
|
||||
<code>
|
||||
c_foo (ptr: POINTER; obj: OBJECT): INTEGER
|
||||
@@ -28,7 +28,7 @@ Generally, you should use these types when implementing external C functions bou
|
||||
</code>
|
||||
|
||||
|
||||
In the C side, The C function `foo' is defined as follow:
|
||||
In the C side, The C function `foo` is defined as follow:
|
||||
|
||||
<code lang="c">
|
||||
EIF_INTEGER foo (EIF_POINTER ptr, EIF_OBJECT obj)
|
||||
@@ -121,7 +121,7 @@ EIF_INTEGER foo (EIF_POINTER ptr, EIF_OBJECT obj);
|
||||
|
||||
'''Important rules when using eif_access:'''
|
||||
|
||||
{{note|The first argument of ''(ep)'' is the target of the function (the eiffel object to which you want to apply the Eiffel feature ''(ep)'') and the second argument corresponds to the first argument of ` ''print'''. Any Eiffel object could have been the 1st argument of ''(ep)'' since all of them inherit ''ANY''. }}
|
||||
{{note|The first argument of ''(ep)'' is the target of the function (the eiffel object to which you want to apply the Eiffel feature ''(ep)'') and the second argument corresponds to the first argument of `print`. Any Eiffel object could have been the 1st argument of ''(ep)'' since all of them inherit ''ANY''. }}
|
||||
|
||||
|
||||
* '''Never pre compute the value returned by eif_access. ''' <br/>
|
||||
@@ -148,7 +148,7 @@ because e_ref is the direct reference to the Eiffel object when calling ''eif_ac
|
||||
* which corresponds to the C string passed as its argument.
|
||||
*/
|
||||
</code>
|
||||
Nothing guarantees that the direct reference returned by `eif_access (a)' will be still valid when executing (ep): it may be obsolete after the Eiffel call eif_string ("Hello world"), which may invoke a collection cycle.
|
||||
Nothing guarantees that the direct reference returned by `eif_access (a)` will be still valid when executing (ep): it may be obsolete after the Eiffel call eif_string ("Hello world"), which may invoke a collection cycle.
|
||||
|
||||
The correct code is
|
||||
|
||||
@@ -160,7 +160,7 @@ my_string = eif_string ("Hello world");
|
||||
</code>
|
||||
|
||||
|
||||
In this case, you do not need to protect `my_string' since the GC is not likely to be triggered after the call to ''eif_string'' and before `my_string' is given as argument in ''(ep). '' A collection is triggered only during Eiffel calls. If an Eiffel call had been performed, you would have had to use ''eif_protect'' (see paragraph 3. 2):
|
||||
In this case, you do not need to protect `my_string` since the GC is not likely to be triggered after the call to ''eif_string'' and before `my_string` is given as argument in ''(ep). '' A collection is triggered only during Eiffel calls. If an Eiffel call had been performed, you would have had to use ''eif_protect'' (see paragraph 3. 2):
|
||||
|
||||
<code lang="c">
|
||||
EIF_REFERENCE my_string;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[[Property:uuid|ed699d37-f480-0cef-817f-9f4a857c1691]]
|
||||
==cecil-test==
|
||||
|
||||
After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.
|
||||
After you have done the appropriate steps to compile the example, you will get a `cecil.exe` on windows, or `cecil` on Unix.
|
||||
|
||||
This example performs some basic tests of CECIL from C to Eiffel and Eiffel to C. You can:
|
||||
* choose to raise an exception when a routine is not visible
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
[[Property:weight|0]]
|
||||
[[Property:uuid|c3b64ef2-28b2-920e-44fb-4cff2320c099]]
|
||||
==array==
|
||||
This example shows how to create an Eiffel array from an existing C array. After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix. Launch the program and you will be prompted for 10 integers that will be inserted in a C array, it will then initialize the Eiffel array and calls display from the MY_ARRAY class. A typical output will be:
|
||||
This example shows how to create an Eiffel array from an existing C array. After you have done the appropriate steps to compile the example, you will get a `cecil.exe` on windows, or `cecil` on Unix. Launch the program and you will be prompted for 10 integers that will be inserted in a C array, it will then initialize the Eiffel array and calls display from the MY_ARRAY class. A typical output will be:
|
||||
<code>
|
||||
$ ./cecil
|
||||
Enter 10 integers:
|
||||
@@ -31,7 +31,7 @@ Display an Eiffel Array:
|
||||
</code>
|
||||
|
||||
==string==
|
||||
This example shows how to create an Eiffel string from an existing C string. After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix. Launch the program and you will be prompted for a string, it will then initialize the Eiffel string and calls io. put_string from the STD_FILES class. A typical output will be:
|
||||
This example shows how to create an Eiffel string from an existing C string. After you have done the appropriate steps to compile the example, you will get a `cecil.exe` on windows, or `cecil` on Unix. Launch the program and you will be prompted for a string, it will then initialize the Eiffel string and calls io. put_string from the STD_FILES class. A typical output will be:
|
||||
<code>
|
||||
$ ./cecil
|
||||
Enter a string to convert in Eiffel string:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This example shows how to create a C array from an existing Eiffel array.
|
||||
|
||||
After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.
|
||||
After you have done the appropriate steps to compile the example, you will get a `cecil.exe` on windows, or `cecil` on Unix.
|
||||
|
||||
Launch the program and you will be prompted for 10 integers that will be inserted in an Eiffel array, it will then initialize the C array and display it.
|
||||
|
||||
@@ -39,7 +39,7 @@ Displaying from C
|
||||
</code>
|
||||
|
||||
==object==
|
||||
This example shows the Eiffel memory management and all issues when passing an Eiffel object reference to C. In the example, you can edit the file `root_class.e' to modify the example:
|
||||
This example shows the Eiffel memory management and all issues when passing an Eiffel object reference to C. In the example, you can edit the file `root_class.e` to modify the example:
|
||||
<code>
|
||||
--give_to_c (o1)
|
||||
give_to_c_by_pointer ($o1) -- Choose the way you pass it
|
||||
@@ -81,7 +81,7 @@ An Eiffel object of type OBJECT is collected
|
||||
</code>
|
||||
|
||||
==string==
|
||||
This example shows how to create a C string from an existing Eiffel string. After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix. Launch the program and you will be prompted for a string from Eiffel and a C string will be created and display. A typical output will be:
|
||||
This example shows how to create a C string from an existing Eiffel string. After you have done the appropriate steps to compile the example, you will get a `cecil.exe` on windows, or `cecil` on Unix. Launch the program and you will be prompted for a string from Eiffel and a C string will be created and display. A typical output will be:
|
||||
<code>
|
||||
$ cecil
|
||||
Enter a string to convert into a C string:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[[Property:uuid|44f2ee31-8634-6e54-f45a-8b36f780f888]]
|
||||
==bank_account==
|
||||
|
||||
After you have done the appropriate steps to compile the example, you will get a `bank_account.exe' on windows, or `bank_account' on Unix.
|
||||
After you have done the appropriate steps to compile the example, you will get a `bank_account.exe` on windows, or `bank_account` on Unix.
|
||||
|
||||
This program launches two types of threads:
|
||||
* the spenders withdraw some money from a shared bank account
|
||||
|
||||
Reference in New Issue
Block a user