[FriBidi-commit] fribidi/lib Makefile.am, 1.4, 1.5 bidi-types-list.h, 1.3, 1.4 bidi-types.h, 1.3, 1.4 common.h, 1.5, 1.6 debug.h, 1.3, 1.4 fribidi-bidi-type.c, 1.3, 1.4 fribidi-bidi.c, 1.5, 1.6 fribidi-common.h, 1.3, 1.4 fribidi-mem.c, 1.4, 1.5 fribidi-mirroring.c, 1.4, 1.5 fribidi-types.h, 1.3, 1.4 fribidi-unicode.h, 1.1.1.1, 1.2 fribidi.c, 1.3, 1.4 mem.h, 1.4, 1.5 bidi-type-table.i, 1.2, NONE mirroring-table.i, 1.2, NONE

Behdad Esfahbod behdad at pdx.freedesktop.org
Thu May 6 23:30:40 PDT 2004


Update of /cvs/fribidi/fribidi/lib
In directory pdx:/tmp/cvs-serv21069/lib

Modified Files:
	Makefile.am bidi-types-list.h bidi-types.h common.h debug.h 
	fribidi-bidi-type.c fribidi-bidi.c fribidi-common.h 
	fribidi-mem.c fribidi-mirroring.c fribidi-types.h 
	fribidi-unicode.h fribidi.c mem.h 
Removed Files:
	bidi-type-table.i mirroring-table.i 
Log Message:
Cleaning here and there.  We may be ready for a release tonight :).


Index: Makefile.am
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/Makefile.am	3 May 2004 22:05:19 -0000	1.4
+++ b/Makefile.am	7 May 2004 06:30:38 -0000	1.5
@@ -31,7 +31,7 @@
 libfribidi_la_SOURCES =	\
 		bidi-types.h \
 		bidi-types-list.h \
-		bidi-type-table.i \
+		bidi-type.tab.i \
 		common.h \
 		debug.h \
 		env.h \
@@ -44,12 +44,12 @@
 		fribidi-mirroring.c \
 		fribidi-run.c \
 		mem.h \
-		mirroring-table.i \
+		mirroring.tab.i \
 		run.h
 
 BUILT_SOURCES= \
-		bidi-type-table.i \
-		mirroring-table.i \
+		bidi-type.tab.i \
+		mirroring.tab.i \
 		fribidi-config.h \
 		fribidi-unicode-version.h
 

Index: bidi-types-list.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/bidi-types-list.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/bidi-types-list.h	3 May 2004 22:05:19 -0000	1.3
+++ b/bidi-types-list.h	7 May 2004 06:30:38 -0000	1.4
@@ -33,6 +33,9 @@
  */
 /* *INDENT-OFF* */
 #endif /* !__C2MAN__ */
+#ifndef _FRIBIDI_ADD_TYPE
+# define _FRIBIDI_ADD_TYPE(x,y)
+#endif
 
 /* Bidi types from the standard. */
 _FRIBIDI_ADD_TYPE (LTR, 'L')	/* Left-To-Right letter */
@@ -55,6 +58,7 @@
 _FRIBIDI_ADD_TYPE (RLO, '+')	/* Right-to-Left Override */
 _FRIBIDI_ADD_TYPE (PDF, '-')	/* Pop Directional Flag */
 
+#ifdef _FRIBIDI_PSEUDO_TYPES
 /* The following two types are not official Unicode bidi types, but used for
  * paragraph direction handling only. */
 _FRIBIDI_ADD_TYPE (WLTR, 'l')	/* Weak Left to right */
@@ -62,6 +66,7 @@
 
 /* The following type is used internally only. */
 _FRIBIDI_ADD_TYPE (SENTINEL, '$')	/* Start Of Text */
+#endif /* _FRIBIDI_PSEUDO_TYPES */
 
 #ifndef __C2MAN__
 /* *INDENT-ON* */

Index: bidi-types.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/bidi-types.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/bidi-types.h	3 May 2004 22:05:19 -0000	1.3
+++ b/bidi-types.h	7 May 2004 06:30:38 -0000	1.4
@@ -43,25 +43,6 @@
 #define FRIBIDI_LEVEL_INVALID FRIBIDI_BIDI_MAX_RESOLVED_LEVELS
 #define FRIBIDI_SENTINEL -1
 
-/*
- * 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 char FriBidiPropCharType;
-
-enum FriBidiPropEnum
-{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_PROP_TYPE_##TYPE,
-# include "bidi-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
-  _FRIBIDI_PROP_TYPES_COUNT
-};
-
-#define fribidi_prop_to_type_ FRIBIDI_NAMESPACE(prop_to_type_)
-/* Maps fribidi_prop_types to fribidi_types */
-extern const FriBidiCharType fribidi_prop_to_type_[];
-
 #if DEBUG
 
 #define fribidi_char_from_bidi_type FRIBIDI_PRIVATESPACE(char_from_bidi_type)

