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

Behdad Esfahbod behdad at bamdad.org
Tue Jan 22 06:21:22 EST 2002


On Sat, 19 Jan 2002, Omer Zak wrote:
> Hello Behdad,
> Okay.
> 
> 1. I suggest that any function, which needs the FriBidiEnv, first validate
>    it by a macro call:
> 
>    FriBidiResult fribidi_do_something(FriBidiEnv *env, s, s_len,...)
>    {
>      VALIDATE_FRIBIDIENV(env);
>      do_other_stuff("TM");
>      return((FriBidiResult) "Great FriBidiResult (TM)");
>    }

And what FriBidiResult is going to be? currently most of them return 
booleans, also we can have a status flag and error message in 
FriBidiEnv type...

>    The VALIDATE_FRIBIDIENV(env) macro will be defined by a configuration
>    option and it can be one of the following (other variations are welcome):
> 
>    1. #define VALIDATE_FRIBIDIENV(env) \
>            if (env == NULL) env = &fribidi_global_env
>    2. #define VALIDATE_FRIBIDIENV(env)  if (env == NULL) Panic()
>                /* (for environments, which disallow global variables). */
>    3. #define VALIDATE_FRIBIDIENV(env)
>                /* Null definition, for environments, which guarantee valid
>                ** environments, and need the efficiency.
>                */

Good Idea.

> 2. About API names - for now, I assume that not too many projects are
>    bound to the interface used by version 0.10.0, so let's use the same
>    flag for the interface with implicit strlen()'s and for NULL
>    FriBidiEnvs.

But I like explicit strlens more ;).  I should think more about the 
charset converters...

> 3. From what I saw in FriBidi code, it needs to malloc and free memory
>    chunks of various sizes.  How can this be managed?

Would you please explain more.

>                                              --- Omer

-- 
Behdad
2 Bahman 1380, 2002 Jan 22

[Finger for Geek Code]





More information about the FriBidi mailing list