This site's content was compiled from 1993 to 2006. Beyond that, Google is your friend.
Pirmin Kalberer
A first draft of a portable class for external interfaces, written in the style of the Gobo kernel library. It should help to develop a portable GTK wrapper and to make swigeiffel portable.
The test program was successfully compiled with SmartEiffel and ISE Eiffel. It also compiles with Visual Eiffel (v2.96 Beta for Linux), but the string output in the C code is missing.
See the included readme.txt file for a discussion of interaction with the garbage collector.
Here is the short form of the included class:
class interface KL_EXTERNAL_ROUTINES
feature(s) from KL_EXTERNAL_ROUTINES
-- conversion of Eiffel to C types
any_to_pointer (arg: ANY): POINTER
string_to_pointer (arg: STRING): POINTER
-- A reference to a C form of string `arg'
-- Warning: Memory is shared between Eiffel and C
string_to_pointer_copy (arg: STRING): POINTER
-- Create a new C string copied from `arg'
-- Warning: Memory of C string is not collected by Eiffel GC
array_to_pointer (arg: ARRAY[ANY]): POINTER
string_array_to_pointer (arg: ARRAY[STRING]): POINTER
-- Convert an ARRAY of STRINGs to char **
feature(s) from KL_EXTERNAL_ROUTINES
-- conversion of C to Eiffel types
pointer_to_string (arg: POINTER): STRING
-- Warning: Memory is shared between Eiffel and C
pointer_to_string_copy (arg: POINTER): STRING
feature(s) from KL_EXTERNAL_ROUTINES
get_pointer (arg: POINTER): POINTER
-- Return `arg' as POINTER type
-- Example: ptr := get_pointer($print)
end of KL_EXTERNAL_ROUTINES