]> granicus.if.org Git - fribidi/commitdiff
fribidi-bidi-type.[ch] merged into fribidi-bidi-types.[ch].
authorbehdad <behdad>
Mon, 14 Jun 2004 18:43:48 +0000 (18:43 +0000)
committerbehdad <behdad>
Mon, 14 Jun 2004 18:43:48 +0000 (18:43 +0000)
fribidi-joining-type.[ch] merged into fribidi-joining-types.[ch].

22 files changed:
charset/fribidi-char-sets-cap-rtl.c
configure.ac
doc/Makefile.am
lib/Headers.mk
lib/Makefile.am
lib/fribidi-bidi-type.c [deleted file]
lib/fribidi-bidi-type.h [deleted file]
lib/fribidi-bidi-types.c
lib/fribidi-bidi-types.h
lib/fribidi-bidi.c
lib/fribidi-bidi.h
lib/fribidi-config.h.in
lib/fribidi-joining-type.c [deleted file]
lib/fribidi-joining-type.h [deleted file]
lib/fribidi-joining-types.c
lib/fribidi-joining-types.h
lib/fribidi-mirroring.c
lib/fribidi-mirroring.h
lib/fribidi-run.c
lib/fribidi.c
lib/fribidi.def
lib/fribidi.h

index 3f32f2fe929026c85d0b4d8654692aa7bd0aebfd..3390d1747b4c8ca9e89b643905f24af638446379 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-char-sets-cap-rtl.c - CapRTL character set conversion routines
  *
- * $Id: fribidi-char-sets-cap-rtl.c,v 1.7 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-char-sets-cap-rtl.c,v 1.8 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.7 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.8 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/charset/fribidi-char-sets-cap-rtl.c,v $
  *
  * Authors:
@@ -39,7 +39,7 @@
 
 #include <fribidi-unicode.h>
 #include <fribidi-mirroring.h>
-#include <fribidi-bidi-type.h>
+#include <fribidi-bidi-types.h>
 
 #include <bidi-types.h>
 
index 4c1fd335db172936314f85cdd2583107aa32a80e..ed50e6307e315d82a9898e7b2d121e314a35011f 100644 (file)
@@ -3,10 +3,10 @@
 ## Use autoupdate to update this file for newer versions of autoconf.
 ## Use autoscan to check if you need to add something to this file.
 ##############################################################################
-## $Id: configure.ac,v 1.14 2004-06-09 20:01:00 behdad Exp $
+## $Id: configure.ac,v 1.15 2004-06-14 18:43:48 behdad Exp $
 ## $Auther: behdad $
-## $Date: 2004-06-09 20:01:00 $
-## $Revision: 1.14 $
+## $Date: 2004-06-14 18:43:48 $
+## $Revision: 1.15 $
 ## $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/configure.ac,v $
 ##############################################################################
 
@@ -44,7 +44,7 @@ m4_define(fribidi_version,
            fribidi_major_version.fribidi_minor_version.fribidi_micro_version))dnl
 
 AC_INIT([GNU FriBidi],fribidi_version(),[http://freedesktop.org/cgi-bin/bugzilla/enter_bug.cgi?product=FriBidi])
-AC_REVISION([$Id: configure.ac,v 1.14 2004-06-09 20:01:00 behdad Exp $])
+AC_REVISION([$Id: configure.ac,v 1.15 2004-06-14 18:43:48 behdad Exp $])
 AC_CONFIG_SRCDIR(lib/fribidi.h)
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE([gnits])
@@ -152,7 +152,7 @@ fi
 # --disable-charsets
 AC_ARG_ENABLE(charsets,
               AC_HELP_STRING([--disable-charsets],
-                             [exclude charset conversion routines from the library]))
+                             [exclude charset conversion routines from library]))
 if test x$enable_charsets = xno; then
        FRIBIDI_CHARSETS=0
 else
@@ -161,6 +161,18 @@ fi
 AC_SUBST(FRIBIDI_CHARSETS)
 AM_CONDITIONAL(FRIBIDI_CHARSETS, test x$FRIBIDI_CHARSETS = x1)
 
