[Fribidi-discuss] Starting to work on EPOC 6 port of FriBidi

Omer Zak omerz at actcom.co.il
Sat Jan 5 14:44:02 EST 2002


I started to work on the Symbian EPOC 6 port of FriBidi.
The following issues were encountered:

1. EPOC 6 uses C++.  It would be nicer if the header files bracket
   their stuff with:

        #ifdef __cplusplus
        extern "C" {
        #endif
          .
          .
          .
        #ifdef __cplusplus
        }
        #endif

2. There are problems in using static variables in EPOC 6.
   It would be easier if all top-level constants (tables, FriBidi help
   string, etc.) have 'const' in their declarations.

3. The static boolean mirroring = TRUE; is a NO-NO in EPOC 6, and would
   also prevent the FriBidi library from being reentrant (important in
   multi-tasking and multi-threading environments - if not in Unix based
   operating systems, at least in other operating systems).

4. While I didn't look closely into malloc/free calls, it would be nice
   to have a mechanism for handling memory allocation failure and
   guaranteeing cleanup in case of any interruption of execution of the
   FriBidi code.

Problems (3),(4) can be solved if the relevant functions receive another
parameter (yes, version 3 of the interface and another macro definition
for Nadav et. al.).  The parameter (inspired by the idea of the
implicit 'this' argument in C++ class methods) will be a void* pointer
(typedef'ed into FriBidiEnvironment).  It will point at an
implementation-defined data structure, which will hold the right value for
boolean mirroring (and other static variables, if any), and also pointers
for managing the dynamically allocated data structures.

The caller of fribidi procedures is responsible for allocating,
initializing and destroying (it must explicitly destroy, because this is
how memory gets freed) the FriBidiEnvironment data structure (by means of
functions provided by FriBidi).

I am willing to carry out the actual modifications, but I'd like first to
see if there are any objections to the above suggestions and to their
incorporation into plain vanilla FriBidi (rather than as a forked
version).
                                             --- Omer
WARNING TO SPAMMERS:  see at http://www.zak.co.il/spamwarning.html





More information about the FriBidi mailing list