[Fribidi-discuss] type of fribidi_iso8859_8_to_unicode changed in CVS

Behdad Esfahbod behdad at bamdad.org
Thu Jan 3 02:42:02 EST 2002


Thanks Omer and Dov, I'm doing this:
(Caution: you cannot use the flag in your .c files)

In fribidi_char_sets.h:

	#ifndef FRIBIDI_0_9_INTERFACE

	int fribidi_charset_to_unicode(... new interface ...);

	#else

	int fribidi_charset_to_unicode_old(... old interface ...);
	#define fribidi_charset_to_unicode fribidi_charset_to_unicode_old

	#endif /* FRIBIDI_0_9_INTERFACE */

and In fribidi_char_sets.c:

	int fribidi_charset_to_unicode(s, len, us) {
	...
	}

	int fribidi_charset_to_unicode_old(s, us) {
		return fribidi_charset_to_unicode(s, strlen(s), us);
	}

Also the hack should only support currently available charsets, no 
future charset will have _old version.

Yours,
behdad

On Tue, 1 Jan 2002, Omer Zak wrote:

> 
> On Tue, 1 Jan 2002, Behdad Esfahbod wrote:
> 
> >
> > Well, I will assume that for others it suffice too ;-), any idea about
> > the new namespace? I want to deprecate the old ones, and ask people to
> > use the new ones, but got no idea, fribidix_... (fribixi extended api,
> > as will be extended more in 0.10.1) seems good to me...
> 
> I don't like the fribidix_ prefix.  What if you'll need to change the
> interface from 1.* to 2.*?  Will we have to use fribidixx_ then?
> 
> I suggest to require people, who need the old interface, to define a macro
> (say FRIBIDI_0_9_0_INTERFACE_WANTED) before #include <fribidi.h>. The
> macro will cause all functions with incompatible interfaces to be
> redefined as macros, which eventually invoke functions with the new
> interfaces.
> 
> fribidi.h will include the following (for each function whose interface
> has changed):
> 
> #ifdef FRIBIDI_0_9_0_INTERFACE_WANTED
> void fribidi_old_func(a,b,c);
> #define fribidi_func(a,b,c) fribidi_old_func((a),(b),(c))
> #endif /* FRIBIDI_0_9_0_INTERFACE_WANTED */
> 
> fribidi.c will include the following:
> 
> #ifdef FRIBIDI_0_9_0_INTERFACE_WANTED
> #undef fribidi_func
> void fribidi_old_func(a,b,c)
> {
>   fribidi_func(a,strlen(a),b,c)
> }
> #endif /* FRIBIDI_0_9_0_INTERFACE_WANTED */
> void fribidi_func(a,len_a,b,c)
> {
>   ... actual code ...
> }
> 
> 
> DISCLAIMER:  I haven't actually tried to compile or run the above.
> 
>                                              --- Omer
> WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html
> 
> 
> _______________________________________________
> Fribidi-discuss mailing list
> Fribidi-discuss at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fribidi-discuss
> 

-- 
Behdad
13 Dey 1380, 2002 Jan 3

[Finger for Geek Code]





More information about the FriBidi mailing list