+# --disable-arabic
+AC_ARG_ENABLE(arabic,
+              AC_HELP_STRING([--disable-arabic],
+                             [exclude Arabic joining/shaping code from library]))
+if test x$enable_arabic = xno; then
+       FRIBIDI_NO_ARABIC=1
+else
+       FRIBIDI_NO_ARABIC=0
+fi
+AC_SUBST(FRIBIDI_NO_ARABIC)
+AM_CONDITIONAL(FRIBIDI_NO_ARABIC, test x$FRIBIDI_NO_ARABIC = x1)
+
 # --with[out]-glib
 AC_ARG_WITH(glib,
               AC_HELP_STRING([--with-glib=@<:@no/auto/yes@:>@],
index cefac9ceee33e6c2386dca4157ac30a1577e0bdf..9191fc4d6f237cf5bbef0c990cc27d41f0357d38 100644 (file)
@@ -12,12 +12,6 @@ headers =
 inst_symbols =
 noinst_symbols =
 
-include $(top_srcdir)/lib/Headers.mk
-headers += $(libfribidi_la_headers)
-includepath += -I$(top_builddir)/lib -I$(top_srcdir)/lib
-includevpath += :$(top_builddir)/lib:$(top_srcdir)/lib
-inst_symbols += $(libfribidi_la_symbols)
-
 include $(top_srcdir)/charset/Headers.mk
 headers += $(libfribidi_char_sets_la_headers)
 includepath += -I$(top_srcdir)/charset
@@ -28,8 +22,12 @@ else # !FRIBIDI_CHARSETS
 noinst_symbols += $(libfribidi_char_sets_la_symbols)
 endif # !FRIBIDI_CHARSETS
 
-# name of the header to include in the manual
-headers += fribidi.h
+# The lib/Headers.mk stuff should come after all optional stuff.
+include $(top_srcdir)/lib/Headers.mk
+headers += $(libfribidi_la_headers)
+includepath += -I$(top_builddir)/lib -I$(top_srcdir)/lib
+includevpath += :$(top_builddir)/lib:$(top_srcdir)/lib
+inst_symbols += $(libfribidi_la_symbols)
 
 dist_man_MANS += $(inst_symbols:=.3)
 dist_noinst_MANS += $(noinst_symbols:=.3)
index 4f85346915454fe95818ec248f19ab2e83654a88..a3d193ecd1bf1a9ab1d4539ba1cead9a7253c5f3 100644 (file)
@@ -1,14 +1,12 @@
 libfribidi_la_headers = \
                fribidi-begindecls.h \
                fribidi-bidi.h \
-               fribidi-bidi-type.h \
                fribidi-bidi-types.h \
                fribidi-bidi-types-list.h \
                fribidi-common.h \
                fribidi-enddecls.h \
                fribidi-env.h \
                fribidi-joining.h \
-               fribidi-joining-type.h \
                fribidi-joining-types.h \
                fribidi-joining-types-list.h \
                fribidi-mirroring.h \
@@ -16,5 +14,6 @@ libfribidi_la_headers = \
                fribidi-unicode.h \
                fribidi-unicode-version.h \
                fribidi.h
+# fribidi.h should be the last entry in the list above.
 
 libfribidi_la_symbols = $(shell cat $(top_srcdir)/lib/fribidi.def)
index 9ae0d053bda110cfab661e23e018ffd537060790..8084590d38125e3b4e1f6585cc5652898182c17c 100644 (file)
@@ -38,11 +38,9 @@ libfribidi_la_SOURCES =      \
                env.h \
                fribidi.c \
                fribidi-bidi.c \
-               fribidi-bidi-type.c \
                fribidi-bidi-types.c \
                fribidi-env.c \
                fribidi-joining.c \
-               fribidi-joining-type.c \
                fribidi-joining-types.c \
                fribidi-mem.c \
                fribidi-mirroring.c \
diff --git a/lib/fribidi-bidi-type.c b/lib/fribidi-bidi-type.c
deleted file mode 100644 (file)
index cc22b0f..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* FriBidi
- * fribidi-bidi-type.c - get character bidi type
- *
- * $Id: fribidi-bidi-type.c,v 1.13 2004-06-14 17:00:33 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.13 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-bidi-type.c,v $
- *
- * Authors:
- *   Behdad Esfahbod, 2001, 2002, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2001,2002 Behdad Esfahbod
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- * 
- * For licensing issues, contact <license@farsiweb.info>.
- */
-
-#include "common.h"
-
-#include <fribidi-bidi-type.h>
-
-enum FriBidiCharTypeLinearEnum
-{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE,
-# include "fribidi-bidi-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
-  _FRIBIDI_NUM_TYPES
-};
-
-#include "bidi-type.tab.i"
-
-/* Map FriBidiCharTypeLinearEnum to FriBidiCharType. */
-static const FriBidiCharType linear_enum_to_char_type[] = {
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE,
-# include "fribidi-bidi-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
-};
-
-FRIBIDI_ENTRY FriBidiCharType
-fribidi_get_bidi_type (
-  /* input */
-  FriBidiChar ch
-)
-{
-  return linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (ch)];
-}
-
-FRIBIDI_ENTRY void
-fribidi_get_bidi_types (
-  /* input */
-  const FriBidiChar *str,
-  FriBidiStrIndex len,
-  /* output */
-  FriBidiCharType *type
-)
-{
-  register FriBidiStrIndex i = len;
-  for (; i; i--)
-    *type++ = fribidi_get_bidi_type (*str++);
-}
-
-/* Editor directions:
- * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
- */
diff --git a/lib/fribidi-bidi-type.h b/lib/fribidi-bidi-type.h
deleted file mode 100644 (file)
index e98722a..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* FriBidi
- * fribidi-bidi-type.h - get character bidi type
- *
- * $Id: fribidi-bidi-type.h,v 1.6 2004-06-14 17:00:33 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.6 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-bidi-type.h,v $
- *
- * Author:
- *   Behdad Esfahbod, 2001, 2002, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2001,2002 Behdad Esfahbod
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- * 
- * For licensing issues, contact <license@farsiweb.info>.
- */
-#ifndef _FRIBIDI_BIDI_TYPE_H
-#define _FRIBIDI_BIDI_TYPE_H
-
-#include "fribidi-common.h"
-
-#include "fribidi-types.h"
-#include "fribidi-bidi-types.h"
-
-#include "fribidi-begindecls.h"
-
-#define fribidi_get_bidi_type FRIBIDI_NAMESPACE(get_bidi_type)
-/* fribidi_get_bidi_type - get character bidi type
- *
- * This function returns the bidi type of a character.  There are a few macros
- * defined in fribidi-bidi-types.h for querying a bidi type.
- */
-FRIBIDI_ENTRY FriBidiCharType
-fribidi_get_bidi_type (
-  FriBidiChar ch               /* input character */
-) FRIBIDI_GNUC_CONST;
-
-#define fribidi_get_bidi_types FRIBIDI_NAMESPACE(get_bidi_types)
-/* fribidi_get_bidi_types - get bidi types for an string of characters
- *
- * This function finds the bidi types of an string of characters.  See
- * fribidi_get_bidi_type for more about the bidi types returned by this
- * function.
- */
-     FRIBIDI_ENTRY void fribidi_get_bidi_types (
-  const FriBidiChar *str,      /* input string */
-  FriBidiStrIndex len,         /* input string length */
-  FriBidiCharType *type                /* output bidi types */
-);
-
-#include "fribidi-enddecls.h"
-
-#endif /* !_FRIBIDI_BIDI_TYPE_H */
-/* Editor directions:
- * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
- */
index b54d3676b3c3706f68bb431df66bf143aca9d7b6..86a97635e795a7d318ee19c1a7cc85987ae25d15 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-bidi-types.c - character bidi types
  *
- * $Id: fribidi-bidi-types.c,v 1.6 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-bidi-types.c,v 1.7 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.6 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.7 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types.c,v $
  *
  * Authors:
 
 #include "bidi-types.h"
 
-#ifdef DEBUG
+enum FriBidiCharTypeLinearEnum
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE,
+# include "fribidi-bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+  _FRIBIDI_NUM_TYPES
+};
 
