-bfde
-T FILE
-T FriBidiChar
+-T FriBidiLevel
-T FriBidiStrIndex
-T FriBidiCharType
-T FriBidiParType
--T FriBidiLevel
+-T FriBidiJoiningType
-T FriBidiCharSet
-T FriBidiCharSetHandler
-T FriBidiMemChunk
Implementation issues:
-* Better bootstrap script: steal from GNOME autogen.sh.
+* Still better bootstrap script: steal from GNOME autogen.sh.
* Test ./configure without pkg-config installed.
* Update all files headers/footers. For c/h files, lib/fribidi-mirroring.[ch]
is always the reference.
-* Show BidiTypes enum in manual and gdb.
-
* Update CapRTL with new Unicode reference code.
-* Revise reorder API, in fribidi_main.c reorder after line break.
+* In fribidi_main.c reorder after line break.
* Add an option to fribidi_main.c to assume two consecutive returns as
paragraph separators.
-* Design better apis to do reorder based on available levels, remove
- explicit marks then calculate position maps, ....
-
* Add more tests. For:
- Checking that not removing explicit marks in analyze is not changing the
output in anyway.
* indent: support function attributes and _PARAMS like things. Also
FRIBIDI_BEGIN_DECLS, and LIKELY.
+* Cleanup gen.tab/gen-*.c files.
+
+* Override pkgincludedir and append interface version.
+
* c2man: parse Author and Copyright from the whole file.
* Write texinfo documentation.
* Fix cvs2cl bug with spacing around author names read with -U option. Then
fix spacing in AUTHORS.
-* Use `-' before any command for installing a man page, so that make will
- ignore any errors.
+* Generate HTML and DVI documentation.
* Clean up README and NEWS, and check all files' headers. Write
gen.tab/README.
+* Rewrite fribidi.spec.in
+
* Add make rules for lib/$(BUILT_SOURCES) to depend on gen.tab/ stuff.
* When called in interactive mode, fribidi cmd-line should greet, write
* Replace Arabic Yeh with Persian Yeh in Hafez piece in test/*.
+* Replace test/run.tests with something better.
+
From GNU Coding Standards:
* The distribution should contain a file named `README' which gives the name
endif # !FRIBIDI_CHARSETS
libfribidi_char_sets_la_SOURCES = \
+ fribidi-char-sets.c \
fribidi-char-sets-cap-rtl.c \
fribidi-char-sets-cp1255.c \
fribidi-char-sets-cp1256.c \
- fribidi-char-sets.c \
fribidi-char-sets-iso8859-6.c \
fribidi-char-sets-iso8859-8.c \
- fribidi-char-sets-utf8.c
+ fribidi-char-sets-utf8.c \
+ fribidi-char-sets-cap-rtl.h \
+ fribidi-char-sets-cp1255.h \
+ fribidi-char-sets-cp1256.h \
+ fribidi-char-sets-iso8859-6.h \
+ fribidi-char-sets-iso8859-8.h \
+ fribidi-char-sets-utf8.h
$(top_builddir)/config.h: $(top_srcdir)/config.h.in
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
/* FriBidi
* fribidi-char-sets-cap-rtl.c - CapRTL character set conversion routines
*
- * $Id: fribidi-char-sets-cap-rtl.c,v 1.6 2004-06-04 09:41:11 behdad Exp $
+ * $Id: fribidi-char-sets-cap-rtl.c,v 1.7 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-04 09:41:11 $
- * $Revision: 1.6 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.7 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/charset/fribidi-char-sets-cap-rtl.c,v $
*
* Authors:
i += sprintf (s + i, /*l - i, */ " * 0x%02x %c%c %-3s ", j,
j < 0x20 ? '^' : ' ',
j < 0x20 ? j + '@' : j < 0x7f ? j : ' ',
- fribidi_type_name (CapRTLCharTypes[j]));
+ fribidi_bidi_type_name (CapRTLCharTypes[j]));
}
i += sprintf (s + i, /*l - i, */
"\n\n"
# man3
-includepath = -I$(top_builddir)
-includevpath = $(top_builddir)
-headers =
+includepath =
+includevpath =
+headers =
inst_symbols =
noinst_symbols =
include $(top_srcdir)/lib/Headers.mk
headers += $(libfribidi_la_headers)
-includepath += -I$(top_srcdir)/lib -I$(top_builddir)/lib
-includevpath += :$(top_srcdir)/lib:$(top_builddir)/lib
+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
EXTRA_PROGRAMS = \
gen-bidi-type-tab \
+ gen-joining-type-tab \
gen-mirroring-tab \
gen-unicode-version
gen_bidi_type_tab_SOURCES = gen-bidi-type-tab.c packtab.c packtab.h
+gen_joining_type_tab_SOURCES = gen-joining-type-tab.c packtab.c packtab.h
gen_mirroring_tab_SOURCES = gen-mirroring-tab.c packtab.c packtab.h
gen_unicode_version_SOURCES = gen-unicode-version.c
$(srcdir)/unidata/extracted \
$(top_builddir)/lib
+COMPRESSION = 4
+
# generate bidi-type.tab.i
gen_bidi_type_tab = gen-bidi-type-tab$(EXEEXT)
-COMPRESSION = 4
-
-BIDI_TYPE_TAB_VARIANTS = \
- UnicodeData_bidi-type.tab.i \
- DerivedBidiClass_bidi-type.tab.i
-
-UnicodeData_bidi-type.tab.i: \
- UnicodeData.txt \
+derived_bidi-type.tab.i: \
+ DerivedBidiClass.txt \
fribidi-unicode-version.h \
$(gen_bidi_type_tab_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) $(gen_bidi_type_tab)
+ ./$(gen_bidi_type_tab) $(COMPRESSION) $^ > $@ \
+ || ($(RM) $@ && false)
-DerivedBidiClass_bidi-type.tab.i: \
- DerivedBidiClass.txt \
+bidi-type.tab.i: \
+ UnicodeData.txt \
fribidi-unicode-version.h \
$(gen_bidi_type_tab_SOURCES)
-
-$(BIDI_TYPE_TAB_VARIANTS):
$(MAKE) $(AM_MAKEFLAGS) $(gen_bidi_type_tab)
- (DATA_FILE_TYPE=`echo $< | sed s,.*/,,`; \
- ./$(gen_bidi_type_tab) $(COMPRESSION) \
- $$DATA_FILE_TYPE $< > $@ || ($(RM) $@ && false))
+ ./$(gen_bidi_type_tab) $(COMPRESSION) $^ > $@ \
+ || ($(RM) $@ && false)
+
+DISTCLEANFILES += derived_bidi-type.tab.i
+
+# generate joining-type.tab.i
-bidi-type.tab.i:
- @for x in $(BIDI_TYPE_TAB_VARIANTS); do \
- if $(MAKE) $(AM_MAKEFLAGS) $$x && mv $$x bidi-type.tab.i; then \
- break; \
- fi; \
- done; \
- test -f bidi-type.tab.i || (echo Could not build $@; false)
+gen_joining_type_tab = gen-joining-type-tab$(EXEEXT)
-DISTCLEANFILES += $(BIDI_TYPE_TAB_VARIANTS)
+joining-type.tab.i: \
+ UnicodeData.txt \
+ ArabicShaping.txt \
+ fribidi-unicode-version.h \
+ $(gen_joining_type_tab_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) $(gen_joining_type_tab)
+ ./$(gen_joining_type_tab) $(COMPRESSION) $^ > $@ \
+ || ($(RM) $@ && false)
# generate mirroring.tab.i
gen_mirroring_tab = gen-mirroring-tab$(EXEEXT)
-MIRRORING_TAB_VARIANTS = \
- BidiMirroring_mirroring.tab.i
-
-BidiMirroring_mirroring.tab.i: \
+mirroring.tab.i: \
BidiMirroring.txt \
fribidi-unicode-version.h \
$(gen_mirroring_tab_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) $(gen_mirroring_tab)
- (DATA_FILE_TYPE=`echo $< | sed s,.*/,,`; \
- ./$(gen_mirroring_tab) $(COMPRESSION) \
- $$DATA_FILE_TYPE $< > $@ || ($(RM) $@ && false))
-
-mirroring.tab.i:
- @for x in $(MIRRORING_TAB_VARIANTS); do \
- if $(MAKE) $(AM_MAKEFLAGS) $$x && mv $$x mirroring.tab.i; then \
- break; \
- fi; \
- done; \
- test -f mirroring.tab.i || (echo Could not build $@; false)
-
-DISTCLEANFILES += $(MIRRORING_TAB_VARIANTS)
+ ./$(gen_mirroring_tab) $(COMPRESSION) $^ > $@ \
+ || ($(RM) $@ && false)
# generate fribidi-unicode-version.h
gen_unicode_version = gen-unicode-version$(EXEEXT)
-UNICODE_VERSION_VARIANTS = \
- ReadMe_fribidi-unicode-version.h
-
-ReadMe_fribidi-unicode-version.h: \
+fribidi-unicode-version.h: \
ReadMe.txt \
$(gen_unicode_version_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) $(gen_unicode_version)
- (DATA_FILE_TYPE=`echo $< | sed s,.*/,,`; \
- ./$(gen_unicode_version) \
- $$DATA_FILE_TYPE $< > $@ || ($(RM) $@ && false))
-
-fribidi-unicode-version.h:
- @for x in $(UNICODE_VERSION_VARIANTS); do \
- if $(MAKE) $(AM_MAKEFLAGS) $$x && mv $$x fribidi-unicode-version.h; then \
- break; \
- fi; \
- done; \
- test -f fribidi-unicode-version.h || (echo Could not build $@; false)
-
-DISTCLEANFILES += $(UNICODE_VERSION_VARIANTS)
+ ./$(gen_unicode_version) $< > $@ \
+ || ($(RM) $@ && false)
+
+# generate all generators:
+gen: $(EXTRA_PROGRAMS)
.DELETE_ON_ERROR:
/* FriBidi
* gen-bidi-type-tab.c - generate bidi-type.tab.i for libfribidi
*
- * $Id: gen-bidi-type-tab.c,v 1.11 2004-06-09 20:01:00 behdad Exp $
+ * $Id: gen-bidi-type-tab.c,v 1.12 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.11 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.12 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/gen.tab/gen-bidi-type-tab.c,v $
*
* Author:
static void
die (
- char *msg
+ const char *msg
)
{
fprintf (stderr, appname ": %s\n", msg);
static void
die2 (
- char *fmt,
- char *p
+ const char *fmt,
+ const char *p
)
{
fprintf (stderr, appname ": ");
static void
die3 (
- char *fmt,
+ const char *fmt,
unsigned long l,
- char *p
+ const char *p
)
{
fprintf (stderr, appname ": ");
struct
{
- char *name;
+ const char *name;
int key;
}
type_names[] =
#define type_names_count (sizeof (type_names) / sizeof (type_names[0]))
-static char *names[type_names_count];
+static const char *names[type_names_count];
static char
get_type (
- char *s
+ const char *s
)
{
int i;
for (i = 0; i < type_names_count; i++)
if (!strcmp (s, type_names[i].name))
return type_names[i].key;
- die2 ("type name `%s' not found", s);
+ die2 ("bidi type name `%s' not found", s);
return 0;
}
#define macro_name "FRIBIDI_GET_BIDI_TYPE"
static signed int table[FRIBIDI_UNICODE_CHARS];
-static char s[4000];
+static char buf[4000];
+static char tp[sizeof (buf)];
static void
init (
{
register FriBidiChar c;
- /* default types for reserved and noncharacter code points */
for (c = 0; c < FRIBIDI_UNICODE_CHARS; c++)
table[c] = LTR;
}
FILE *f
)
{
- char tp[10];
unsigned long c, l;
init_tab_unicode_data_txt ();
l = 0;
- while (fgets (s, sizeof s, f))
+ while (fgets (buf, sizeof buf, f))
{
int i;
+ const char *s = buf;
l++;
+ while (*s == ' ')
+ s++;
+
if (s[0] == '#' || s[0] == '\0' || s[0] == '\n')
continue;
FILE *f
)
{
- char tp[10];
unsigned long c, c2, l;
init_tab_derived_bidi_class_txt ();
l = 0;
- while (fgets (s, sizeof s, f))
+ while (fgets (buf, sizeof buf, f))
{
int i;
register char typ;
+ const char *s = buf;
l++;
+ while (*s == ' ')
+ s++;
+
if (s[0] == '#' || s[0] == '\0' || s[0] == '\n')
continue;
- i = sscanf (s, "%lx ; %s", &c, tp);
+ i = sscanf (s, "%lx ; %[^; ]", &c, tp);
if (i == 2)
c2 = c;
else
- i = sscanf (s, "%lx..%lx ; %s", &c, &c2, tp) - 1;
+ i = sscanf (s, "%lx..%lx ; %[^; ]", &c, &c2, tp) - 1;
if (i != 2 || c > c2 || c2 >= FRIBIDI_UNICODE_CHARS)
die3 ("invalid input at line %ld: %s", l, s);
static void
read_data (
- char *data_file_type,
- char *data_file_name
+ const char *data_file_type,
+ const char *data_file_name
)
{
FILE *f;
static void
gen_bidi_type_tab (
int max_depth,
- char *data_file_type
+ const char *data_file_type
)
{
fprintf (stderr, "Generating output, it may take up to a few minutes\n");
int
main (
int argc,
- char **argv
+ const char **argv
)
{
- if (argc != 4)
- die ("usage:\n " appname " max-depth data-file-type data-file-name\n"
- "where data-file-type is one of these:\n"
- " * UnicodeData.txt\n" " * DerivedBidiClass.txt");
+ const char *data_file_type = "UnicodeData.txt";
+ if (argc < 3)
+ die2 ("usage:\n " appname " max-depth /path/to/%s [junk...]",
+ data_file_type);
{
int max_depth = atoi (argv[1]);
- char *data_file_type = argv[2];
- char *data_file_name = argv[3];
+ const char *data_file_name = argv[2];
if (max_depth < 2)
die ("invalid depth");
--- /dev/null
+/* FriBidi
+ * gen-joining-type-tab.c - generate joining-type.tab.i for libfribidi
+ *
+ * $Id: gen-joining-type-tab.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/gen.tab/gen-joining-type-tab.c,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>.
+ */
+
+#include <common.h>
+
+#include <fribidi-unicode.h>
+
+#include <stdio.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "packtab.h"
+
+#define appname "gen-joining-type-tab"
+#define outputname "joining-type.tab.i"
+
+static void
+die (
+ const char *msg
+)
+{
+ fprintf (stderr, appname ": %s\n", msg);
+ exit (1);
+}
+
+static void
+die2 (
+ const char *fmt,
+ const char *p
+)
+{
+ fprintf (stderr, appname ": ");
+ fprintf (stderr, fmt, p);
+ fprintf (stderr, "\n");
+ exit (1);
+}
+
+static void
+die3 (
+ const char *fmt,
+ const char *p,
+ const char *q
+)
+{
+ fprintf (stderr, appname ": ");
+ fprintf (stderr, fmt, p, q);
+ fprintf (stderr, "\n");
+ exit (1);
+}
+
+static void
+die3l (
+ const char *fmt,
+ unsigned long l,
+ const char *p
+)
+{
+ fprintf (stderr, appname ": ");
+ fprintf (stderr, fmt, l, p);
+ fprintf (stderr, "\n");
+ exit (1);
+}
+
+enum FriBidiJoiningLinearEnumOffsetOne
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE,
+# include <fribidi-joining-types-list.h>
+# undef _FRIBIDI_ADD_TYPE
+ NUM_TYPES
+};
+
+struct
+{
+ const char *name;
+ int key;
+}
+type_names[] =
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) {STRINGIZE(TYPE), TYPE},
+# include <fribidi-joining-types-list.h>
+# undef _FRIBIDI_ADD_TYPE
+};
+
+#define type_names_count (sizeof (type_names) / sizeof (type_names[0]))
+
+static const char *names[type_names_count];
+
+static char
+get_type (
+ const char *s
+)
+{
+ int i;
+
+ for (i = 0; i < type_names_count; i++)
+ if (!strcmp (s, type_names[i].name))
+ return type_names[i].key;
+ die2 ("joining type name `%s' not found", s);
+ return -1;
+}
+
+static const char *ignored_bidi_types[] = {
+ "BN",
+ "LRE",
+ "RLE",
+ "LRO",
+ "RLO",
+ "PDF",
+ NULL
+};
+
+static const char *transparent_general_categories[] = {
+ "Mn",
+ "Cf",
+ NULL
+};
+
+static const char *
+type_is (
+ const char *s,
+ const char *type_list[]
+)
+{
+ for (; type_list[0]; type_list++)
+ if (!strcmp (s, type_list[0]))
+ return type_list[0];
+ return NULL;
+}
+
+#define table_name "Joi"
+#define macro_name "FRIBIDI_GET_JOINING_TYPE"
+
+static signed int table[FRIBIDI_UNICODE_CHARS];
+static char buf[4000];
+static char tp[sizeof (buf)], tp_gen[sizeof (buf)], tp_bidi[sizeof (buf)];
+
+static void
+clear_tab (
+)
+{
+ register FriBidiChar c;
+
+ for (c = 0; c < FRIBIDI_UNICODE_CHARS; c++)
+ table[c] = U;
+}
+
+static void
+init (
+)
+{
+ register int i;
+
+ for (i = 0; i < type_names_count; i++)
+ names[i] = 0;
+ for (i = type_names_count - 1; i >= 0; i--)
+ names[type_names[i].key] = type_names[i].name;
+
+ clear_tab ();
+}
+
+static void
+read_unicode_data_txt (
+ FILE *f
+)
+{
+ unsigned long c, l;
+
+ l = 0;
+ while (fgets (buf, sizeof buf, f))
+ {
+ int i;
+ const char *s = buf;
+
+ l++;
+
+ while (*s == ' ')
+ s++;
+
+ if (*s == '#' || *s == '\0' || *s == '\n')
+ continue;
+
+ i = sscanf (s, "%lx;%*[^;];%[^; ];%*[^;];%[^; ]", &c, tp_gen, tp_bidi);
+ if (i != 3 || c >= FRIBIDI_UNICODE_CHARS)
+ die3l ("UnicodeData.txt: invalid input at line %ld: %s", l, s);
+
+ if (type_is (tp_bidi, ignored_bidi_types))
+ table[c] = G;
+ if (type_is (tp_gen, transparent_general_categories))
+ table[c] = T;
+ }
+}
+
+static void
+read_arabic_shaping_txt (
+ FILE *f
+)
+{
+ unsigned long c, c2, l;
+
+ l = 0;
+ while (fgets (buf, sizeof buf, f))
+ {
+ int i;
+ register char typ;
+ const char *s = buf;
+
+ l++;
+
+ while (*s == ' ')
+ s++;
+
+ if (*s == '#' || *s == '\0' || *s == '\n')
+ continue;
+
+ i = sscanf (s, "%lx ; %*[^;]; %[^; ]", &c, tp);
+ if (i == 2)
+ c2 = c;
+ else
+ i = sscanf (s, "%lx..%lx ; %*[^;]; %[^; ]", &c, &c2, tp) - 1;
+
+ if (i != 2 || c > c2 || c2 >= FRIBIDI_UNICODE_CHARS)
+ die3l ("ArabicShaping.txt: invalid input at line %ld: %s", l, s);
+
+ typ = get_type (tp);
+ for (; c <= c2; c++)
+ table[c] = typ;
+ }
+}
+
+static void
+read_data (
+ const char *data_file_type[],
+ const char *data_file_name[]
+)
+{
+ FILE *f;
+
+ for (; data_file_name[0] && data_file_type[0];
+ data_file_name++, data_file_type++)
+ {
+ fprintf (stderr, "Reading `%s'\n", data_file_name[0]);
+ if (!(f = fopen (data_file_name[0], "rt")))
+ die2 ("error: cannot open `%s' for reading", data_file_name[0]);
+
+ if (!strcmp (data_file_type[0], "UnicodeData.txt"))
+ read_unicode_data_txt (f);
+ else if (!strcmp (data_file_type[0], "ArabicShaping.txt"))
+ read_arabic_shaping_txt (f);
+ else
+ die2 ("error: unknown data-file type %s", data_file_type[0]);
+
+ fclose (f);
+ }
+
+}
+
+static void
+gen_joining_type_tab (
+ int max_depth,
+ const char *data_file_type[]
+)
+{
+ fprintf (stderr, "Generating output, it may take up to a few minutes\n");
+ printf ("/* " outputname "\n * generated by " appname " (" FRIBIDI_NAME " "
+ FRIBIDI_VERSION ")\n" " * from the files %s, %s of Unicode version "
+ FRIBIDI_UNICODE_VERSION ". */\n\n", data_file_type[0],
+ data_file_type[1]);
+
+ printf ("#define PACKTAB_UINT8 fribidi_uint8\n"
+ "#define PACKTAB_UINT16 fribidi_uint16\n"
+ "#define PACKTAB_UINT32 fribidi_uint32\n\n");
+
+ if (!pack_table
+ (table, FRIBIDI_UNICODE_CHARS, 1, U, max_depth, 1, names,
+ "unsigned char", table_name, macro_name, stdout))
+ die ("error: insufficient memory, decrease max_depth");
+
+ printf ("#undef PACKTAB_UINT8\n"
+ "#undef PACKTAB_UINT16\n" "#undef PACKTAB_UINT32\n\n");
+
+ printf ("/* End of generated " outputname " */\n");
+}
+
+int
+main (
+ int argc,
+ const char **argv
+)
+{
+ const char *data_file_type[] =
+ { "UnicodeData.txt", "ArabicShaping.txt", NULL };
+ if (argc < 4)
+ die3 ("usage:\n " appname " max-depth /path/to/%s /path/to/%s [junk...]",
+ data_file_type[0], data_file_type[1]);
+ {
+ int max_depth = atoi (argv[1]);
+ const char *data_file_name[] = { NULL, NULL, NULL };
+ data_file_name[0] = argv[2];
+ data_file_name[1] = argv[3];
+
+ if (max_depth < 2)
+ die ("invalid depth");
+
+ init ();
+ read_data (data_file_type, data_file_name);
+ gen_joining_type_tab (max_depth, data_file_type);
+ }
+
+ return 0;
+}
/* FriBidi
* gen-mirroring-tab.c - generate bidi-mirroring.i for libfribidi
*
- * $Id: gen-mirroring-tab.c,v 1.8 2004-06-09 20:01:00 behdad Exp $
+ * $Id: gen-mirroring-tab.c,v 1.9 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.8 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.9 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/gen.tab/gen-mirroring-tab.c,v $
*
* Author:
static void
die (
- char *msg
+ const char *msg
)
{
fprintf (stderr, appname ": %s\n", msg);
static void
die2 (
- char *fmt,
- char *p
+ const char *fmt,
+ const char *p
)
{
fprintf (stderr, appname ": ");
static void
die4 (
- char *fmt,
+ const char *fmt,
unsigned long l,
unsigned long p,
unsigned long q
}
#define table_name "Mir"
-#define macro_name "FRIBIDI_GET_MIRRORING_DELTA"
+#define macro_name "FRIBIDI_GET_MIRRORING"
static signed int table[FRIBIDI_UNICODE_CHARS];
-static char s[4000];
+static char buf[4000];
static signed long max_dist;
static void
}
static void
-init_tab_bidi_mirroring_txt (
+init_tab_mirroring_txt (
)
{
clear_tab ();
{
unsigned long l;
+ init_tab_mirroring_txt ();
+
l = 0;
- while (fgets (s, sizeof s, f))
+ while (fgets (buf, sizeof buf, f))
{
unsigned long i, j;
signed long dist;
int k;
+ const char *s = buf;
l++;
+ while (*s == ' ')
+ s++;
+
if (s[0] == '#' || s[0] == '\0' || s[0] == '\n')
continue;
static void
read_data (
- char *data_file_type,
- char *data_file_name
+ const char *data_file_type,
+ const char *data_file_name
)
{
FILE *f;
static void
gen_mirroring_tab (
int max_depth,
- char *data_file_type
+ const char *data_file_type
)
{
int key_bytes;
- char *key_type;
+ const char *key_type;
fprintf (stderr, "Generating output, it may take up to a few minutes\n");
printf ("/* " outputname "\n * generated by " appname " (" FRIBIDI_NAME " "
if (!pack_table
(table, FRIBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL,
- key_type, table_name, macro_name, stdout))
+ key_type, table_name, macro_name "_DELTA", stdout))
die ("error: insufficient memory, decrease max_depth");
printf ("#undef PACKTAB_UINT8\n"
"#undef PACKTAB_UINT16\n" "#undef PACKTAB_UINT32\n\n");
+ printf ("#define " macro_name "(x) ((x) + " macro_name "_DELTA(x))\n\n");
+
printf ("/* End of generated " outputname " */\n");
}
int
main (
int argc,
- char **argv
+ const char **argv
)
{
- if (argc != 4)
- die ("usage:\n " appname " max-depth data-file-type data-file-name\n"
- "where data-file-type is one of these:\n" " * BidiMirroring.txt");
+ const char *data_file_type = "BidiMirroring.txt";
+ if (argc < 3)
+ die2 ("usage:\n " appname " max-depth /path/to/%s [junk...]",
+ data_file_type);
{
int max_depth = atoi (argv[1]);
- char *data_file_type = argv[2];
- char *data_file_name = argv[3];
+ const char *data_file_name = argv[2];
if (max_depth < 2)
die ("invalid depth");
/* FriBidi
* gen-unicode-version.c - generate fribidi-unicode-version.h for libfribidi
*
- * $Id: gen-unicode-version.c,v 1.5 2004-05-31 18:43:26 behdad Exp $
+ * $Id: gen-unicode-version.c,v 1.6 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-05-31 18:43:26 $
- * $Revision: 1.5 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.6 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/gen.tab/gen-unicode-version.c,v $
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2001,2002,2004 Behdad Esfahbod
+ * 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
static void
die (
- char *msg
+ const char *msg
)
{
fprintf (stderr, appname ": %s\n", msg);
static void
die2 (
- char *fmt,
- char *p
+ const char *fmt,
+ const char *p
)
{
fprintf (stderr, appname ": ");
int version_major, version_minor, version_micro;
char unicode_version[100];
+char buf[4000];
static void
init (
FILE *f
)
{
- char s[200];
- char *p;
+ const char *s;
- while (fgets (s, sizeof s, f))
- if ((p = strstr (s, "Version")))
+ while (fgets (buf, sizeof buf, f))
+ if ((s = strstr (buf, "Version")))
{
- sscanf (p, "Version %d.%d.%d", &version_major, &version_minor,
+ sscanf (s, "Version %d.%d.%d", &version_major, &version_minor,
&version_micro);
sprintf (unicode_version, "%d.%d.%d", version_major, version_minor,
version_micro);
static void
read_data (
- char *data_file_type,
- char *data_file_name
+ const char *data_file_type,
+ const char *data_file_name
)
{
FILE *f;
static void
gen_unicode_version (
- char *data_file_type
+ const char *data_file_type
)
{
fprintf (stderr, "Generating output\n");
int
main (
int argc,
- char **argv
+ const char **argv
)
{
- if (argc != 3)
- die ("usage:\n " appname " data-file-type data-file-name\n"
- "where data-file-type is one of these:\n" " * ReadMe.txt");
+ const char *data_file_type = "ReadMe.txt";
+
+ if (argc < 2)
+ die2 ("usage:\n " appname " /path/to/%s [junk...]", data_file_type);
{
- char *data_file_type = argv[1];
- char *data_file_name = argv[2];
+ const char *data_file_name = argv[1];
init ();
read_data (data_file_type, data_file_name);
return 0;
}
-static int lev, p[22], nn;
-static int best_lev, best_p[22];
+static int lev, best_lev, p[22], best_p[22], nn;
static long c[22], best_c[22], s, best_s;
static long t[22], best_t[22], clusters[22], best_cluster[22];
else
fprintf (f, "%d", def_key);
fprintf (f, " : ");
- j = 1;
+ j = 0;
for (i = best_lev - 1; i >= 0; i--)
{
- fprintf (f, " \\\n\t%sLev%d[(x)", table_name, i);
- if (j != 1)
- fprintf (f, "/%d", j);
+ fprintf (f, " \\\n\t%sLev%d[((x)", table_name, i);
+ if (j != 0)
+ fprintf (f, " >> %d", j);
if (i)
- fprintf (f, "%%%ld +", pow[best_p[best_lev - 1 - i]]);
- j *= best_cluster[best_lev - 1 - i];
+ fprintf (f, " & 0x%02lx) +", pow[best_p[best_lev - 1 - i]] - 1);
+ j += best_p[best_lev - 1 - i];
}
+ fprintf (f, ")");
for (i = 0; i < best_lev; i++)
fprintf (f, "]");
fprintf (f, ")\n\n");
{
#endif
-#define packtab_version 2
+#define packtab_version 3
int pack_table (
const signed int *base,
fribidi-bidi-types.h \
fribidi-bidi-types-list.h \
fribidi-common.h \
- fribidi-config.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 \
fribidi-types.h \
fribidi-unicode.h \
fribidi-unicode-version.h \
fribidi.h
-libfribidi_la_symbols := $(shell cat "$(top_srcdir)/lib/fribidi.def")
+libfribidi_la_symbols = $(shell cat $(top_srcdir)/lib/fribidi.def)
+EXTRA_DIST = fribidi.def
+
lib_LTLIBRARIES = libfribidi.la
AM_CPPFLAGS = $(MISC_CFLAGS)
endif # FRIBIDI_CHARSETS
include Headers.mk
-pkginclude_HEADERS = $(libfribidi_la_headers)
+pkginclude_HEADERS = $(libfribidi_la_headers) fribidi-config.h
libfribidi_la_SOURCES = \
- bidi-types.h \
bidi-type.tab.i \
+ bidi-types.h \
common.h \
debug.h \
env.h \
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 \
fribidi-run.c \
+ joining-type.tab.i \
+ joining-types.h \
mem.h \
mirroring.tab.i \
run.h
BUILT_SOURCES= \
+ fribidi-unicode-version.h \
bidi-type.tab.i \
- mirroring.tab.i \
- fribidi-unicode-version.h
+ joining-type.tab.i \
+ mirroring.tab.i
$(BUILT_SOURCES):
- (cd $(top_builddir)/gen.tab && \
- $(MAKE) $(AM_MAKEFLAGS) $@) && \
- mv $(top_builddir)/gen.tab/$@ .
+ @(cd $(top_builddir)/gen.tab && \
+ $(MAKE) $(AM_MAKEFLAGS) $@) && \
+ (test -f $@ || mv $(top_builddir)/gen.tab/$@ .)
+
+# re-generate all built sources:
+gen:
+ @(cd $(top_builddir)/gen.tab && \
+ $(MAKE) $(AM_MAKEFLAGS) $@) && \
+ $(RM) $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) $(BUILT_SOURCES)
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
/* FriBidi
* common.h - common include for library sources
*
- * $Id: common.h,v 1.12 2004-06-09 14:59:21 behdad Exp $
+ * $Id: common.h,v 1.13 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 14:59:21 $
- * $Revision: 1.12 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.13 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/common.h,v $
*
* Author:
# define FRIBIDI_EMPTY_STMT FRIBIDI_BEGIN_STMT (void) 0; FRIBIDI_END_STMT
#endif /* !FRIBIDI_EMPTY_STMT */
+#if HAVE_STRINGIZE
+# define STRINGIZE(symbol) #symbol
+#else /* !HAVE_STRINGIZE */
+# define STRINGIZE(symbol) "(no stringize operator available)"
+#endif /* !HAVE_STRINGIZE */
+
/* As per recommendation of GNU Coding Standards. */
#define _GNU_SOURCE
/* FriBidi
* debug.h - debug-only interfaces
*
- * $Id: debug.h,v 1.6 2004-06-09 14:59:21 behdad Exp $
+ * $Id: debug.h,v 1.7 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 14:59:21 $
- * $Revision: 1.6 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.7 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/debug.h,v $
*
* Author:
#if DEBUG
/* These definitions should only be used in DEBUG mode: */
-#if HAVE_STRINGIZE
-# define STRINGIZE(symbol) #symbol
-#else /* !HAVE_STRINGIZE */
-# define STRINGIZE(symbol)
-#endif /* !HAVE_STRINGIZE */
#ifndef __LINE__
# define __LINE__ 0
#endif /* !__LINE__ */
/* FriBidi
* env.h - private state variables
*
- * $Id: env.h,v 1.2 2004-05-03 22:05:19 behdad Exp $
+ * $Id: env.h,v 1.3 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-05-03 22:05:19 $
- * $Revision: 1.2 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.3 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/env.h,v $
*
* Author:
#include <fribidi-bidi-types.h>
#include "mem.h"
+#include "run.h"
#include <fribidi-begindecls.h>
/* FriBidi
* fribidi-bidi-type.c - get character bidi type
*
- * $Id: fribidi-bidi-type.c,v 1.11 2004-06-09 20:01:00 behdad Exp $
+ * $Id: fribidi-bidi-type.c,v 1.12 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.11 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.12 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-bidi-type.c,v $
*
* Authors:
#include "common.h"
#include <fribidi-bidi-type.h>
-#include <fribidi-unicode.h>
-
-#include "bidi-types.h"
enum FriBidiCharTypeLinearEnum
{
/* FriBidi
* fribidi-bidi-types-list.h - list of bidi types
*
- * $Id: fribidi-bidi-types-list.h,v 1.4 2004-06-09 14:59:21 behdad Exp $
+ * $Id: fribidi-bidi-types-list.h,v 1.5 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 14:59:21 $
- * $Revision: 1.4 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.5 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types-list.h,v $
*
* Author:
_FRIBIDI_ADD_TYPE (BN, 'b') /* Boundary Neutral */
_FRIBIDI_ADD_TYPE (BS, 'B') /* Block Separator */
_FRIBIDI_ADD_TYPE (SS, 'S') /* Segment Separator */
-_FRIBIDI_ADD_TYPE (WS, '_') /* White-Space */
+_FRIBIDI_ADD_TYPE (WS, '_') /* WhiteSpace */
_FRIBIDI_ADD_TYPE (ON, 'n') /* Other Neutral */
_FRIBIDI_ADD_TYPE (LRE, '+') /* Left-to-Right Embedding */
_FRIBIDI_ADD_TYPE (RLE, '+') /* Right-to-Left Embedding */
/* FriBidi
* fribidi-bidi-types.c - character bidi types
*
- * $Id: fribidi-bidi-types.c,v 1.5 2004-06-04 09:41:11 behdad Exp $
+ * $Id: fribidi-bidi-types.c,v 1.6 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-04 09:41:11 $
- * $Revision: 1.5 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.6 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types.c,v $
*
* Authors:
{
switch (t)
{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return #TYPE;
+# 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
/* FriBidi
* fribidi-bidi-types.h - character bidi types
*
- * $Id: fribidi-bidi-types.h,v 1.7 2004-06-09 20:01:00 behdad Exp $
+ * $Id: fribidi-bidi-types.h,v 1.8 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.7 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.8 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types.h,v $
*
* Author:
typedef signed char FriBidiLevel;
-typedef struct _FriBidiRun FriBidiRun;
-
/*
- * Define some bit masks, that character types are based on, each one has
- * only one bit on.
+ * Define bit masks that bidi types are based on, each mask has
+ * only one bit set.
*/
-/* Do not use enum, because 16bit processors do not allow 32bit enum values. */
-
#define FRIBIDI_MASK_RTL 0x00000001L /* Is right to left */
#define FRIBIDI_MASK_ARABIC 0x00000002L /* Is arabic */
#define FRIBIDI_MASK_WEAK 0x00000020L /* Is weak */
#define FRIBIDI_MASK_NEUTRAL 0x00000040L /* Is neutral */
#define FRIBIDI_MASK_SENTINEL 0x00000080L /* Is sentinel */
-/* Sentinels are not valid chars, just identify the start and end of strings. */
+/* Sentinels are not valid chars, just identify the start/end of strings. */
/* Each char can be only one of the five following. */
#define FRIBIDI_MASK_LETTER 0x00000100L /* Is letter: L, R, AL */
#define FRIBIDI_MASK_NUMBER 0x00000200L /* Is number: EN, AN */
-#define FRIBIDI_MASK_NUMSEPTER 0x00000400L /* Is number separator or terminator: ES, ET, CS */
+#define FRIBIDI_MASK_NUMSEPTER 0x00000400L /* Is separator or terminator: ES, ET, CS */
#define FRIBIDI_MASK_SPACE 0x00000800L /* Is space: BN, BS, SS, WS */
#define FRIBIDI_MASK_EXPLICIT 0x00001000L /* Is expilict mark: LRE, RLE, LRO, RLO, PDF */
-/* Can be on only if FRIBIDI_MASK_SPACE is also on. */
-#define FRIBIDI_MASK_SEPARATOR 0x00002000L /* Is test separator: BS, SS */
-/* Can be on only if FRIBIDI_MASK_EXPLICIT is also on. */
+/* Can be set only if FRIBIDI_MASK_SPACE is also set. */
+#define FRIBIDI_MASK_SEPARATOR 0x00002000L /* Is text separator: BS, SS */
+/* Can be set only if FRIBIDI_MASK_EXPLICIT is also set. */
#define FRIBIDI_MASK_OVERRIDE 0x00004000L /* Is explicit override: LRO, RLO */
-/* The following must be to make types pairwise different, some of them can
- be removed but are here because of efficiency (make queries faster). */
+/* The following exist to make types pairwise different, some of them can
+ * be removed but are here because of efficiency (make queries faster). */
#define FRIBIDI_MASK_ES 0x00010000L
#define FRIBIDI_MASK_ET 0x00020000L
* Define values for FriBidiCharType
*/
-/* Strong left to right */
-#define FRIBIDI_TYPE_LTR_VAL ( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_LETTER )
-/* Right to left characters */
-#define FRIBIDI_TYPE_RTL_VAL ( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_LETTER \
- + FRIBIDI_MASK_RTL)
-/* Arabic characters */
-#define FRIBIDI_TYPE_AL_VAL ( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_LETTER \
- + FRIBIDI_MASK_RTL + FRIBIDI_MASK_ARABIC )
-/* Left-To-Right embedding */
-#define FRIBIDI_TYPE_LRE_VAL (FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT)
-/* Right-To-Left embedding */
-#define FRIBIDI_TYPE_RLE_VAL ( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT \
- + FRIBIDI_MASK_RTL )
-/* Left-To-Right override */
-#define FRIBIDI_TYPE_LRO_VAL ( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT \
- + FRIBIDI_MASK_OVERRIDE )
-/* Right-To-Left override */
-#define FRIBIDI_TYPE_RLO_VAL ( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT \
- + FRIBIDI_MASK_RTL + FRIBIDI_MASK_OVERRIDE )
-
-/* Pop directional override */
-#define FRIBIDI_TYPE_PDF_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_EXPLICIT )
-/* European digit */
-#define FRIBIDI_TYPE_EN_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMBER )
-/* Arabic digit */
-#define FRIBIDI_TYPE_AN_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMBER \
- + FRIBIDI_MASK_ARABIC )
-/* European number separator */
-#define FRIBIDI_TYPE_ES_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMSEPTER \
- + FRIBIDI_MASK_ES )
-/* European number terminator */
-#define FRIBIDI_TYPE_ET_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMSEPTER \
- + FRIBIDI_MASK_ET )
+/* Left-To-Right letter */
+#define FRIBIDI_TYPE_LTR_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER )
+/* Right-To-Left letter */
+#define FRIBIDI_TYPE_RTL_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER \
+ | FRIBIDI_MASK_RTL)
+/* Arabic Letter */
+#define FRIBIDI_TYPE_AL_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER \
+ | FRIBIDI_MASK_RTL | FRIBIDI_MASK_ARABIC )
+/* Left-to-Right Embedding */
+#define FRIBIDI_TYPE_LRE_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT)
+/* Right-to-Left Embedding */
+#define FRIBIDI_TYPE_RLE_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
+ | FRIBIDI_MASK_RTL )
+/* Left-to-Right Override */
+#define FRIBIDI_TYPE_LRO_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
+ | FRIBIDI_MASK_OVERRIDE )
+/* Right-to-Left Override */
+#define FRIBIDI_TYPE_RLO_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
+ | FRIBIDI_MASK_RTL | FRIBIDI_MASK_OVERRIDE )
+
+/* Pop Directional Flag*/
+#define FRIBIDI_TYPE_PDF_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_EXPLICIT )
+/* European Numeral */
+#define FRIBIDI_TYPE_EN_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMBER )
+/* Arabic Numeral */
+#define FRIBIDI_TYPE_AN_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMBER \
+ | FRIBIDI_MASK_ARABIC )
+/* European number Separator */
+#define FRIBIDI_TYPE_ES_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
+ | FRIBIDI_MASK_ES )
+/* European number Terminator */
+#define FRIBIDI_TYPE_ET_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
+ | FRIBIDI_MASK_ET )
/* Common Separator */
-#define FRIBIDI_TYPE_CS_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMSEPTER \
- + FRIBIDI_MASK_CS )
-/* Non spacing mark */
-#define FRIBIDI_TYPE_NSM_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NSM )
-/* Boundary neutral */
-#define FRIBIDI_TYPE_BN_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_SPACE \
- + FRIBIDI_MASK_BN )
-
-/* Block separator */
-#define FRIBIDI_TYPE_BS_VAL ( FRIBIDI_MASK_NEUTRAL + FRIBIDI_MASK_SPACE \
- + FRIBIDI_MASK_SEPARATOR + FRIBIDI_MASK_BS )
-/* Segment separator */
-#define FRIBIDI_TYPE_SS_VAL ( FRIBIDI_MASK_NEUTRAL + FRIBIDI_MASK_SPACE \
- + FRIBIDI_MASK_SEPARATOR + FRIBIDI_MASK_SS )
-/* Whitespace */
-#define FRIBIDI_TYPE_WS_VAL ( FRIBIDI_MASK_NEUTRAL + FRIBIDI_MASK_SPACE \
- + FRIBIDI_MASK_WS )
+#define FRIBIDI_TYPE_CS_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
+ | FRIBIDI_MASK_CS )
+/* Non Spacing Mark */
+#define FRIBIDI_TYPE_NSM_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NSM )
+/* Boundary Neutral */
+#define FRIBIDI_TYPE_BN_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_SPACE \
+ | FRIBIDI_MASK_BN )
+
+/* Block Separator */
+#define FRIBIDI_TYPE_BS_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
+ | FRIBIDI_MASK_SEPARATOR | FRIBIDI_MASK_BS )
+/* Segment Separator */
+#define FRIBIDI_TYPE_SS_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
+ | FRIBIDI_MASK_SEPARATOR | FRIBIDI_MASK_SS )
+/* WhiteSpace */
+#define FRIBIDI_TYPE_WS_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
+ | FRIBIDI_MASK_WS )
/* Other Neutral */
#define FRIBIDI_TYPE_ON_VAL ( FRIBIDI_MASK_NEUTRAL )
/* The following are used in specifying paragraph direction only. */
-/* Weak left to right */
+/* Weak Left-To-Right */
#define FRIBIDI_TYPE_WLTR_VAL ( FRIBIDI_MASK_WEAK )
-/* Weak right to left */
-#define FRIBIDI_TYPE_WRTL_VAL ( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_RTL )
+/* Weak Right-To-Left */
+#define FRIBIDI_TYPE_WRTL_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_RTL )
-/* Start or end of text (run list). Only used internally */
+/* start or end of text (run list) SENTINEL. Only used internally */
#define FRIBIDI_TYPE_SENTINEL ( FRIBIDI_MASK_SENTINEL )
/* Private types for applications. More private types can be obtained by
* summing up from this one. */
#define FRIBIDI_TYPE_PRIVATE ( FRIBIDI_MASK_PRIVATE )
-/* Define values for FriBidiCharType. */
/* Define Enums only if sizeof(int) == 4 (UTF-32), and not compiling C++.
* The problem with C++ is that then casts between int32 and enum will fail!
/* Functions finally */
-/* fribidi_type_name is the old name of fribidi_bidi_type_name */
-#define fribidi_type_name fribidi_bidi_type_name
-
#define fribidi_bidi_type_name FRIBIDI_NAMESPACE(bidi_type_name)
/* fribidi_bidi_type_name - get bidi type name
*
--- /dev/null
+/* 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);
+}
--- /dev/null
+/* 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
+ */
--- /dev/null
+#ifndef __FRIBIDI_DOC
+/* FriBidi
+ * fribidi-joining-types-list.h - list of joining types
+ *
+ * $Id: fribidi-joining-types-list.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/fribidi-joining-types-list.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>.
+ */
+/* *INDENT-OFF* */
+#endif /* !__FRIBIDI_DOC */
+#ifndef _FRIBIDI_ADD_TYPE
+# define _FRIBIDI_ADD_TYPE(x,y)
+#endif
+
+_FRIBIDI_ADD_TYPE (U, '|') /* nUn-joining, e.g. Full Stop */
+_FRIBIDI_ADD_TYPE (R, '>') /* Right-joining, e.g. Arabic Letter Dal */
+_FRIBIDI_ADD_TYPE (D, '+') /* Dual-joining, e.g. Arabic Letter Ain */
+_FRIBIDI_ADD_TYPE (C, '-') /* join-Causing, e.g. Tatweel, ZWJ */
+_FRIBIDI_ADD_TYPE (T, '^') /* Transparent, e.g. Arabic Fatha */
+_FRIBIDI_ADD_TYPE (L, '<') /* Left-joining, i.e. fictional */
+_FRIBIDI_ADD_TYPE (G, '~') /* iGnored, e.g. LRE, RLE, ZWNBSP */
+
+#ifndef __FRIBIDI_DOC
+/* *INDENT-ON* */
+#endif /* !__FRIBIDI_DOC */
--- /dev/null
+/* FriBidi
+ * fribidi-joining-types.c - character joining types
+ *
+ * $Id: fribidi-joining-types.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/fribidi-joining-types.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-joining-types.h>
+
+#include "joining-types.h"
+
+#ifdef DEBUG
+
+char
+fribidi_char_from_joining_type (
+ /* input */
+ FriBidiJoiningType j
+)
+{
+ switch (j)
+ {
+# 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 '?';
+ }
+}
+
+#endif
+
+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 STRINGIZE(TYPE);
+# include "fribidi-joining-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+ default:
+ return "?";
+ }
+}
+
+/* Editor directions:
+ * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
+ */
--- /dev/null
+/* FriBidi
+ * fribidi-joining-types.h - character joining types
+ *
+ * $Id: fribidi-joining-types.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/fribidi-joining-types.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_JOINING_TYPES_H
+#define _FRIBIDI_JOINING_TYPES_H
+
+#include "fribidi-common.h"
+
+#include "fribidi-types.h"
+
+#include "fribidi-begindecls.h"
+
+/*
+ * Define bit masks that joining types are based on, each mask has
+ * only one bit set.
+ */
+
+#define FRIBIDI_MASK_JOINS_RIGHT 0x01 /* May join to right */
+#define FRIBIDI_MASK_JOINS_LEFT 0x02 /* May join to right */
+#define FRIBIDI_MASK_ARAB_SHAPES 0x04 /* May Arabic shape */
+#define FRIBIDI_MASK_TRANSPARENT 0x10 /* Is transparent */
+#define FRIBIDI_MASK_IGNORED 0x20 /* Is ignored */
+#define FRIBIDI_MASK_LIGATURED 0x40 /* Is ligatured */
+
+/*
+ * Define values for FriBidiJoiningType
+ */
+
+/* nUn-joining */
+#define FRIBIDI_JOINING_TYPE_U_VAL ( 0 )
+
+/* Right-joining */
+#define FRIBIDI_JOINING_TYPE_R_VAL \
+ ( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_ARAB_SHAPES )
+
+/* Dual-joining */
+#define FRIBIDI_JOINING_TYPE_D_VAL \
+ ( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT \
+ | FRIBIDI_MASK_ARAB_SHAPES )
+
+/* join-Causing */
+#define FRIBIDI_JOINING_TYPE_C_VAL \
+ ( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT )
+
+/* Left-joining */
+#define FRIBIDI_JOINING_TYPE_L_VAL \
+ ( FRIBIDI_MASK_JOINS_LEFT | FRIBIDI_MASK_ARAB_SHAPES )
+
+/* Transparent */
+#define FRIBIDI_JOINING_TYPE_T_VAL \
+ ( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_ARAB_SHAPES )
+
+/* iGnored */
+#define FRIBIDI_JOINING_TYPE_G_VAL ( FRIBIDI_MASK_IGNORED )
+
+
+enum _FriBidiJoiningTypeEnum
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) \
+ FRIBIDI_JOINING_TYPE_##TYPE = FRIBIDI_JOINING_TYPE_##TYPE##_VAL,
+# include "fribidi-joining-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+ _FRIBIDI_JOINING_TYPE_JUNK /* Don't use this */
+};
+
+#ifdef __FRIBIDI_DOC
+typedef enum _FriBidiJoiningTypeEnum FriBidiJoiningType;
+#else /* !__FRIBIDI_DOC */
+typedef fribidi_uint8 FriBidiJoiningType;
+#endif /* !__FRIBIDI_DOC */
+
+
+/*
+ * Defining macros for needed queries, It is fully dependent on the
+ * implementation of FriBidiJoiningType.
+ */
+
+/* Joins to right? */
+#define FRIBIDI_JOINS_RIGHT(p) ((p) & FRIBIDI_MASK_JOINS_RIGHT)
+
+/* Joins to left? */
+#define FRIBIDI_JOINS_LEFT(p) ((p) & FRIBIDI_MASK_JOINS_LEFT)
+
+/* Joins to left? */
+#define FRIBIDI_ARAB_SHAPES(p) ((p) & FRIBIDI_MASK_ARAB_SHAPES)
+
+/* Is transparent in joining? */
+#define FRIBIDI_IS_JOIN_TRANSPARENT(p) ((p) & FRIBIDI_MASK_TRANSPARENT)
+
+/* Is ignored in joining? */
+#define FRIBIDI_IS_JOIN_IGNORED(p) ((p) & FRIBIDI_MASK_IGNORED)
+
+/* Is skipped in joining? */
+#define FRIBIDI_IS_JOIN_SKIPPED(p) \
+ ((p) & (FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED))
+
+
+#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 (
+ FriBidiJoiningType j /* input joining type */
+) FRIBIDI_GNUC_CONST;
+
+#include "fribidi-enddecls.h"
+
+#endif /* !_FRIBIDI_JOINING_TYPES_H */
+/* Editor directions:
+ * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
+ */
--- /dev/null
+/* FriBidi
+ * fribidi-joining.h - Arabic joining algorithm
+ *
+ * $Id: fribidi-joining.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/fribidi-joining.h,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>.
+ */
+#ifndef _FRIBIDI_JOINING_H
+#define _FRIBIDI_JOINING_H
+
+#include "fribidi-common.h"
+
+#include "fribidi-types.h"
+#include "fribidi-joining-types.h"
+
+#include "fribidi-begindecls.h"
+
+
+
+#include "fribidi-enddecls.h"
+
+#endif /* !_FRIBIDI_JOINING_H */
+/* Editor directions:
+ * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
+ */
* 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.10 2004-06-09 20:01:00 behdad Exp $
+/* $Id: fribidi-mirroring.c,v 1.11 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.10 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.11 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-mirroring.c,v $
*
* Authors:
)
{
register FriBidiChar result;
- result = FRIBIDI_GET_MIRRORING_DELTA (ch);
+ result = FRIBIDI_GET_MIRRORING (ch);
if (mirrored_ch)
- *mirrored_ch = ch + result;
- return result ? true : false;
+ *mirrored_ch = result;
+ return ch != result ? true : false;
}
/* Editor directions:
-fribidi_bidi_type_name
fribidi_get_bidi_type
-fribidi_log2vis
+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_get_mirror_char
+fribidi_log2vis
fribidi_debug_status
fribidi_set_debug
fribidi_mirroring_status
--- /dev/null
+/* FriBidi
+ * joining-types.h - define internal joining types
+ *
+ * $Id: joining-types.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/joining-types.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 _JOINING_TYPES_H
+#define _JOINING_TYPES_H
+
+#include "common.h"
+
+#include <fribidi-types.h>
+#include <fribidi-joining-types.h>
+
+#include <fribidi-begindecls.h>
+
+#if DEBUG
+
+#define fribidi_char_from_joining_type FRIBIDI_PRIVATESPACE(char_from_joining_type)
+char
+fribidi_char_from_joining_type (
+ FriBidiJoiningType j /* input joining type */
+) FRIBIDI_GNUC_HIDDEN;
+
+#endif /* DEBUG */
+
+#include <fribidi-enddecls.h>
+
+#endif /* !_JOINING_TYPES_H */
+/* Editor directions:
+ * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
+ */
/* FriBidi
* run.h - text run data type
*
- * $Id: run.h,v 1.4 2004-06-04 16:43:51 behdad Exp $
+ * $Id: run.h,v 1.5 2004-06-13 20:11:42 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-04 16:43:51 $
- * $Revision: 1.4 $
+ * $Date: 2004-06-13 20:11:42 $
+ * $Revision: 1.5 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/run.h,v $
*
* Authors:
#include <fribidi-begindecls.h>
-struct _FriBidiRun
+typedef struct _FriBidiRunStruct FriBidiRun;
+
+struct _FriBidiRunStruct
{
FriBidiRun *prev;
FriBidiRun *next;