Index: common.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/common.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- a/common.h	3 May 2004 22:05:19 -0000	1.5
+++ b/common.h	7 May 2004 06:30:38 -0000	1.6
@@ -137,8 +137,8 @@
 /* LIKEYLY and UNLIKELY are used to give a hint on branch prediction to the
  * compiler. */
 #ifndef LIKELY
-# define LIKELY(expr) (expr)
-# define UNLIKELY(expr) (expr)
+# define LIKELY
+# define UNLIKELY
 #endif /* !LIKELY */
 
 #ifndef FRIBIDI_EMPTY_STMT

Index: debug.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/debug.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/debug.h	3 May 2004 22:05:19 -0000	1.3
+++ b/debug.h	7 May 2004 06:30:38 -0000	1.4
@@ -78,6 +78,7 @@
 #endif /* !MSG */
 
 #ifndef DBG
+# include <fribidi-env.h>
 # define DBG(s) \
 	FRIBIDI_BEGIN_STMT \
 	if (fribidi_debug_status()) MSG(FRIBIDI ": " s "\n"); \

Index: fribidi-bidi-type.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi-type.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/fribidi-bidi-type.c	3 May 2004 22:05:19 -0000	1.3
+++ b/fribidi-bidi-type.c	7 May 2004 06:30:38 -0000	1.4
@@ -36,7 +36,43 @@
 #include <fribidi-bidi-type.h>
 
 #include "bidi-types.h"
