From 8bc4b0a145e828a6c9e90d18e4f06900291d1d3a Mon Sep 17 00:00:00 2001 From: behdad Date: Wed, 12 May 2004 08:17:19 +0000 Subject: [PATCH] Better handling with Unicode info. --- gen.tab/gen-bidi-type-tab.c | 13 +++++-------- lib/.cvsignore | 2 +- lib/Makefile.am | 4 ++-- lib/common.h | 7 ++++--- lib/fribidi-bidi-type.c | 24 +++++++++--------------- lib/fribidi-common.h | 10 +++------- lib/fribidi-unicode.h | 11 ++++++++--- 7 files changed, 32 insertions(+), 39 deletions(-) diff --git a/gen.tab/gen-bidi-type-tab.c b/gen.tab/gen-bidi-type-tab.c index 7d341dd..5ab0eb2 100644 --- a/gen.tab/gen-bidi-type-tab.c +++ b/gen.tab/gen-bidi-type-tab.c @@ -1,10 +1,10 @@ /* FriBidi * gen-bidi-type-tab.c - generate bidi-type.tab.i for libfribidi * - * $Id: gen-bidi-type-tab.c,v 1.2 2004-05-12 07:06:21 behdad Exp $ + * $Id: gen-bidi-type-tab.c,v 1.3 2004-05-12 08:17:19 behdad Exp $ * $Author: behdad $ - * $Date: 2004-05-12 07:06:21 $ - * $Revision: 1.2 $ + * $Date: 2004-05-12 08:17:19 $ + * $Revision: 1.3 $ * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/gen.tab/gen-bidi-type-tab.c,v $ * * Author: @@ -124,7 +124,6 @@ get_type ( #define table_name "FriBidiCharTypeData" #define macro_name "FRIBIDI_GET_BIDI_TYPE" -#define default_type "LTR" static int table[FRIBIDI_UNICODE_CHARS]; @@ -134,8 +133,6 @@ init_tab ( { register int i; register FriBidiChar c; - char deftype = get_type (default_type), - RTL = get_type ("RTL"), AL = get_type ("AL"); for (i = 0; i < type_names_count; i++) names[i] = 0; @@ -144,7 +141,7 @@ init_tab ( /* initialize table */ for (c = 0; c < FRIBIDI_UNICODE_CHARS; c++) - table[i] = deftype; + table[i] = LTR; for (c = 0x0590; c < 0x0600; c++) table[i] = RTL; for (c = 0xFB1D; c < 0xFB50; c++) @@ -225,7 +222,7 @@ gen_bidi_type_tab ( if (!pack_table (table, FRIBIDI_UNICODE_CHARS, 1, max_depth, 3, names, - "char", table_name, macro_name, stdout)) + "unsigned char", table_name, macro_name, stdout)) die ("error: insufficient memory, decrease max_depth"); printf ("/* End of generated " outputname " */\n"); diff --git a/lib/.cvsignore b/lib/.cvsignore index ad8f2a9..e357258 100644 --- a/lib/.cvsignore +++ b/lib/.cvsignore @@ -1,3 +1,3 @@ *.i -fribidi-config.h fribidi-unicode-version.h +fribidi-config.h diff --git a/lib/Makefile.am b/lib/Makefile.am index 3c2ad13..cfb4f89 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -50,8 +50,8 @@ libfribidi_la_SOURCES = \ BUILT_SOURCES= \ bidi-type.tab.i \ mirroring.tab.i \ - fribidi-config.h \ - fribidi-unicode-version.h + fribidi-unicode-version.h \ + fribidi-config.h MAINTAINERCLEANFILES = $(BUILT_SOURCES) diff --git a/lib/common.h b/lib/common.h index 4fab82b..ba3dc17 100644 --- a/lib/common.h +++ b/lib/common.h @@ -1,10 +1,10 @@ /* FriBidi * common.h - common include for library sources * - * $Id: common.h,v 1.7 2004-05-12 07:06:21 behdad Exp $ + * $Id: common.h,v 1.8 2004-05-12 08:17:19 behdad Exp $ * $Author: behdad $ - * $Date: 2004-05-12 07:06:21 $ - * $Revision: 1.7 $ + * $Date: 2004-05-12 08:17:19 $ + * $Revision: 1.8 $ * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/common.h,v $ * * Author: @@ -149,6 +149,7 @@ # define FRIBIDI_EMPTY_STMT FRIBIDI_BEGIN_STMT (void) 0; FRIBIDI_END_STMT #endif /* !FRIBIDI_EMPTY_STMT */ + #include "debug.h" #endif /* !_COMMON_H */ diff --git a/lib/fribidi-bidi-type.c b/lib/fribidi-bidi-type.c index b63331f..ef8e8b3 100644 --- a/lib/fribidi-bidi-type.c +++ b/lib/fribidi-bidi-type.c @@ -1,10 +1,10 @@ /* FriBidi * fribidi-bidi-type.c - get character bidi type * - * $Id: fribidi-bidi-type.c,v 1.5 2004-05-12 07:06:21 behdad Exp $ + * $Id: fribidi-bidi-type.c,v 1.6 2004-05-12 08:17:19 behdad Exp $ * $Author: behdad $ - * $Date: 2004-05-12 07:06:21 $ - * $Revision: 1.5 $ + * $Date: 2004-05-12 08:17:19 $ + * $Revision: 1.6 $ * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-bidi-type.c,v $ * * Authors: @@ -34,17 +34,11 @@ #include "common.h" #include +#include #include "bidi-types.h" -/* - * Define character types that char_type_tables use. - * define them to be 0, 1, 2, ... and then in fribidi_get_type.c map them - * to FriBidiCharTypes. - */ -typedef unsigned char FriBidiPropCharType; - -enum FriBidiPropEnum +enum FriBidiCharTypeLinearEnum { # define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, # include "bidi-types-list.h" @@ -54,8 +48,8 @@ enum FriBidiPropEnum #include "bidi-type.tab.i" -/* Map fribidi_prop_types to fribidi_types. */ -static const FriBidiCharType prop_to_type[] = { +/* Map FriBidiCharTypeLinearEnum to FriBidiCharType. */ +static const FriBidiCharType linear_enum_to_char_type[] = { # define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE, # include "bidi-types-list.h" # undef _FRIBIDI_ADD_TYPE @@ -67,8 +61,8 @@ get_bidi_type ( FriBidiChar uch ) { - if (uch < 0x110000) - return prop_to_type[FRIBIDI_GET_BIDI_TYPE (uch)]; + if (uch < FRIBIDI_UNICODE_CHARS) + return linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (uch)]; else return FRIBIDI_TYPE_LTR; /* Non-Unicode chars */ diff --git a/lib/fribidi-common.h b/lib/fribidi-common.h index 26b2eac..bf81079 100644 --- a/lib/fribidi-common.h +++ b/lib/fribidi-common.h @@ -1,10 +1,10 @@ /* FriBidi * fribidi-common.h - common include for library headers * - * $Id: fribidi-common.h,v 1.4 2004-05-07 06:30:38 behdad Exp $ + * $Id: fribidi-common.h,v 1.5 2004-05-12 08:17:19 behdad Exp $ * $Author: behdad $ - * $Date: 2004-05-07 06:30:38 $ - * $Revision: 1.4 $ + * $Date: 2004-05-12 08:17:19 $ + * $Revision: 1.5 $ * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-common.h,v $ * * Author: @@ -100,10 +100,6 @@ /* An string containing the version information of the library. */ extern const char *fribidi_version_info; -#define fribidi_unicode_version FRIBIDI_NAMESPACE(unicode_version) -/* An string containing the version the Unicode standard implemented. */ -extern const char *fribidi_unicode_version; - #endif /* !_FRIBIDI_COMMON_H */ /* Editor directions: * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent diff --git a/lib/fribidi-unicode.h b/lib/fribidi-unicode.h index 1eb8c20..2a497ee 100644 --- a/lib/fribidi-unicode.h +++ b/lib/fribidi-unicode.h @@ -1,10 +1,10 @@ /* FriBidi * fribidi-unicode.h - general Unicode definitions * - * $Id: fribidi-unicode.h,v 1.2 2004-05-07 06:30:38 behdad Exp $ + * $Id: fribidi-unicode.h,v 1.3 2004-05-12 08:17:19 behdad Exp $ * $Author: behdad $ - * $Date: 2004-05-07 06:30:38 $ - * $Revision: 1.2 $ + * $Date: 2004-05-12 08:17:19 $ + * $Revision: 1.3 $ * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-unicode.h,v $ * * Author: @@ -41,6 +41,7 @@ /* We do not support surrogates yet */ #define FRIBIDI_UNICODE_CHARS (sizeof(FriBidiChar) >= 4 ? 0x110000 : 0xFFFE) + /* Unicode version - FRIBIDI_UNICODE_VERSION */ #if !DONT_HAVE_FRIBIDI_UNICODE_VERSION_H # include "fribidi-unicode-version.h" @@ -48,6 +49,10 @@ # define FRIBIDI_UNICODE_VERSION "unknown" #endif /* DONT_HAVE_FRIBIDI_UNICODE_VERSION_H */ +#define fribidi_unicode_version FRIBIDI_NAMESPACE(unicode_version) +/* An string containing the version the Unicode standard implemented, + * in the form of "x.y.z", or "unknown". */ +extern const char *fribidi_unicode_version; /* The Unicode Bidirectional Algorithm constants */ -- 2.40.0