-char
-fribidi_char_from_bidi_type (
+#include "bidi-type.tab.i"
+
+/* Map FriBidiCharTypeLinearEnum to FriBidiCharType. */
+static const FriBidiCharType linear_enum_to_char_type[] = {
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE,
+# include "fribidi-bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+};
+
+FRIBIDI_ENTRY FriBidiCharType
+fribidi_get_bidi_type (
+  /* input */
+  FriBidiChar ch
+)
+{
+  return linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (ch)];
+}
+
+FRIBIDI_ENTRY void
+fribidi_get_bidi_types (
+  /* input */
+  const FriBidiChar *str,
+  const FriBidiStrIndex len,
+  /* output */
+  FriBidiCharType *type
+)
+{
+  register FriBidiStrIndex i = len;
+  for (; i; i--)
+    {
+      *type++ = linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (*str)];
+      str++;
+    }
+}
+
+FRIBIDI_ENTRY const char *
+fribidi_bidi_type_name (
   /* input */
   FriBidiCharType t
 )
 {
   switch (t)
     {
-#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return SYMBOL;
+#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return STRINGIZE(TYPE);
 #   define _FRIBIDI_ALL_TYPES
 #   include "fribidi-bidi-types-list.h"
 #   undef _FRIBIDI_ALL_TYPES
 #   undef _FRIBIDI_ADD_TYPE
     default:
-      return '?';
+      return "?";
     }
 }
 
-#endif
+#ifdef DEBUG
 
