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:
eiffel-org
2016-07-01 10:32:39 +00:00
parent 067d834eba
commit 10e39cfb40
68 changed files with 452 additions and 453 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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

View File

@@ -13,7 +13,7 @@ The sections concerning [[#macros|Macros]] and [[#structs|Structs]] are also a
You can encapsulate routines that are defined in a C header file. We will take some examples and will show you how to write wrappers in Eiffel.
If in a header file called `my_header.h', you have the following declaration:
If in a header file called `my_header.h`, you have the following declaration:
<code lang="c">
/* Routine with no parameter */
extern void no_param(void);
@@ -68,7 +68,7 @@ Here is the corresponding Eiffel code:
==Macros==
If in a header file called `my_header.h', you have the following declaration:
If in a header file called `my_header.h`, you have the following declaration:
<code lang="c">
/* Predefined constants */
#define ID_MENU 128
@@ -112,7 +112,7 @@ Then, the corresponding Eiffel code will look like:
The struct encapsulation enables you to wrap C/C++ structures easily without having to write any additional code in a C header file as it was the case until Eiffel Software introduced this new keyword in the external specification with the 4.5 release of the Eiffel Software environment. With the struct encapsulation you can set and retrieve the value of a certain field of a struct.
If in a header file called `my_header.h', you have the following declaration of the `Point' structure whose `x' and `y' fields we want to access and set:
If in a header file called `my_header.h`, you have the following declaration of the `Point` structure whose `x` and `y` fields we want to access and set:
<code lang="c">
@@ -167,7 +167,7 @@ With EiffelStudio you now have two different ways to call C routines exported in
* _cdecl: referred to as the standard way
* __stdcall referred to as the Pascal way
Therefore if you want to call an external routine defined in a DLL supposed to be called using the `_cdecl' method, you have to use the '''dll32''' sub-language option. For `__stdcall' you need to use the '''dllwin32''' sub-language option. Here is an example:
Therefore if you want to call an external routine defined in a DLL supposed to be called using the `_cdecl` method, you have to use the '''dll32''' sub-language option. For `__stdcall` you need to use the '''dllwin32''' sub-language option. Here is an example:
<code>
@@ -189,9 +189,9 @@ Therefore if you want to call an external routine defined in a DLL supposed to b
===Windows API===
As described in the previous section concerning routines exported in a DLL, the Windows API is using the `__stdcall' convention. As a consequence, you cannot use the standard external mechanism to wrap them because it is using the `_cdecl' convention. However, you can easily wrap those function by using the '''macro''' sub-language.
As described in the previous section concerning routines exported in a DLL, the Windows API is using the `__stdcall` convention. As a consequence, you cannot use the standard external mechanism to wrap them because it is using the `_cdecl` convention. However, you can easily wrap those function by using the '''macro''' sub-language.
Here is an example that has been taken from WEL, the Windows Eiffel Library, to encapsulate the Windows `SendMessage' function:
Here is an example that has been taken from WEL, the Windows Eiffel Library, to encapsulate the Windows `SendMessage` function:
Windows defined SendMessage as:

View File

@@ -26,7 +26,7 @@ In order to run properly you need to read [[Eiffel2Java|the library requirement]
===Compiling the example===
Since the example is using the `test.java' class, the first step is to compile the java class using the `javac' command line utility from the JDK. Once it is done, copy the `test.class' either into $ISE_EIFFEL\examples\Eiffel2Java\EIFGENs\classic\W_code or else into $ISE_EIFFEL\examples\Eiffel2Java\EIFGENs\classic\F_code, depending on your compilation mode (freezing vs. finalizing).
Since the example is using the `test.java` class, the first step is to compile the java class using the `javac` command line utility from the JDK. Once it is done, copy the `test.class` either into $ISE_EIFFEL\examples\Eiffel2Java\EIFGENs\classic\W_code or else into $ISE_EIFFEL\examples\Eiffel2Java\EIFGENs\classic\F_code, depending on your compilation mode (freezing vs. finalizing).
===Running the example===

View File

@@ -16,7 +16,7 @@ The Java interface allows you to call Java routines or attributes from your Eiff
* In this version, you can only use one JNI environment.
* Only one thread can interact with the Java Virtual Machine (JVM).
* It is not possible to call Eiffel features from Java program.
* The Eiffel feature `destroy_vm' of `JAVA_VM' calls a C function of the Java NativeInterface that is not fully implemented in jdk 1.1.8. This function, called DestroyJavaVM, always returns -1 in jdk 1.1.8. For further information, go on the JNI pages at the address above.
* The Eiffel feature `destroy_vm` of `JAVA_VM` calls a C function of the Java NativeInterface that is not fully implemented in jdk 1.1.8. This function, called DestroyJavaVM, always returns -1 in jdk 1.1.8. For further information, go on the JNI pages at the address above.
==Interface classes==