FriBidiEnv (was: Re: [Fribidi-discuss] Starting to work on EPOC 6 port of FriBidi)

Behdad Esfahbod behdad at bamdad.org
Tue Jan 15 09:45:03 EST 2002


Ok, I will work on this when I have enough time.

And about the interface, to support interface version 2, we will have 
these (ignore the symbol names, just the idea, we should discuss 
about the new api names too):

in fribidi_compat.h:

extern FriBidiEnv fribidi_global_env;

#define fribidi_log2vis(a, b, c, d)	\
	new_fribidi_log2vis(&fribidi_global_env, a, b, c, d)
#define fribidi_set_mirroring(m)	\
	fribidi_set_flag(&fribidi_global_env, FRIBIDI_FLAG_MIRRORING)
...

and in fribidi_compat.c:

FriBidiEnv fribidi_global_env = { default values};

--------------

This way all the old api work, when one do not need the compatibility
(or needs no global var...), removes compat stuff through a configure
time option.

Yours,
behdad

On Sun, 6 Jan 2002, Omer Zak wrote:
[snip] 
> Okay, let's define the following structure:
> 
> struct FriBidiEnv {
>   FriBidiList* iUsedListItems;  // Pointer to linked list of used list
>                                 // items.
>   FriBidiList* iFreeListItems;  // Pointer to linked list of free list
>                                 // items.  Allocation requests are
>                                 // satisfied first from this list, then
>                                 // from regular malloc().
>   // The FriBidiList structure will either have an extra pointer for
>   // memory management support, or else we'll use existing pointers
>   // for this purpose.
>   // TO BE CHECKED:  if we allocate and free only one data structure
>   //                 or more than one different data structures.
>   //                 This affects handling the above lists.
>   FriBidiFlags iFlags;
>   // The flags will define:
>   // - Debug mode
>   // - Mirroring
>   // - L3 rule on/off
>   // - remove BiDi marks on/off
>   // - Arabic joining on/off
>   // - Ligaturing on/off
>   // They will be set and cleared by inlined access procedures.
> };
> 
> In addition, let's replace all malloc() and free() calls by
> fribidi_malloc() and fribidi_free() calls.  For now, they'll be #define'd
> to be the same as malloc() and free().  But next version we'll add the
> environment parameter.

-- 
Behdad
25 Dey 1380, 2002 Jan 15

[Finger for Geek Code]





More information about the FriBidi mailing list