-FRIBIDI_ENTRY const char *
-fribidi_bidi_type_name (
+char
+fribidi_char_from_bidi_type (
   /* input */
   FriBidiCharType t
 )
 {
   switch (t)
     {
-#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return STRINGIZE(TYPE);
+#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return SYMBOL;
 #   define _FRIBIDI_ALL_TYPES
 #   include "fribidi-bidi-types-list.h"
 #   undef _FRIBIDI_ALL_TYPES
 #   undef _FRIBIDI_ADD_TYPE
     default:
-      return "?";
+      return '?';
     }
 }
 
+#endif /* DEBUG */
+
 /* Editor directions:
  * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
  */
index b47aa3396cbba9c5c7136c55d4b48a42a0879b1f..720eeda3eac3bb5257471491c08d920e258e2f6f 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-bidi-types.h - character bidi types
  *
- * $Id: fribidi-bidi-types.h,v 1.8 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-bidi-types.h,v 1.9 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.8 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.9 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types.h,v $
  *
  * Author:
@@ -329,14 +329,38 @@ typedef fribidi_uint32 FriBidiParType;
 
 /* Functions finally */
 
+
+#define fribidi_get_bidi_type FRIBIDI_NAMESPACE(get_bidi_type)
+/* fribidi_get_bidi_type - get character bidi type
+ *
+ * This function returns the bidi type of a character.  There are a few macros
+ * defined in fribidi-bidi-types.h for querying a bidi type.
+ */
+FRIBIDI_ENTRY FriBidiCharType
+fribidi_get_bidi_type (
+  FriBidiChar ch               /* input character */
+) FRIBIDI_GNUC_CONST;
+
+#define fribidi_get_bidi_types FRIBIDI_NAMESPACE(get_bidi_types)
+/* fribidi_get_bidi_types - get bidi types for an string of characters
+ *
+ * This function finds the bidi types of an string of characters.  See
+ * fribidi_get_bidi_type for more information about the bidi types returned
+ * by this function.
+ */
+     FRIBIDI_ENTRY void fribidi_get_bidi_types (
+  const FriBidiChar *str,      /* input string */
+  const FriBidiStrIndex len,   /* input string length */
+  FriBidiCharType *type                /* output bidi types */
+);
+
 #define fribidi_bidi_type_name FRIBIDI_NAMESPACE(bidi_type_name)
 /* fribidi_bidi_type_name - get bidi type name
  *
  * This function returns the bidi type name of a character type.  The
  * returned string is a static string and should not be freed.
  */
-FRIBIDI_ENTRY const char *
-fribidi_bidi_type_name (
+     FRIBIDI_ENTRY const char *fribidi_bidi_type_name (
   FriBidiCharType t            /* input bidi type */
 ) FRIBIDI_GNUC_CONST;
 
index ef4ccd66d2e69d8e29772066ee50f1c40b236938..dfb8d17e7188c2877665820058e84ad853afdbaf 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-bidi.c - bidirectional algorithm
  *
- * $Id: fribidi-bidi.c,v 1.11 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi-bidi.c,v 1.12 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.11 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.12 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi.c,v $
  *
  * Authors:
@@ -36,7 +36,7 @@
 #include "common.h"
 
 #include <fribidi-bidi.h>
-#include <fribidi-bidi-type.h>
+#include <fribidi-bidi-types.h>
 #include <fribidi-mirroring.h>
 #include <fribidi-unicode.h>
 #include <fribidi-env.h>
@@ -206,8 +206,8 @@ print_bidi_string (
 
   MSG ("  Org. types : ");
   if (bidi_types)
-  for (i = 0; i < len; i++)
-    MSG2 ("%c", fribidi_char_from_bidi_type (BIDI_TYPE(i)));
+    for (i = 0; i < len; i++)
+      MSG2 ("%c", fribidi_char_from_bidi_type (BIDI_TYPE (i)));
   MSG ("\n");
 }
 #endif /* DEBUG */
@@ -742,9 +742,9 @@ fribidi_get_par_embedding_levels (
       {
        /* if state is on at the very first of the string, do this too. */
        if (j >= 0)
-       {
-         char_type = BIDI_TYPE(j);
-       }
+         {
+           char_type = BIDI_TYPE (j);
+         }
        else
          char_type = FRIBIDI_TYPE_ON;
        if (!state && FRIBIDI_IS_SEPARATOR (char_type))
@@ -810,34 +810,6 @@ out:
 }
 
 
-FRIBIDI_ENTRY void
-fribidi_shape_mirroring (
-  /* input */
-  const FriBidiLevel *embedding_level_list,
-  const FriBidiStrIndex len,
-  /* input and output */
-  FriBidiChar *str
-)
-{
-  register FriBidiStrIndex i;
-
-  fribidi_assert (embedding_level_list);
-
-  if UNLIKELY
-    (len == 0 || !str) return;
-
-  /* L4. Mirror all characters that are in odd levels and have mirrors. */
-  for (i = len - 1; i >= 0; i--)
-    if (FRIBIDI_LEVEL_IS_RTL (embedding_level_list[i]))
-      {
-       FriBidiChar mirrored_ch;
-
-       if (fribidi_get_mirror_char (str[i], &mirrored_ch))
-         str[i] = mirrored_ch;
-      }
-}
-
-
 static void
 bidi_string_reverse (
   FriBidiChar *str,
@@ -945,7 +917,7 @@ fribidi_reorder_line (
          /* L3. Reorder NSMs. */
          for (i = off + len - 1; i >= off; i--)
            if (FRIBIDI_LEVEL_IS_RTL (embedding_level_list[i])
-               && BIDI_TYPE(i) == FRIBIDI_TYPE_NSM)
+               && BIDI_TYPE (i) == FRIBIDI_TYPE_NSM)
              {
                register FriBidiStrIndex seq_end = i;
                level = embedding_level_list[i];
index ad1f1286bc4a6fe8895a08893393922c223768bf..fedf32b0d79500d808e13ed7cc158556af4bbc99 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-bidi.h - bidirectional algorithm
  *
- * $Id: fribidi-bidi.h,v 1.8 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi-bidi.h,v 1.9 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.8 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.9 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi.h,v $
  *
  * Authors:
@@ -61,27 +61,12 @@ FRIBIDI_ENTRY FriBidiLevel
 fribidi_get_par_embedding_levels (
   const FriBidiChar *str,      /* input paragraph string */
   const FriBidiStrIndex len,   /* input string length of the paragraph */
-  const FriBidiCharType *bidi_types, /* input bidi types */
+  const FriBidiCharType *bidi_types,   /* input bidi types */
   FriBidiParType *pbase_dir,   /* requested and resolved paragraph
                                 * base direction */
   FriBidiLevel *embedding_level_list   /* output list of embedding levels */
 ) FRIBIDI_GNUC_WARN_UNUSED;
 
-#define fribidi_shape_mirroring FRIBIDI_NAMESPACE(shape_mirroring)
-/* fribidi_shape - do mirroring shaping
- *
- * This functions replaces mirroring characters on right-to-left embeddings in
- * string str with their mirrored equivalent as returned by
- * fribidi_get_mirror_char().
- */
-     FRIBIDI_ENTRY void fribidi_shape_mirroring (
-  const FriBidiLevel *embedding_level_list,    /* input list of embedding
-                                                  levels, as returned by
-                                                  fribidi_get_par_embedding_levels */
-  const FriBidiStrIndex len,   /* input string length */
-  FriBidiChar *str             /* string to shape */
-);
-
 #define fribidi_reorder_line FRIBIDI_NAMESPACE(reorder_line)
 /* fribidi_reorder_line - reorder a line of logical string to visual
  *
@@ -106,8 +91,8 @@ fribidi_get_par_embedding_levels (
  */
      FRIBIDI_ENTRY FriBidiLevel fribidi_reorder_line (
   const FriBidiLevel *embedding_level_list,    /* input list of embedding levels,
-                                          as returned by
-                                          fribidi_get_par_embedding_levels */
+                                                  as returned by
+                                                  fribidi_get_par_embedding_levels */
   const FriBidiStrIndex len,   /* input length of the line */
   const FriBidiStrIndex off,   /* input offset of the beginning of the line
                                   in the paragraph */
index 7e1026185464880a5c526cc459349fe484391262..62e60aef706e99e1d98a5991c26cd8675fd8e3ab 100644 (file)
@@ -14,6 +14,9 @@
 #define FRIBIDI_INTERFACE_VERSION @FRIBIDI_INTERFACE_VERSION@
 #define FRIBIDI_INTERFACE_VERSION_STRING "@FRIBIDI_INTERFACE_VERSION@"
 
+/* Define to 1 if you don't want Arabic joining/shaping code in the library */
+#define FRIBIDI_NO_ARABIC @FRIBIDI_NO_ARABIC@
+
 /* Define to 1 if you want charset conversion codes in the library */
 #define FRIBIDI_CHARSETS @FRIBIDI_CHARSETS@
 
diff --git a/lib/fribidi-joining-type.c b/lib/fribidi-joining-type.c
deleted file mode 100644 (file)
index 1f25ab6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* FriBidi
- * fribidi-joining-type.c - get character joining type
- *
- * $Id: fribidi-joining-type.c,v 1.1 2004-06-13 20:11:42 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-joining-type.c,v $
- *
- * Authors:
- *   Behdad Esfahbod, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2004 Behdad Esfahbod
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- * 
- * For licensing issues, contact <license@farsiweb.info>.
- */
-
-#include "common.h"
-
-#include <fribidi-joining-type.h>
-#include <fribidi-joining-types.h>
-
-enum FriBidiJoiningTypeShortEnum
-{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE = FRIBIDI_JOINING_TYPE_##TYPE,
-# include "fribidi-joining-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
-  _FRIBIDI_NUM_TYPES
-};
-
-#include "joining-type.tab.i"
-
-FRIBIDI_ENTRY FriBidiJoiningType
-fribidi_get_joining_type (
-  /* input */
-  FriBidiChar ch
-)
-{
-  return FRIBIDI_GET_JOINING_TYPE (ch);
-}
diff --git a/lib/fribidi-joining-type.h b/lib/fribidi-joining-type.h
deleted file mode 100644 (file)
index 04fcff9..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* FriBidi
- * fribidi-joining-type.h - get character joining type
- *
- * $Id: fribidi-joining-type.h,v 1.1 2004-06-13 20:11:42 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-joining-type.h,v $
- *
- * Author:
- *   Behdad Esfahbod, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2004 Behdad Esfahbod
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- * 
- * For licensing issues, contact <license@farsiweb.info>.
- */
-#ifndef _FRIBIDI_JOINING_TYPE_H
-#define _FRIBIDI_JOINING_TYPE_H
-
-#include "fribidi-common.h"
-
-#include "fribidi-types.h"
-#include "fribidi-joining-types.h"
-
-#include "fribidi-begindecls.h"
-
-#define fribidi_get_joining_type FRIBIDI_NAMESPACE(get_joining_type)
-/* fribidi_get_joining_type - get character joining type
- *
- * This function returns the joining type of a character.  There are a few
- * macros defined in fribidi-joining-types.h for querying a joining type.
- */
-FRIBIDI_ENTRY FriBidiJoiningType
-fribidi_get_joining_type (
-  FriBidiChar ch               /* input character */
-) FRIBIDI_GNUC_CONST;
-
-#include "fribidi-enddecls.h"
-
-#endif /* !_FRIBIDI_JOINING_TYPE_H */
-/* Editor directions:
- * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
- */
index 5b8767be4ef8f481416c062c068927b5da3c7864..07f68932f98bba7fcb1dad4354fbf658539fba27 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-joining-types.c - character joining types
  *
- * $Id: fribidi-joining-types.c,v 1.1 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-joining-types.c,v 1.2 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.2 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-joining-types.c,v $
  *
  * Authors:
 
 #include "common.h"
 
+#if !FRIBIDI_NO_ARABIC
+
 #include <fribidi-joining-types.h>
 
 #include "joining-types.h"
 
-#ifdef DEBUG
+enum FriBidiJoiningTypeShortEnum
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE = FRIBIDI_JOINING_TYPE_##TYPE,
+# include "fribidi-joining-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+  _FRIBIDI_NUM_TYPES
+};
 
-char
-fribidi_char_from_joining_type (
+#include "joining-type.tab.i"
+
+FRIBIDI_ENTRY FriBidiJoiningType
+fribidi_get_joining_type (
+  /* input */
+  FriBidiChar ch
+)
+{
+  return FRIBIDI_GET_JOINING_TYPE (ch);
+}
+
+FRIBIDI_ENTRY void
+fribidi_get_joining_types (
+  /* input */
+  const FriBidiChar *str,
+  const FriBidiStrIndex len,
+  /* output */
+  FriBidiJoiningType *type
+)
+{
+  register FriBidiStrIndex i = len;
+  for (; i; i--)
+    {
+      *type++ = FRIBIDI_GET_JOINING_TYPE (*str);
+      str++;
+    }
+}
+
+FRIBIDI_ENTRY const char *
+fribidi_joining_type_name (
   /* input */
   FriBidiJoiningType j
 )
 {
   switch (j)
     {
-#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return SYMBOL;
+#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return STRINGIZE(TYPE);
 #   include "fribidi-joining-types-list.h"
 #   undef _FRIBIDI_ADD_TYPE
     default:
-      return '?';
+      return "?";
     }
 }
 
-#endif
+#ifdef DEBUG
 
-FRIBIDI_ENTRY const char *
-fribidi_joining_type_name (
+char
+fribidi_char_from_joining_type (
   /* input */
   FriBidiJoiningType j
 )
 {
   switch (j)
     {
-#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return STRINGIZE(TYPE);
+#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return SYMBOL;
 #   include "fribidi-joining-types-list.h"
 #   undef _FRIBIDI_ADD_TYPE
     default:
-      return "?";
+      return '?';
     }
 }
 
+#endif /* DEBUG */
+
+#endif /* !FRIBIDI_NO_ARABIC */
+
 /* Editor directions:
  * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
  */
index 7c635a2b38e19615c578b1a0b6d2bef4a26da154..c28786f88994df58a57ff73ecf6866f38b3111b3 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-joining-types.h - character joining types
  *
- * $Id: fribidi-joining-types.h,v 1.1 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-joining-types.h,v 1.2 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.2 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-joining-types.h,v $
  *
  * Author:
@@ -124,14 +124,40 @@ typedef fribidi_uint8 FriBidiJoiningType;
        ((p) & (FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED))
 
 
+/* Functions finally */
+
+
+#define fribidi_get_joining_type FRIBIDI_NAMESPACE(get_joining_type)
+/* fribidi_get_joining_type - get character joining type
+ *
+ * This function returns the joining type of a character.  There are a few
+ * macros defined in fribidi-joining-types.h for querying a joining type.
+ */
+FRIBIDI_ENTRY FriBidiJoiningType
+fribidi_get_joining_type (
+  FriBidiChar ch               /* input character */
+) FRIBIDI_GNUC_CONST;
+
+#define fribidi_get_joining_types FRIBIDI_NAMESPACE(get_joining_types)
+/* fribidi_get_joining_types - get joining types for an string of characters
+ *
+ * This function finds the joining types of an string of characters.  See
+ * fribidi_get_joining_type for more information about the joining types
+ * returned by this function.
+ */
+     FRIBIDI_ENTRY void fribidi_get_joining_types (
+  const FriBidiChar *str,      /* input string */
+  const FriBidiStrIndex len,   /* input string length */
+  FriBidiJoiningType *type     /* output bidi types */
+);
+
 #define fribidi_joining_type_name FRIBIDI_NAMESPACE(joining_type_name)
 /* fribidi_joining_type_name - get joining type name
  *
  * This function returns the joining type name of a joining type.  The
  * returned string is a static string and should not be freed.
  */
-FRIBIDI_ENTRY const char *
-fribidi_joining_type_name (
+     FRIBIDI_ENTRY const char *fribidi_joining_type_name (
   FriBidiJoiningType j         /* input joining type */
 ) FRIBIDI_GNUC_CONST;
 
index d197828fcc0f59aa69b85257f0dd9b0986d7b5bf..3dbc37667995de2bb1c568b0cc0c613b11fe1d1b 100644 (file)
  * For licensing issues, contact <license@farsiweb.info> or write to
  * Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
  */
-/* $Id: fribidi-mirroring.c,v 1.11 2004-06-13 20:11:42 behdad Exp $
+/* $Id: fribidi-mirroring.c,v 1.12 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.11 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.12 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-mirroring.c,v $
  *
  * Authors:
@@ -55,6 +55,34 @@ fribidi_get_mirror_char (
   return ch != result ? true : false;
 }
 
+
+FRIBIDI_ENTRY void
+fribidi_shape_mirroring (
+  /* input */
+  const FriBidiLevel *embedding_level_list,
+  const FriBidiStrIndex len,
+  /* input and output */
+  FriBidiChar *str
+)
+{
+  register FriBidiStrIndex i;
+
+  fribidi_assert (embedding_level_list);
+
+  if UNLIKELY
+    (len == 0 || !str) return;
+
+  /* L4. Mirror all characters that are in odd levels and have mirrors. */
+  for (i = len - 1; i >= 0; i--)
+    if (FRIBIDI_LEVEL_IS_RTL (embedding_level_list[i]))
+      {
+       FriBidiChar mirrored_ch;
+
+       if (fribidi_get_mirror_char (str[i], &mirrored_ch))
+         str[i] = mirrored_ch;
+      }
+}
+
 /* Editor directions:
  * Local Variables:
  *   mode: c
index 2c5891034b64e682c9c139f8dcc8edd8e74739e4..300ccaebc8ae8033f9f28194150661e50cd14032 100644 (file)
  * For licensing issues, contact <license@farsiweb.info> or write to
  * Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
  */
-/* $Id: fribidi-mirroring.h,v 1.7 2004-06-09 14:59:21 behdad Exp $
+/* $Id: fribidi-mirroring.h,v 1.8 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-09 14:59:21 $
- * $Revision: 1.7 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.8 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-mirroring.h,v $
  *
  * Authors:
@@ -39,6 +39,7 @@
 #include "fribidi-common.h"
 
 #include "fribidi-types.h"
+#include "fribidi-bidi-types.h"
 
 #include "fribidi-begindecls.h"
 
@@ -57,6 +58,21 @@ FRIBIDI_ENTRY fribidi_boolean fribidi_get_mirror_char (
   FriBidiChar *mirrored_ch     /* output mirrored character */
 );
 
+#define fribidi_shape_mirroring FRIBIDI_NAMESPACE(shape_mirroring)
+/* fribidi_shape_mirroring - do mirroring shaping
+ *
+ * This functions replaces mirroring characters on right-to-left embeddings in
+ * string with their mirrored equivalent as returned by
+ * fribidi_get_mirror_char().
+ */
+FRIBIDI_ENTRY void fribidi_shape_mirroring (
+  const FriBidiLevel *embedding_level_list,    /* input list of embedding
+                                                  levels, as returned by
+                                                  fribidi_get_par_embedding_levels */
+  const FriBidiStrIndex len,   /* input string length */
+  FriBidiChar *str             /* string to shape */
+);
+
 #include "fribidi-enddecls.h"
 
 #endif /* !_FRIBIDI_MIRRORING_H */
index f4f8319e9fa5abaae02a00aaca73a9cd14d12bac..be8a66b75569fcc3657c7d9cf607b064b487120b 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi-run.c - text run data type
  *
- * $Id: fribidi-run.c,v 1.4 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi-run.c,v 1.5 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.4 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.5 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-run.c,v $
  *
  * Authors:
@@ -35,7 +35,7 @@
 
 #include "common.h"
 
-#include <fribidi-bidi-type.h>
+#include <fribidi-bidi-types.h>
 
 #include "run.h"
 #include "env.h"
index 0af4c93dac53638b12c1c120b5a71abdd1484224..fa4d7a59148edfab3c6aad33003839457862dc50 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi.c - Unicode bidirectional and Arabic joining/shaping algorithms
  *
- * $Id: fribidi.c,v 1.9 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi.c,v 1.10 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.9 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.10 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi.c,v $
  *
  * Authors:
@@ -186,8 +186,9 @@ fribidi_log2vis (
 
   fribidi_shape (embedding_level_list, len, visual_str);
 
-  status = fribidi_reorder_line (embedding_level_list, len, 0, NULL, visual_str,
-                                position_L_to_V_list, position_V_to_L_list);
+  status =
+    fribidi_reorder_line (embedding_level_list, len, 0, NULL, visual_str,
+                         position_L_to_V_list, position_V_to_L_list);
 
 out:
 
index 1380c7f3f3ba1a6add5271e7795994c322d81e39..b80e134d43eb52cf88d78525ec9c7d42461c0d94 100644 (file)
@@ -1,15 +1,19 @@
-fribidi_get_bidi_type
-fribidi_get_mirror_char
-fribidi_bidi_type_name
 fribidi_get_par_embedding_levels
 fribidi_reorder_line
-fribidi_shape_mirroring
-fribidi_shape
-fribidi_remove_bidi_marks
-fribidi_log2vis
+fribidi_get_bidi_type
+fribidi_get_bidi_types
+fribidi_bidi_type_name
 fribidi_debug_status
 fribidi_set_debug
 fribidi_mirroring_status
 fribidi_set_mirroring
 fribidi_reorder_nsm_status
 fribidi_set_reorder_nsm
+fribidi_get_joining_type
+fribidi_get_joining_types
+fribidi_joining_type_name
+fribidi_get_mirror_char
+fribidi_shape_mirroring
+fribidi_shape
+fribidi_remove_bidi_marks
+fribidi_log2vis
index 160884b688d73d8d81365eb3326f32b132b372b2..6dd5bfa7a00151c8ceb8ff01d44093b16ee8a668 100644 (file)
@@ -1,10 +1,10 @@
 /* FriBidi
  * fribidi.h - Unicode bidirectional and Arabic joining/shaping algorithms
  *
- * $Id: fribidi.h,v 1.5 2004-06-09 20:01:00 behdad Exp $
+ * $Id: fribidi.h,v 1.6 2004-06-14 18:43:53 behdad Exp $
  * $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.5 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.6 $
  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi.h,v $
  *
  * Author:
 #include "fribidi-unicode.h"
 #include "fribidi-types.h"
 #include "fribidi-env.h"
-#include "fribidi-bidi-type.h"
-#include "fribidi-bidi.h"
 #include "fribidi-mirroring.h"
+#include "fribidi-bidi-types.h"
+#include "fribidi-bidi.h"
+#if !FRIBIDI_NO_ARABIC
+#include "fribidi-joining-types.h"
+#include "fribidi-joining.h"
+#endif /* !FRIBIDI_NO_ARABIC */
 #if FRIBIDI_CHARSETS
 # include "fribidi-char-sets.h"
 #endif /* FRIBIDI_CHARSETS */