-#include "bidi-type-table.i"
+
+/*
+ * 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
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE,
+# include "bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+  NUM_TYPES
+};
+
+#include "bidi-type.tab.i"
+
+/* Map fribidi_prop_types to fribidi_types. */
+static const FriBidiCharType prop_to_type[] = {
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE,
+# include "bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+};
+
+static inline FriBidiCharType
+get_bidi_type (
+  /* input */
+  FriBidiChar uch
+)
+{
+  if (uch < 0x110000)
+    return prop_to_type[FRIBIDI_GET_TYPE (uch)];
+  else
+    return FRIBIDI_TYPE_LTR;
+  /* Non-Unicode chars */
+}
 
 FRIBIDI_ENTRY FriBidiCharType
 fribidi_get_bidi_type (
@@ -56,17 +92,6 @@
   return fribidi_get_bidi_type (ch);
 }
 
-/* The following is only defined for binary compatibility */
-#define fribidi_get_type_internal FRIBIDI_NAMESPACE(get_type_internal)
-FriBidiCharType
-fribidi_get_type_internal (
-  /* input */
-  FriBidiChar ch
-)
-{
-  return get_bidi_type (ch);
-}
-
 FRIBIDI_ENTRY void
 fribidi_get_bidi_types (
   /* input */
@@ -92,9 +117,3 @@
   fribidi_get_bidi_types (str, len, type);
 }
 
-/* Map fribidi_prop_types to fribidi_types. */
-const FriBidiCharType fribidi_prop_to_type_[] = {
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE,
-# include "bidi-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
-};

Index: fribidi-bidi.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- a/fribidi-bidi.c	3 May 2004 22:05:19 -0000	1.5
+++ b/fribidi-bidi.c	7 May 2004 06:30:38 -0000	1.6
@@ -429,8 +429,6 @@
       FriBidiCharType this_type = RL_TYPE (pp);
       if (FRIBIDI_IS_EXPLICIT_OR_BN (this_type))
 	{
-	  register FriBidiLevel level_before = level;
-
 	  if (FRIBIDI_IS_STRONG (this_type))
 	    {			/* LRE, RLE, LRO, RLO */
 	      /* 1. Explicit Embeddings */

Index: fribidi-common.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-common.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/fribidi-common.h	3 May 2004 22:05:19 -0000	1.3
+++ b/fribidi-common.h	7 May 2004 06:30:38 -0000	1.4
@@ -72,7 +72,7 @@
 # endif	/* !__cplusplus */
 #endif /* !FRIBIDI_BEGIN_DECLS */
 
-#ifdef FRIBIDI_USE_GLIB
+#if FRIBIDI_USE_GLIB
 # ifndef __C2MAN__
 #  include <glib/gmacros.h>
 # define FRIBIDI_GNUC_CONST		G_GNUC_CONST
@@ -100,6 +100,10 @@
 /* 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

Index: fribidi-mem.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-mem.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/fribidi-mem.c	3 May 2004 22:05:19 -0000	1.4
+++ b/fribidi-mem.c	7 May 2004 06:30:38 -0000	1.5
@@ -86,10 +86,11 @@
       if LIKELY
 	(chunk)
 	{
-	  (void *) chunk = (void *) mem_chunk->chunk + emptysize - area_size;
-	  (char *) chunk += sizeof (void *);
+	  if (mem_chunk->chunk)
+	    * (void **) chunk = (char *) mem_chunk->chunk + mem_chunk->empty_size - mem_chunk->area_size;
+	  chunk = (char *) chunk + mem_chunk->atom_size;
 	  mem_chunk->chunk = chunk;
-	  mem_chunk->empty_size = mem_chunk->area_size - sizeof (void *);
+	  mem_chunk->empty_size = mem_chunk->area_size - mem_chunk->atom_size;
 	}
       else
 	return NULL;
@@ -97,8 +98,7 @@
 
   {
     register void *m = mem_chunk->chunk;
-    mem_chunk->chunk = (void *)
-      ((char *) mem_chunk->chunk + mem_chunk->atom_size);
+    mem_chunk->chunk = (char *) mem_chunk->chunk + mem_chunk->atom_size;
     mem_chunk->empty_size -= mem_chunk->atom_size;
 
     return m;
@@ -115,12 +115,12 @@
 
   fribidi_assert (mem_chunk);
 
-  chunk = mem_chunk->chunk + emptysize - areasize;
+  chunk = (char *) mem_chunk->chunk + mem_chunk->empty_size - mem_chunk->area_size;
   while LIKELY
     (chunk)
     {
       register void *tofree = chunk;
-      chunk = *(void *) chunk;
+      chunk = *(void **) chunk;
       fribidi_free (tofree);
     }
   fribidi_free (mem_chunk);

Index: fribidi-mirroring.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-mirroring.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/fribidi-mirroring.c	3 May 2004 22:05:19 -0000	1.4
+++ b/fribidi-mirroring.c	7 May 2004 06:30:38 -0000	1.5
@@ -37,7 +37,12 @@
 
 #include <fribidi-mirroring.h>
 
-#include "mirroring-table.i"
+struct _FriBidiMirroredPair
+{
+  FriBidiChar ch, mirrored_ch;
+};
+
+#include "mirroring.tab.i"
 
 FRIBIDI_ENTRY fribidi_boolean
 fribidi_get_mirror_char (

Index: fribidi-types.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-types.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/fribidi-types.h	3 May 2004 22:05:19 -0000	1.3
+++ b/fribidi-types.h	7 May 2004 06:30:38 -0000	1.4
@@ -69,6 +69,9 @@
 #  endif /* !HAVE_STDINT_H */
 # endif	/* !HAVE_INTTYPES_H */
 # if HAVE_STDBOOL_H
+#  ifndef __C2MAN__
+#   include <stdbool.h>
+#  endif /* !__C2MAN__ */
 #  define FRIBIDI_BOOLEAN_LOCAL		bool
 # else /* !HAVE_STDBOOL_H */
 #  define FRIBIDI_BOOLEAN_LOCAL		int

Index: fribidi-unicode.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-unicode.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/fribidi-unicode.h	25 Apr 2004 18:47:57 -0000	1.1.1.1
+++ b/fribidi-unicode.h	7 May 2004 06:30:38 -0000	1.2
@@ -48,11 +48,21 @@
 # define FRIBIDI_UNICODE_VERSION "unknown"
 #endif /* DONT_HAVE_FRIBIDI_UNICODE_VERSION_H */
 
+
+
+/* The Unicode Bidirectional Algorithm constants */
+
+/* Number of types defined in the bidi algorithm */
+#define FRIBIDI_BIDI_NUM_TYPES			19
+
 /* The maximum embedding level value assigned by explicit marks */
 #define FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL		61
 /* The maximum *number* of different resolved embedding levels: 0-62 */
 #define FRIBIDI_BIDI_MAX_RESOLVED_LEVELS	63
 
+
+/* A few Unicode characters */
+
 /* Bidirectional marks */
 #define FRIBIDI_CHAR_LRM		0x200E
 #define FRIBIDI_CHAR_RLM		0x200F

Index: fribidi.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/fribidi.c	3 May 2004 22:05:19 -0000	1.3
+++ b/fribidi.c	7 May 2004 06:30:38 -0000	1.4
@@ -37,6 +37,8 @@
 
 #include <fribidi.h>
 
+const char *fribidi_unicode_version = FRIBIDI_UNICODE_VERSION;
+
 const char *fribidi_version_info =
   "(" FRIBIDI_NAME ") " FRIBIDI_VERSION "\n"
   "Interface version " FRIBIDI_INTERFACE_VERSION_STRING ",\n"

Index: mem.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/mem.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/mem.h	3 May 2004 22:05:19 -0000	1.4
+++ b/mem.h	7 May 2004 06:30:38 -0000	1.5
@@ -62,7 +62,7 @@
      FRIBIDI_GNUC_HIDDEN FRIBIDI_GNUC_MALLOC FRIBIDI_GNUC_WARN_UNUSED;
 
 #define fribidi_mem_chunk_destroy FRIBIDI_PRIVATESPACE(mem_chunk_destroy)
-     void *fribidi_mem_chunk_destroy (
+     void fribidi_mem_chunk_destroy (
   FriBidiMemChunk *mem_chunk
 ) FRIBIDI_GNUC_HIDDEN;
 

--- bidi-type-table.i DELETED ---

--- mirroring-table.i DELETED ---




More information about the FriBidi-Commit mailing list