summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbehdad <behdad>2002-01-10 01:16:51 +0000
committerbehdad <behdad>2002-01-10 01:16:51 +0000
commit8b5a89d094b80e8ab661f78b5a7a76848f5e622a (patch)
tree97d39552d8037a2e8bbd475d19e9b0be4feb2426
parent838568e3ab9201d504c88caafe9b21a5d940aecb (diff)
0.10.1pre Changes.
-rw-r--r--ChangeLog21
-rw-r--r--Makefile.am4
-rw-r--r--README34
-rw-r--r--TODO14
-rw-r--r--configure.in30
-rwxr-xr-xconformance/test14
-rw-r--r--fribidi-config.in2
-rw-r--r--fribidi.c48
-rw-r--r--fribidi.h14
-rw-r--r--fribidi.spec.in118
-rw-r--r--fribidi_benchmark.c2
-rw-r--r--fribidi_char_sets.c2
-rw-r--r--fribidi_char_sets.h95
-rw-r--r--fribidi_char_sets_cap_rtl.c2
-rw-r--r--fribidi_char_sets_cap_rtl.h35
-rw-r--r--fribidi_char_sets_cp1255.c2
-rw-r--r--fribidi_char_sets_cp1255.h29
-rw-r--r--fribidi_char_sets_cp1256.c2
-rw-r--r--fribidi_char_sets_cp1256.h29
-rw-r--r--fribidi_char_sets_isiri_3342.c2
-rw-r--r--fribidi_char_sets_isiri_3342.h29
-rw-r--r--fribidi_char_sets_iso8859_6.c2
-rw-r--r--fribidi_char_sets_iso8859_6.h29
-rw-r--r--fribidi_char_sets_iso8859_8.c2
-rw-r--r--fribidi_char_sets_iso8859_8.h29
-rw-r--r--fribidi_char_sets_utf8.c2
-rw-r--r--fribidi_char_sets_utf8.h23
-rw-r--r--fribidi_char_type.c2
-rw-r--r--fribidi_config.h.in14
-rw-r--r--fribidi_create_char_types.c4
-rw-r--r--fribidi_create_mirroring.c4
-rw-r--r--fribidi_main.c2
-rw-r--r--fribidi_mem.c6
-rw-r--r--fribidi_mem.h70
-rw-r--r--fribidi_mirroring.c2
-rw-r--r--fribidi_types.c2
-rw-r--r--fribidi_types.h91
-rw-r--r--fribidi_unicode.h26
-rw-r--r--fribidi_utils.c2
-rw-r--r--packtab.h22
40 files changed, 549 insertions, 313 deletions
diff --git a/ChangeLog b/ChangeLog
index a1349dc..b532eec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,25 @@
+2002-02-10 Behdad Esfahbod <behdad@bamdad.org>
+ * configure.in: Changed the version to 0.10.1pre.
+ * TODO: Done tasks removed.
+ * *.h: "extern C" stuff added.
+ * fribidi-config.in: Include path changed from @includedir@/fribidi
+ to @includedir@.
+ * fribidi.c: Set FRIBIDI_CHUNK_SIZE according to MEM_OPTIMIZED flag
+ to 16 or 128.
+ * fribidi.c, fribidi_unicode.h, conformance/test: Do not set
+ MAX_LEVEL to 15 if flag DEBUG defined, renamed to
+ UNI_MAX_BIDI_LEVEL and moved to fribidi_unicode.h, should not check
+ fribidi with debug-enabled reference code anymore. Updated
+ conformance/test to reflect this change.
+ * README: Sample input and output removed, refered to tests directory
+ * fribidi_config.h.in: Added, configure creates fribidi_config.h from
+ this.
+ * fribidi.spec.in: Added, configure creates fribidi.spec from this.
+ It can be used to create RPM packages.
+
2002-01-04 Roozbeh Pournader <roozbeh@sharif.edu>
* FriBidi 0.10.0 released.
- * configure.in: changed the version to 0.10.0.
+ * configure.in: Changed the version to 0.10.0.
2002-01-02 Behdad Esfahbod <behdad@bamdad.org>
* bootstrap: automake option -a added
diff --git a/Makefile.am b/Makefile.am
index 08d7a6d..e540d5b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -89,7 +89,9 @@ EXTRA_DIST = \
run.tests \
ANNOUNCE \
acinclude.m4 \
+ fribidi_config.h.in \
fribidi.pc.in \
+ fribidi.spec.in \
$(TEST_FILES) \
$(TABLE_FILES) \
$(UNIDATA_FILES) \
@@ -174,6 +176,6 @@ pkgconfig_DATA = fribidi.pc
CLEANFILES =
-DISTCLEANFILES = fribidi_tab_char_type_stamp fribidi_config.h
+DISTCLEANFILES = fribidi_tab_char_type_stamp
MAINTAINERCLEANFILES = Makefile.in configure aclocal.m4 config.h.in
diff --git a/README b/README
index 84f0705..9287145 100644
--- a/README
+++ b/README
@@ -32,7 +32,7 @@ Copyright
=========
Fribidi is:
Copyright (C) 1999,2000 Dov Grobgeld, and
-Copyright (C) 2001 Behdad Esfahbod.
+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
@@ -45,7 +45,7 @@ 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.LIB; if not, write to the
+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
@@ -125,32 +125,10 @@ calculated.
How it looks like
=================
-Here is the a part of the output of
-"fribidi --test --charset CapRTL tests/test-CapRTL"
-(assume CAPITAL letters as right to left, and numbers 7, 8, 9 as arabic):
-
-car is THE CAR in arabic => car is RAC EHT in arabic
-CAR IS the car IN ENGLISH => HSILGNE NI the car SI RAC
-he said "IT IS 123, 456, OK" => he said "KO ,456 ,123 SI TI"
-he said "IT IS (123, 456), OK" => he said "KO ,(456 ,123) SI TI"
-he said "IT IS 123,456, OK" => he said "KO ,123,456 SI TI"
-he said "IT IS (123,456), OK" => he said "KO ,(123,456) SI TI"
-HE SAID "it is 123, 456, ok" => "ok ,it is 123, 456" DIAS EH
-he said "IT IS 789, 678, OK" => he said "KO ,678 ,789 SI TI"
-he said "IT IS (789, 678), OK" => he said "KO ,(678 ,789) SI TI"
-he said "IT IS 789,678, OK" => he said "KO ,789,678 SI TI"
-he said "IT IS (789,678), OK" => he said "KO ,(789,678) SI TI"
-HE SAID "it is 789, 678, ok" => "ok ,678 ,789 it is" DIAS EH
-<H123>shalom</H123> => <123H/>shalom<123H>
-<h123>SAALAM</h123> => <h123>MALAAS</h123>
-HE SAID "it is a car!" AND RAN => NAR DNA "!it is a car" DIAS EH
-HE SAID "it is a car!_>" AND RAN => NAR DNA "it is a car!" DIAS EH
--2 CELSIUS IS COLD => DLOC SI SUISLEC 2-
-SOLVE 1*5 1-5 1/5 1+5 => 5+1 5/1 5-1 5*1 EVLOS
-THE RANGE IS 2.5..5 => 5..2.5 SI EGNAR EHT
-IOU $10 => $10 UOI
-CHANGE -10% => %10- EGNAHC
--10% CHANGE => EGNAHC %10-
+Have a look at tests directory, to see some input and outputs, which
+CapRTL charset means that CAPITAL letters are right to left, and digits
+6, 7, 8, 9 are Arabic digits, try 'fribidi --charsetdesc CapRTL' for the
+full description.
Executable
==========
diff --git a/TODO b/TODO
index 7b6df97..d04473f 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,10 @@
Implementation issues:
-* Update CapRTL with new Unicode reference version.
+* Add const keywords all over the source.
+
+* with --without-charsets, fribidi char set converters use iconv internally.
-* configure.in, Makefile.am: better check for downloader.
+* Update CapRTL with new Unicode reference version.
* Revise Reorder api, in fribidi_main.c reorder after link break.
@@ -14,15 +16,13 @@ Implementation issues:
* Fix iconv problem: Check for old iconvs (without wchar_t, without
byteorder UTF-32 or UCS-4 types).
-* On freebsd, the compiler needs -liconv, let configure do it.
-
-* FriBidiStrIndex should be defined to be uint32, at least internally,
- and maybe still have an interface with uint16.
+* When there is no glibc, libiconvs should be linked when --without-charset
+ is enabled.
* Design better apis to do reorder based on available levels, remove
explicit marks then calculate position maps, ....
-* Revise fribidi_util.c, add some functions, port other to support explicit
+* Revise fribidi_util.c, add some functions, update other to support explicit
marks, and too many embedding levels, eg. fribidi_map_range.
* Charset converters and fribidi_analyse change API to allocate mem if
diff --git a/configure.in b/configure.in
index ed4aaaa..261f413 100644
--- a/configure.in
+++ b/configure.in
@@ -1,8 +1,14 @@
AC_INIT(fribidi.c)
PACKAGE=fribidi
-VERSION=0.10.0
+VERSION=0.10.1pre
INTERFACE_VERSION=2
+dnl Release number for RPM spec file
+SPECRELEASE=1
+
+AC_SUBST(INTERFACE_VERSION)
+AC_SUBST(SPECRELEASE)
+
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
@@ -96,21 +102,6 @@ fi
echo "creating fribidi_tab_char_type_stamp"
echo "time-stamp" > fribidi_tab_char_type_stamp
-echo "creating fribidi_config.h"
-PACKAGE=$PACKAGE
-VERSION=$VERSION
-cat > fribidi_config.h <<EOF
-/* fribidi_config.h. Generated automatically by configure. */
-
-#define FRIBIDI_PACKAGE "$PACKAGE"
-
-#define FRIBIDI_VERSION "$VERSION"
-
-#define FRIBIDI_INTERFACE_VERSION $INTERFACE_VERSION
-#define FRIBIDI_INTERFACE_VERSION_STR "$INTERFACE_VERSION"
-
-
-EOF
dnl Check for configure options
@@ -161,13 +152,18 @@ AC_ARG_WITH(charsets, dnl
esac],[charsets=true])
if test x"$charsets" = xfalse; then
AC_DEFINE(FRIBIDI_NO_CHARSETS)
- echo "#define FRIBIDI_NO_CHARSETS 1" >> fribidi_config.h
+ FRIBIDI_NO_CHARSETS=1
+else
+ FRIBIDI_NO_CHARSETS=0
fi
+AC_SUBST(FRIBIDI_NO_CHARSETS)
AC_OUTPUT([
Makefile
+fribidi_config.h
fribidi-config
fribidi.pc
+fribidi.spec
],[case "$CONFIG_FILES" in
*fribidi-config*)chmod +x fribidi-config;;
esac])
diff --git a/conformance/test b/conformance/test
index 2229691..d2dccf9 100755
--- a/conformance/test
+++ b/conformance/test
@@ -10,11 +10,15 @@ if ! test -f "$path/../fribidi"; then
fi
if ! test -f "$path/reference/bidiref"; then
- if test -z "`echo -n | $path/../fribidi --debug 2>&1`"; then
- debug="-DDEBUGGING"
- else
- debug=""
- fi
+# fribidi does not set MAX_LEVEL to 15 if debug enabled, then reference
+# should not be compiled with debug enabled.
+
+# if test -z "`echo -n | $path/../fribidi --debug 2>&1`"; then
+# debug="-DDEBUGGING"
+# else
+# debug=""
+# fi
+ debug=""
g++ $debug -o $path/reference/bidiref $path/reference/bidiref.cpp
fi
diff --git a/fribidi-config.in b/fribidi-config.in
index fdd6c36..bf1edc7 100644
--- a/fribidi-config.in
+++ b/fribidi-config.in
@@ -70,7 +70,7 @@ if test "$echo_exec_prefix" = "yes"; then
fi
if test "$echo_cflags" = "yes"; then
- includes=-I@includedir@/fribidi
+ includes=-I@includedir@
echo $includes
fi
diff --git a/fribidi.c b/fribidi.c
index cf6c8b0..b13a002 100644
--- a/fribidi.c
+++ b/fribidi.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -31,9 +31,14 @@
#include <stdio.h>
#endif
+/* Redefine FRIBIDI_CHUNK_SIZE in config.h to override this. */
#ifndef FRIBIDI_CHUNK_SIZE
+#ifdef MEM_OPTIMIZED
+#define FRIBIDI_CHUNK_SIZE 16
+#else
#define FRIBIDI_CHUNK_SIZE 128
#endif
+#endif
#ifdef DEBUG
#define DBG(s) if (fribidi_debug) { fprintf(stderr, s); }
@@ -44,14 +49,6 @@
#endif
#ifdef DEBUG
-/* for easier test with the reference code only */
-#define MAX_LEVEL 15
-#else
-/* default value */
-#define MAX_LEVEL 61
-#endif
-
-#ifdef DEBUG
char fribidi_char_from_type (FriBidiCharType c);
#endif
@@ -431,20 +428,20 @@ compact_neutrals (TypeLink *list)
*-------------------------------------------------------------------------*/
/* There's some little points in pushing and poping into the status stack:
- 1. when the embedding level is not valid (more than MAX_LEVEL=61),
+ 1. when the embedding level is not valid (more than UNI_MAX_BIDI_LEVEL=61),
you must reject it, and not to push into the stack, but when you see a
PDF, you must find the matching code, and if it was pushed in the stack,
pop it, it means you must pop if and only if you have pushed the
matching code, the over_pushed var counts the number of rejected codes yet.
2. there's a more confusing point too, when the embedding level is exactly
- MAX_LEVEL-1=60, an LRO or LRE must be rejected because the new level would
- be MAX_LEVEL+1=62, that is invalid, but an RLO or RLE must be accepted
- because the new level is MAX_LEVEL=61, that is valid, so the rejected
- codes may be not continuous in the logical order, in fact there is at
- most two continuous intervals of codes, with a RLO or RLE between them.
- to support the case, the first_interval var counts the number of rejected
- codes in the first interval, when it is 0, means that there is only one
- interval yet.
+ UNI_MAX_BIDI_LEVEL-1=60, an LRO or LRE must be rejected because the new
+ level would be UNI_MAX_BIDI_LEVEL+1=62, that is invalid, but an RLO or RLE
+ must be accepted because the new level is UNI_MAX_BIDI_LEVEL=61, that is
+ valid, so the rejected codes may be not continuous in the logical order,
+ in fact there is at most two continuous intervals of codes, with a RLO or
+ RLE between them. To support this case, the first_interval var counts the
+ number of rejected codes in the first interval, when it is 0, means that
+ there is only one interval yet.
*/
/* a. If this new level would be valid, then this embedding code is valid.
@@ -456,9 +453,9 @@ compact_neutrals (TypeLink *list)
*/
#define PUSH_STATUS \
{ \
- if (new_level <= MAX_LEVEL) \
+ if (new_level <= UNI_MAX_BIDI_LEVEL) \
{ \
- if (level == MAX_LEVEL - 1) \
+ if (level == UNI_MAX_BIDI_LEVEL - 1) \
first_interval = over_pushed; \
status_stack[stack_size].level = level; \
status_stack[stack_size].override = override; \
@@ -678,7 +675,7 @@ fribidi_analyse_string ( /* input */
over_pushed = 0;
first_interval = 0;
status_stack =
- (LevelInfo *) malloc (sizeof (LevelInfo) * (MAX_LEVEL + 2));
+ (LevelInfo *) malloc (sizeof (LevelInfo) * (UNI_MAX_BIDI_LEVEL + 2));
for (pp = type_rl_list->next; pp->next; pp = pp->next)
{
@@ -1364,12 +1361,7 @@ fribidi_log2vis_get_embedding_levels ( /* input */
-
-
-
-
-
-char *fribidi_version_info =
+const char *fribidi_version_info =
FRIBIDI_PACKAGE " " FRIBIDI_VERSION " (interface version "
FRIBIDI_INTERFACE_VERSION_STR ")\n"
"Copyright (C) 2001 FriBidi Project (http://fribidi.sf.net/).\n" "\n"
@@ -1381,7 +1373,7 @@ char *fribidi_version_info =
#ifdef DEBUG
"--enable-debug\n"
#endif
-#if (defined(MEM_OPTIMIZED))
+#ifdef MEM_OPTIMIZED
"--enable-memopt\n"
#endif
#ifdef USE_SIMPLE_MALLOC
diff --git a/fribidi.h b/fribidi.h
index d7db643..fb84f13 100644
--- a/fribidi.h
+++ b/fribidi.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -24,11 +24,6 @@
#ifndef FRIBIDI_H
#define FRIBIDI_H
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
#include "fribidi_config.h"
#include "fribidi_unicode.h"
#include "fribidi_mem.h"
@@ -37,6 +32,11 @@ extern "C"
#include "fribidi_char_sets.h"
#endif
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
boolean fribidi_log2vis ( /* input */
FriBidiChar *str, FriBidiStrIndex len,
FriBidiCharType *pbase_dirs,
@@ -240,7 +240,7 @@ extern "C"
FriBidiList **visual_runs);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/fribidi.spec.in b/fribidi.spec.in
new file mode 100644
index 0000000..88f306e
--- /dev/null
+++ b/fribidi.spec.in
@@ -0,0 +1,118 @@
+# This spec file creates three packages:
+#
+# Everything:
+# (this is equivalent to two others together)
+# fribidi-version-release-arch.rpm
+# Runtime material: Shared library and command line tool
+# libfribidi-version-release-arch.rpm
+# Development material: Static library and header files
+# (requires libfribidi)
+# libfribidi-devel-version-release-arch.rpm
+
+%define name @PACKAGE@
+%define ver @VERSION@
+%define rel @SPECRELEASE@
+
+%define prefix %{_prefix}
+
+Name: %{name}
+Version: %{ver}
+Release: %{rel}
+Copyright: LGPL
+Source: http://telia.dl.sourceforge.net/fribidi/%{name}-%{ver}.tar.gz
+URL: http://fribidi.sourceforge.net/
+BuildRoot: %{_tmppath}/%{name}
+
+Summary: Library implementing the Unicode Bidirectional Algorithm
+Group: System/Libraries
+Provides: libfribidi
+Provides: libfribidi-devel
+%description
+A library to handle bidirectional scripts (eg. hebrew, arabic), so that
+the display is done in the proper way; while the text data itself is
+always written in logical order.
+
+Install %{name} if you want to run or develop programs that use %{name}.
+
+
+%package -n lib%{name}
+Summary: Library implementing the Unicode Bidirectional Algorithm
+Group: System/Libraries
+Conflicts: lib%{name}-devel < %{ver}
+Conflicts: lib%{name}-devel > %{ver}
+%description -n lib%{name}
+The lib%{name} package includes the shared libraries for the %{name} package.
+
+Install lib%{name} if you want to run programs which use %{name}.
+
+
+%package -n lib%{name}-devel
+Summary: Library implementing the Unicode Bidirectional Algorithm
+Group: Development/C
+Requires: lib%{name} = %{ver}
+%description -n lib%{name}-devel
+The lib%{name}-devel package includes the static libraries and header files
+for the %{name} package.
+
+Install lib%{name}-devel if you want to develop programs which will use
+%{name}.
+
+
+%prep
+%setup
+
+%build
+if [ ! -x ./configure ];then
+./bootstrap
+fi
+%configure
+make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+
+%makeinstall
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%post -n lib%{name} -p /sbin/ldconfig
+%postun -n lib%{name} -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root)
+%doc README AUTHORS COPYING ChangeLog TODO THANKS NEWS
+%{_bindir}/%{name}
+%{_bindir}/%{name}-config
+%{_libdir}/*.so.*
+%{_libdir}/pkgconfig/%{name}.pc
+%{_libdir}/*.a
+%{_libdir}/*.la
+%{_libdir}/*.so
+%{_includedir}/*
+
+%files -n lib%{name}
+%defattr(-, root, root)
+%doc README AUTHORS COPYING ChangeLog TODO THANKS NEWS
+%{_bindir}/%{name}
+%{_bindir}/%{name}-config
+%{_libdir}/*.so.*
+%{_libdir}/pkgconfig/%{name}.pc
+
+%files -n lib%{name}-devel
+%defattr(-, root, root)
+%{_libdir}/*.a
+%{_libdir}/*.la
+%{_libdir}/*.so
+%{_includedir}/*
+
+
+%changelog
+
+* Wed Jan 9 2002 Behdad Esfahbod <behdad@bamdad.org>
+- First spec released.
diff --git a/fribidi_benchmark.c b/fribidi_benchmark.c
index 37bb733..ad7ed1d 100644
--- a/fribidi_benchmark.c
+++ b/fribidi_benchmark.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets.c b/fribidi_char_sets.c
index 18d29b6..33abf77 100644
--- a/fribidi_char_sets.c
+++ b/fribidi_char_sets.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets.h b/fribidi_char_sets.h
index a9372c0..22936b2 100644
--- a/fribidi_char_sets.h
+++ b/fribidi_char_sets.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,6 +29,11 @@
#include "fribidi.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include "fribidi_char_sets_cap_rtl.h"
#include "fribidi_char_sets_utf8.h"
#include "fribidi_char_sets_iso8859_6.h"
@@ -42,67 +47,68 @@
FRIBIDI_CHARSET_DEFAULT is the one that when a charset leaves it's
state with fribidi_charset_leave(), it gets into DEFAULT mode,
so it must have no initialization. */
-typedef enum
-{
- FRIBIDI_CHARSET_NOT_FOUND,
- FRIBIDI_CHARSET_UTF8,
- FRIBIDI_CHARSET_CAP_RTL,
- FRIBIDI_CHARSET_ISO8859_6,
- FRIBIDI_CHARSET_ISO8859_8,
- FRIBIDI_CHARSET_CP1255,
- FRIBIDI_CHARSET_CP1256,
- FRIBIDI_CHARSET_ISIRI_3342,
-
- FRIBIDI_CHAR_SETS_NUM_PLUS_ONE,
-
- FRIBIDI_CHARSET_DEFAULT = FRIBIDI_CHARSET_UTF8
-}
-FriBidiCharSet;
+ typedef enum
+ {
+ FRIBIDI_CHARSET_NOT_FOUND,
+ FRIBIDI_CHARSET_UTF8,
+ FRIBIDI_CHARSET_CAP_RTL,
+ FRIBIDI_CHARSET_ISO8859_6,
+ FRIBIDI_CHARSET_ISO8859_8,
+ FRIBIDI_CHARSET_CP1255,
+ FRIBIDI_CHARSET_CP1256,
+ FRIBIDI_CHARSET_ISIRI_3342,
+
+ FRIBIDI_CHAR_SETS_NUM_PLUS_ONE,
+
+ FRIBIDI_CHARSET_DEFAULT = FRIBIDI_CHARSET_UTF8
+ }
+ FriBidiCharSet;
#define FRIBIDI_CHAR_SETS_NUM (FRIBIDI_CHAR_SETS_NUM_PLUS_ONE - 1)
/* Convert the character string "s" in charset "char_set" to unicode
string "us" and return it's length. */
-int fribidi_charset_to_unicode (FriBidiCharSet char_set, char *s, int length,
- /* output */
- FriBidiChar *us);
+ int fribidi_charset_to_unicode (FriBidiCharSet char_set, char *s,
+ int length,
+ /* output */
+ FriBidiChar *us);
/* Convert the unicode string "us" with length "length" to character
string "s" in charset "char_set" and return it's length. */
-int fribidi_unicode_to_charset (FriBidiCharSet char_set, FriBidiChar *us,
- int length,
- /* output */
- char *s);
+ int fribidi_unicode_to_charset (FriBidiCharSet char_set, FriBidiChar *us,
+ int length,
+ /* output */
+ char *s);
/* Return the string containing the name of the charset. */
-char *fribidi_char_set_name (FriBidiCharSet char_set);
+ char *fribidi_char_set_name (FriBidiCharSet char_set);
/* Return the string containing the title (name with a short description)
of the charset. */
-char *fribidi_char_set_title (FriBidiCharSet char_set);
+ char *fribidi_char_set_title (FriBidiCharSet char_set);
/* Return the string containing a descreption about the charset, if any. */
-char *fribidi_char_set_desc (FriBidiCharSet char_set);
+ char *fribidi_char_set_desc (FriBidiCharSet char_set);
/* Some charsets like CapRTL may need to change some fribidis tables, by
calling this function, they can do this changes. */
-boolean fribidi_char_set_enter (FriBidiCharSet char_set);
+ boolean fribidi_char_set_enter (FriBidiCharSet char_set);
/* Some charsets like CapRTL may need to change some fribidis tables, by
calling this function, they can undo their changes, perhaps to enter
another mode. */
-boolean fribidi_char_set_leave (FriBidiCharSet char_set);
+ boolean fribidi_char_set_leave (FriBidiCharSet char_set);
/* Return the charset which name is "s". */
-FriBidiCharSet fribidi_parse_charset (char *s);
+ FriBidiCharSet fribidi_parse_charset (char *s);
#ifdef FRIBIDI_INTERFACE_1
/* Interface version 1, deprecated, just for compatibility. */
-int fribidi_charset_to_unicode_1 (FriBidiCharSet char_set, char *s,
- /* output */
- FriBidiChar *us);
+ int fribidi_charset_to_unicode_1 (FriBidiCharSet char_set, char *s,
+ /* output */
+ FriBidiChar *us);
#define fribidi_charset_to_unicode fribidi_charset_to_unicode_1
/* Also old character sets. */
@@ -116,14 +122,19 @@ int fribidi_charset_to_unicode_1 (FriBidiCharSet char_set, char *s,
#define FRIBIDI_TO_UNICODE_DECLARE_1(cs) \
int fribidi_##cs##_to_unicode_1 (char *s, FriBidiChar *us);
-FRIBIDI_TO_UNICODE_DECLARE_1 (utf8)
-FRIBIDI_TO_UNICODE_DECLARE_1 (cap_rtl)
-FRIBIDI_TO_UNICODE_DECLARE_1 (iso8859_6)
-FRIBIDI_TO_UNICODE_DECLARE_1 (iso8859_8)
-FRIBIDI_TO_UNICODE_DECLARE_1 (cp1255)
-FRIBIDI_TO_UNICODE_DECLARE_1 (cp1256)
-FRIBIDI_TO_UNICODE_DECLARE_1 (isiri_3342)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (utf8)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (cap_rtl)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (iso8859_6)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (iso8859_8)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (cp1255)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (cp1256)
+ FRIBIDI_TO_UNICODE_DECLARE_1 (isiri_3342)
#undef FRIBIDI_TO_UNICODE_DECLARE_1
-#endif /* FRIBIDI_INTERFACE_1 */
-#endif /* FRIBIDI_CHAR_SETS_H */
+#endif /* FRIBIDI_INTERFACE_1 */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FRIBIDI_CHAR_SETS_H */
+
#endif
diff --git a/fribidi_char_sets_cap_rtl.c b/fribidi_char_sets_cap_rtl.c
index 3e58e30..3ba6bcf 100644
--- a/fribidi_char_sets_cap_rtl.c
+++ b/fribidi_char_sets_cap_rtl.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_cap_rtl.h b/fribidi_char_sets_cap_rtl.h
index 67d603c..f20522e 100644
--- a/fribidi_char_sets_cap_rtl.h
+++ b/fribidi_char_sets_cap_rtl.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,19 +29,28 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_cap_rtl "CapRTL"
#define fribidi_char_set_title_cap_rtl "CapRTL (Test)"
-char *fribidi_char_set_desc_cap_rtl (void);
-boolean fribidi_char_set_enter_cap_rtl (void);
-boolean fribidi_char_set_leave_cap_rtl (void);
-
-int fribidi_cap_rtl_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
-int fribidi_unicode_to_cap_rtl (FriBidiChar *us, int length,
- /* Output */
- char *s);
-
-#endif /* FRIBIDI_CHAR_SETS_CAP_RTL_H */
+ char *fribidi_char_set_desc_cap_rtl (void);
+ boolean fribidi_char_set_enter_cap_rtl (void);
+ boolean fribidi_char_set_leave_cap_rtl (void);
+
+ int fribidi_cap_rtl_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+ int fribidi_unicode_to_cap_rtl (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FRIBIDI_CHAR_SETS_CAP_RTL_H */
#endif
diff --git a/fribidi_char_sets_cp1255.c b/fribidi_char_sets_cp1255.c
index b9e0b8a..57b8d55 100644
--- a/fribidi_char_sets_cp1255.c
+++ b/fribidi_char_sets_cp1255.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_cp1255.h b/fribidi_char_sets_cp1255.h
index 662a343..758a7ec 100644
--- a/fribidi_char_sets_cp1255.h
+++ b/fribidi_char_sets_cp1255.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,21 +29,30 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_cp1255 "CP1255"
#define fribidi_char_set_title_cp1255 "CP1255 (Hebrew/Yiddish)"
#define fribidi_char_set_desc_cp1255 NULL
#define fribidi_char_set_enter_cp1255 NULL
#define fribidi_char_set_leave_cp1255 NULL
-FriBidiChar fribidi_cp1255_to_unicode_c (char ch);
-int fribidi_cp1255_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
-char fribidi_unicode_to_cp1255_c (FriBidiChar uch);
-int fribidi_unicode_to_cp1255 (FriBidiChar *us, int length,
- /* Output */
- char *s);
+ FriBidiChar fribidi_cp1255_to_unicode_c (char ch);
+ int fribidi_cp1255_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+ char fribidi_unicode_to_cp1255_c (FriBidiChar uch);
+ int fribidi_unicode_to_cp1255 (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* FRIBIDI_CHAR_SETS_CP1255_H */
+#endif /* FRIBIDI_CHAR_SETS_CP1255_H */
#endif
diff --git a/fribidi_char_sets_cp1256.c b/fribidi_char_sets_cp1256.c
index 7b1af49..c687319 100644
--- a/fribidi_char_sets_cp1256.c
+++ b/fribidi_char_sets_cp1256.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_cp1256.h b/fribidi_char_sets_cp1256.h
index 0f0b420..77e70d8 100644
--- a/fribidi_char_sets_cp1256.h
+++ b/fribidi_char_sets_cp1256.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,21 +29,30 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_cp1256 "CP1256"
#define fribidi_char_set_title_cp1256 "CP1256 (MS-Arabic)"
#define fribidi_char_set_desc_cp1256 NULL
#define fribidi_char_set_enter_cp1256 NULL
#define fribidi_char_set_leave_cp1256 NULL
-FriBidiChar fribidi_cp1256_to_unicode_c (char ch);
-int fribidi_cp1256_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
-char fribidi_unicode_to_cp1256_c (FriBidiChar uch);
-int fribidi_unicode_to_cp1256 (FriBidiChar *us, int length,
- /* Output */
- char *s);
+ FriBidiChar fribidi_cp1256_to_unicode_c (char ch);
+ int fribidi_cp1256_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+ char fribidi_unicode_to_cp1256_c (FriBidiChar uch);
+ int fribidi_unicode_to_cp1256 (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* FRIBIDI_CHAR_SETS_CP1256_H */
+#endif /* FRIBIDI_CHAR_SETS_CP1256_H */
#endif
diff --git a/fribidi_char_sets_isiri_3342.c b/fribidi_char_sets_isiri_3342.c
index d380cbc..88d4360 100644
--- a/fribidi_char_sets_isiri_3342.c
+++ b/fribidi_char_sets_isiri_3342.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_isiri_3342.h b/fribidi_char_sets_isiri_3342.h
index 25d250b..69e4245 100644
--- a/fribidi_char_sets_isiri_3342.h
+++ b/fribidi_char_sets_isiri_3342.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,21 +29,30 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_isiri_3342 "ISIRI-3342"
#define fribidi_char_set_title_isiri_3342 "ISIRI 3342 (Persian)"
#define fribidi_char_set_desc_isiri_3342 NULL
#define fribidi_char_set_enter_isiri_3342 NULL
#define fribidi_char_set_leave_isiri_3342 NULL
-FriBidiChar fribidi_isiri_3342_to_unicode_c (char ch);
-int fribidi_isiri_3342_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
-char fribidi_unicode_to_isiri_3342_c (FriBidiChar uch);
-int fribidi_unicode_to_isiri_3342 (FriBidiChar *us, int length,
- /* Output */
- char *s);
+ FriBidiChar fribidi_isiri_3342_to_unicode_c (char ch);
+ int fribidi_isiri_3342_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+ char fribidi_unicode_to_isiri_3342_c (FriBidiChar uch);
+ int fribidi_unicode_to_isiri_3342 (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* FRIBIDI_CHAR_SETS_ISIRI_3342_H */
+#endif /* FRIBIDI_CHAR_SETS_ISIRI_3342_H */
#endif
diff --git a/fribidi_char_sets_iso8859_6.c b/fribidi_char_sets_iso8859_6.c
index 6a0d584..f30d54d 100644
--- a/fribidi_char_sets_iso8859_6.c
+++ b/fribidi_char_sets_iso8859_6.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_iso8859_6.h b/fribidi_char_sets_iso8859_6.h
index 9a64df6..9227036 100644
--- a/fribidi_char_sets_iso8859_6.h
+++ b/fribidi_char_sets_iso8859_6.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,21 +29,30 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_iso8859_6 "ISO8859-6"
#define fribidi_char_set_title_iso8859_6 "ISO 8859-6 (Arabic)"
#define fribidi_char_set_desc_iso8859_6 NULL
#define fribidi_char_set_enter_iso8859_6 NULL
#define fribidi_char_set_leave_iso8859_6 NULL
-FriBidiChar fribidi_iso8859_6_to_unicode_c (char ch);
-int fribidi_iso8859_6_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
-char fribidi_unicode_to_iso8859_6_c (FriBidiChar uch);
-int fribidi_unicode_to_iso8859_6 (FriBidiChar *us, int length,
- /* Output */
- char *s);
+ FriBidiChar fribidi_iso8859_6_to_unicode_c (char ch);
+ int fribidi_iso8859_6_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+ char fribidi_unicode_to_iso8859_6_c (FriBidiChar uch);
+ int fribidi_unicode_to_iso8859_6 (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* FRIBIDI_CHAR_SETS_ISO8859_6_H */
+#endif /* FRIBIDI_CHAR_SETS_ISO8859_6_H */
#endif
diff --git a/fribidi_char_sets_iso8859_8.c b/fribidi_char_sets_iso8859_8.c
index b826fe9..0cbe9d0 100644
--- a/fribidi_char_sets_iso8859_8.c
+++ b/fribidi_char_sets_iso8859_8.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_iso8859_8.h b/fribidi_char_sets_iso8859_8.h
index 300e360..ee49429 100644
--- a/fribidi_char_sets_iso8859_8.h
+++ b/fribidi_char_sets_iso8859_8.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,21 +29,30 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_iso8859_8 "ISO8859-8"
#define fribidi_char_set_title_iso8859_8 "ISO 8859-8 (Hebrew)"
#define fribidi_char_set_desc_iso8859_8 NULL
#define fribidi_char_set_enter_iso8859_8 NULL
#define fribidi_char_set_leave_iso8859_8 NULL
-FriBidiChar fribidi_iso8859_8_to_unicode_c (char ch);
-int fribidi_iso8859_8_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
-char fribidi_unicode_to_iso8859_8_c (FriBidiChar uch);
-int fribidi_unicode_to_iso8859_8 (FriBidiChar *us, int length,
- /* Output */
- char *s);
+ FriBidiChar fribidi_iso8859_8_to_unicode_c (char ch);
+ int fribidi_iso8859_8_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+ char fribidi_unicode_to_iso8859_8_c (FriBidiChar uch);
+ int fribidi_unicode_to_iso8859_8 (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* FRIBIDI_CHAR_SETS_ISO8859_8_H */
+#endif /* FRIBIDI_CHAR_SETS_ISO8859_8_H */
#endif
diff --git a/fribidi_char_sets_utf8.c b/fribidi_char_sets_utf8.c
index c8c3bfb..8537fd5 100644
--- a/fribidi_char_sets_utf8.c
+++ b/fribidi_char_sets_utf8.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_char_sets_utf8.h b/fribidi_char_sets_utf8.h
index 250e577..079ea62 100644
--- a/fribidi_char_sets_utf8.h
+++ b/fribidi_char_sets_utf8.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -29,22 +29,31 @@
#include "fribidi_types.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define fribidi_char_set_name_utf8 "UTF-8"
#define fribidi_char_set_title_utf8 "UTF-8 (Unicode)"
#define fribidi_char_set_desc_utf8 NULL
#define fribidi_char_set_enter_utf8 NULL
#define fribidi_char_set_leave_utf8 NULL
-int fribidi_unicode_to_utf8 (FriBidiChar *us, int length,
- /* Output */
- char *s);
+ int fribidi_unicode_to_utf8 (FriBidiChar *us, int length,
+ /* Output */
+ char *s);
/* warning: the length of output string may exceed the length of the input */
/* the length of the string is returned */
-int fribidi_utf8_to_unicode (char *s, int length,
- /* Output */
- FriBidiChar *us);
+ int fribidi_utf8_to_unicode (char *s, int length,
+ /* Output */
+ FriBidiChar *us);
+#ifdef __cplusplus
+}
#endif
+#endif /* FRIBIDI_CHAR_SETS_UTF8_H */
+
#endif
diff --git a/fribidi_char_type.c b/fribidi_char_type.c
index 0424897..2d172fd 100644
--- a/fribidi_char_type.c
+++ b/fribidi_char_type.c
@@ -1,5 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_config.h.in b/fribidi_config.h.in
new file mode 100644
index 0000000..2f4dcca
--- /dev/null
+++ b/fribidi_config.h.in
@@ -0,0 +1,14 @@
+
+#define FRIBIDI_PACKAGE "@PACKAGE@"
+
+#define FRIBIDI_VERSION "@VERSION@"
+
+#define FRIBIDI_INTERFACE_VERSION @INTERFACE_VERSION@
+#define FRIBIDI_INTERFACE_VERSION_STR "@INTERFACE_VERSION@"
+
+#if @FRIBIDI_NO_CHARSETS@
+#define FRIBIDI_NO_CHARSETS 1
+#else
+#undef FRIBIDI_NO_CHARSETS
+#endif
+
diff --git a/fribidi_create_char_types.c b/fribidi_create_char_types.c
index b427197..51a1b58 100644
--- a/fribidi_create_char_types.c
+++ b/fribidi_create_char_types.c
@@ -1,5 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -12,7 +12,7 @@
* 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.LIB; if not, write to the
+ * 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
*
diff --git a/fribidi_create_mirroring.c b/fribidi_create_mirroring.c
index e1562d5..39e44ea 100644
--- a/fribidi_create_mirroring.c
+++ b/fribidi_create_mirroring.c
@@ -1,5 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -12,7 +12,7 @@
* 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.LIB; if not, write to the
+ * 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
*
diff --git a/fribidi_main.c b/fribidi_main.c
index 140246a..6dffe92 100644
--- a/fribidi_main.c
+++ b/fribidi_main.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_mem.c b/fribidi_mem.c
index eea0ed4..73bcadd 100644
--- a/fribidi_mem.c
+++ b/fribidi_mem.c
@@ -1,6 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -17,8 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA
*
- * For licensing issues, contact <dov@imagic.weizmann.ac.il> and
- * <fwpg@sharif.edu>.
+ * For licensing issues, contact <fwpg@sharif.edu>.
*/
#include <string.h>
diff --git a/fribidi_mem.h b/fribidi_mem.h
index 95d725b..ba0ab5f 100644
--- a/fribidi_mem.h
+++ b/fribidi_mem.h
@@ -1,6 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 1999,2000 Dov FriBidirobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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 FriBidieneral Public
@@ -17,56 +16,59 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA
*
- * For licensing issues, contact <dov@imagic.weizmann.ac.il> and
- * <fwpg@sharif.edu>.
+ * For licensing issues, contact <fwpg@sharif.edu>.
*/
-#ifndef _FRIBIDI_MEM_H
-#define _FRIBIDI_MEM_H
+#ifndef FRIBIDI_MEM_H
+#define FRIBIDI_MEM_H
#include <stdlib.h>
-#include <limits.h>
#include "fribidi_config.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define INT8 char
#define INT16 short
#define INT32 long
-typedef int boolean;
+ typedef int boolean;
-typedef signed INT8 int8;
-typedef unsigned INT8 uint8;
-typedef signed INT16 int16;
-typedef unsigned INT16 uint16;
-typedef signed INT32 int32;
-typedef unsigned INT32 uint32;
+ typedef signed INT8 int8;
+ typedef unsigned INT8 uint8;
+ typedef signed INT16 int16;
+ typedef unsigned INT16 uint16;
+ typedef signed INT32 int32;
+ typedef unsigned INT32 uint32;
#define TRUE 1
#define FALSE 0
-typedef struct _FriBidiList FriBidiList;
-struct _FriBidiList
-{
- void *data;
- FriBidiList *next;
- FriBidiList *prev;
-};
+ typedef struct _FriBidiList FriBidiList;
+ struct _FriBidiList
+ {
+ void *data;
+ FriBidiList *next;
+ FriBidiList *prev;
+ };
-FriBidiList *fribidi_list_append (FriBidiList *list, void *data);
+ FriBidiList *fribidi_list_append (FriBidiList *list, void *data);
-typedef struct _FriBidiMemChunk FriBidiMemChunk;
+ typedef struct _FriBidiMemChunk FriBidiMemChunk;
#define FRIBIDI_ALLOC_ONLY 1
#define FRIBIDI_ALLOC_AND_FREE 2
-FriBidiMemChunk *fribidi_mem_chunk_new (char *name,
- int atom_size,
- unsigned long area_size, int type);
-void fribidi_mem_chunk_destroy (FriBidiMemChunk *mem_chunk);
-void *fribidi_mem_chunk_alloc (FriBidiMemChunk *mem_chunk);
-void *fribidi_mem_chunk_alloc0 (FriBidiMemChunk *mem_chunk);
-void fribidi_mem_chunk_free (FriBidiMemChunk *mem_chunk, void *mem);
+ FriBidiMemChunk *fribidi_mem_chunk_new (char *name,
+ int atom_size,
+ unsigned long area_size, int type);
+ void fribidi_mem_chunk_destroy (FriBidiMemChunk *mem_chunk);
+ void *fribidi_mem_chunk_alloc (FriBidiMemChunk *mem_chunk);
+ void *fribidi_mem_chunk_alloc0 (FriBidiMemChunk *mem_chunk);
+ void fribidi_mem_chunk_free (FriBidiMemChunk *mem_chunk, void *mem);
#define fribidi_mem_chunk_create(type, pre_alloc, alloc_type) ( \
fribidi_mem_chunk_new (#type " mem chunks (" #pre_alloc ")", \
@@ -78,6 +80,10 @@ void fribidi_mem_chunk_free (FriBidiMemChunk *mem_chunk, void *mem);
(type *) fribidi_mem_chunk_alloc (chunk) \
)
-int fribidi_strcasecmp (const char *s1, const char *s2);
+ int fribidi_strcasecmp (const char *s1, const char *s2);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* _FRIBIDI_MEM_H */
+#endif /* FRIBIDI_MEM_H */
diff --git a/fribidi_mirroring.c b/fribidi_mirroring.c
index 4fa9988..8f28134 100644
--- a/fribidi_mirroring.c
+++ b/fribidi_mirroring.c
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_types.c b/fribidi_types.c
index 7e6a788..8cfdbec 100644
--- a/fribidi_types.c
+++ b/fribidi_types.c
@@ -1,5 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
diff --git a/fribidi_types.h b/fribidi_types.h
index 0b72d11..61fef35 100644
--- a/fribidi_types.h
+++ b/fribidi_types.h
@@ -1,6 +1,6 @@
/* FriBidi - Library of BiDi algorithm
* Copyright (C) 1999,2000 Dov Grobgeld, and
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -25,21 +25,26 @@
#include "fribidi_mem.h"
-typedef int8 FriBidiLevel;
-typedef uint32 FriBidiChar;
-typedef int FriBidiStrIndex;
-typedef int32 FriBidiMaskType;
-typedef FriBidiMaskType FriBidiCharType;
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ typedef int8 FriBidiLevel;
+ typedef uint32 FriBidiChar;
+ typedef int FriBidiStrIndex;
+ typedef int32 FriBidiMaskType;
+ typedef FriBidiMaskType FriBidiCharType;
-char *fribidi_type_name (FriBidiCharType c);
+ char *fribidi_type_name (FriBidiCharType c);
/* The following type is used by fribidi_utils */
-typedef struct
-{
- int length;
- void *attribute;
-}
-FriBidiRunType;
+ typedef struct
+ {
+ int length;
+ void *attribute;
+ }
+ FriBidiRunType;
#ifndef FRIBIDI_MAX_STRING_LENGTH
#define FRIBIDI_MAX_STRING_LENGTH (sizeof (FriBidiStrIndex) == 2 ? \
@@ -266,35 +271,39 @@ FriBidiRunType;
* define them to be 0, 1, 2, ... and then in fribidi_get_type.c map them
* to FriBidiCharTypes.
*/
-typedef char FriBidiPropCharType;
-
-enum FriBidiPropEnum
-{
- FRIBIDI_PROP_TYPE_LTR, /* Strong left to right */
- FRIBIDI_PROP_TYPE_RTL, /* Right to left characters */
- FRIBIDI_PROP_TYPE_AL, /* Arabic characters */
- FRIBIDI_PROP_TYPE_LRE, /* Left-To-Right embedding */
- FRIBIDI_PROP_TYPE_RLE, /* Right-To-Left embedding */
- FRIBIDI_PROP_TYPE_LRO, /* Left-To-Right override */
- FRIBIDI_PROP_TYPE_RLO, /* Right-To-Left override */
- FRIBIDI_PROP_TYPE_PDF, /* Pop directional override */
- FRIBIDI_PROP_TYPE_EN, /* European digit */
- FRIBIDI_PROP_TYPE_AN, /* Arabic digit */
- FRIBIDI_PROP_TYPE_ES, /* European number separator */
- FRIBIDI_PROP_TYPE_ET, /* European number terminator */
- FRIBIDI_PROP_TYPE_CS, /* Common Separator */
- FRIBIDI_PROP_TYPE_NSM, /* Non spacing mark */
- FRIBIDI_PROP_TYPE_BN, /* Boundary neutral */
- FRIBIDI_PROP_TYPE_BS, /* Block separator */
- FRIBIDI_PROP_TYPE_SS, /* Segment separator */
- FRIBIDI_PROP_TYPE_WS, /* Whitespace */
- FRIBIDI_PROP_TYPE_ON, /* Other Neutral */
- FRIBIDI_PROP_TYPE_WL, /* Weak left to right */
- FRIBIDI_PROP_TYPE_WR, /* Weak right to left */
- FRIBIDI_TYPES_COUNT /* Number of different character types */
-};
+ typedef char FriBidiPropCharType;
+
+ enum FriBidiPropEnum
+ {
+ FRIBIDI_PROP_TYPE_LTR, /* Strong left to right */
+ FRIBIDI_PROP_TYPE_RTL, /* Right to left characters */
+ FRIBIDI_PROP_TYPE_AL, /* Arabic characters */
+ FRIBIDI_PROP_TYPE_LRE, /* Left-To-Right embedding */
+ FRIBIDI_PROP_TYPE_RLE, /* Right-To-Left embedding */
+ FRIBIDI_PROP_TYPE_LRO, /* Left-To-Right override */
+ FRIBIDI_PROP_TYPE_RLO, /* Right-To-Left override */
+ FRIBIDI_PROP_TYPE_PDF, /* Pop directional override */
+ FRIBIDI_PROP_TYPE_EN, /* European digit */
+ FRIBIDI_PROP_TYPE_AN, /* Arabic digit */
+ FRIBIDI_PROP_TYPE_ES, /* European number separator */
+ FRIBIDI_PROP_TYPE_ET, /* European number terminator */
+ FRIBIDI_PROP_TYPE_CS, /* Common Separator */
+ FRIBIDI_PROP_TYPE_NSM, /* Non spacing mark */
+ FRIBIDI_PROP_TYPE_BN, /* Boundary neutral */
+ FRIBIDI_PROP_TYPE_BS, /* Block separator */
+ FRIBIDI_PROP_TYPE_SS, /* Segment separator */
+ FRIBIDI_PROP_TYPE_WS, /* Whitespace */
+ FRIBIDI_PROP_TYPE_ON, /* Other Neutral */
+ FRIBIDI_PROP_TYPE_WL, /* Weak left to right */
+ FRIBIDI_PROP_TYPE_WR, /* Weak right to left */
+ FRIBIDI_TYPES_COUNT /* Number of different character types */
+ };
/* Map fribidi_prop_types to fribidi_types */
-extern FriBidiCharType *fribidi_prop_to_type;
+ extern FriBidiCharType *fribidi_prop_to_type;
+
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/fribidi_unicode.h b/fribidi_unicode.h
index aba927d..5447d8d 100644
--- a/fribidi_unicode.h
+++ b/fribidi_unicode.h
@@ -1,5 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 2001 Behdad Esfahbod.
+ * 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
@@ -19,15 +19,23 @@
* For licensing issues, contact <fwpg@sharif.edu>.
*/
-#include "fribidi_types.h"
-
#ifndef FRIBIDI_UNICODE_H
#define FRIBIDI_UNICODE_H
+#include "fribidi_types.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
/* Unicode version */
#define FRIBIDI_UNICODE_CHARS 0x110000
#define FRIBIDI_UNICODE_VERSION "3.1.1"
+/* UAX#9 Unicode BiDirectional Algorithm */
+#define UNI_MAX_BIDI_LEVEL 61
+
/* BiDirectional marks */
#define UNI_LRM 0x200E
#define UNI_RLM 0x200F
@@ -52,8 +60,12 @@
#define UNI_FARSI_ZERO 0x06F0
/* wcwidth functions */
-int fribidi_wcwidth (FriBidiChar ch);
-int fribidi_wcswidth (const FriBidiChar *str, FriBidiStrIndex len);
-int fribidi_wcswidth_cjk (const FriBidiChar *str, FriBidiStrIndex len);
+ int fribidi_wcwidth (FriBidiChar ch);
+ int fribidi_wcswidth (const FriBidiChar *str, FriBidiStrIndex len);
+ int fribidi_wcswidth_cjk (const FriBidiChar *str, FriBidiStrIndex len);
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* FRIBIDI_UNICODE_H */
+#endif /* FRIBIDI_UNICODE_H */
diff --git a/fribidi_utils.c b/fribidi_utils.c
index f781cbe..cc98708 100644
--- a/fribidi_utils.c
+++ b/fribidi_utils.c
@@ -1,5 +1,5 @@
/* FriBidi - Library of BiDi algorithm
- * Copyright (C) 1999,2000 Dov Grobgeld, and
+ * Copyright (C) 1999,2000 Dov Grobgeld
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/packtab.h b/packtab.h
index f2ae915..76a0c87 100644
--- a/packtab.h
+++ b/packtab.h
@@ -19,7 +19,21 @@
* For licensing issues, contact <fwpg@sharif.edu>.
*/
-int pack_table (int *base, int key_num, int key_size, int ptr_size,
- int max_depth, int tab_width, char **name,
- char *key_type_name, char *table_name, char *macro_name,
- FILE * out);
+#ifndef PACKTAB_H
+#define PACKTAB_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ int pack_table (int *base, int key_num, int key_size, int ptr_size,
+ int max_depth, int tab_width, char **name,
+ char *key_type_name, char *table_name, char *macro_name,
+ FILE * out);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PACKTAB_H */