[FriBidi-commit] fribidi/lib Headers.mk, 1.3, 1.4 Makefile.am, 1.8,
1.9 common.h, 1.10, 1.11 debug.h, 1.4, 1.5 fribidi-bidi.c, 1.6,
1.7 fribidi-bidi-types.c, 1.3, 1.4 fribidi-common.h, 1.6,
1.7 fribidi-config.h.in, 1.1.1.1, 1.2 fribidi.c, 1.5,
1.6 run.h, 1.2, 1.3
Behdad Esfahbod
behdad at pdx.freedesktop.org
Mon May 31 11:39:41 PDT 2004
Update of /cvs/fribidi/fribidi/lib
In directory pdx:/tmp/cvs-serv20582
Modified Files:
Headers.mk Makefile.am common.h debug.h fribidi-bidi.c
fribidi-bidi-types.c fribidi-common.h fribidi-config.h.in
fribidi.c run.h
Log Message:
GNU Coding Standards applied where appropriate.
Index: Headers.mk
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/Headers.mk,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/Headers.mk 3 May 2004 22:05:19 -0000 1.3
+++ b/Headers.mk 31 May 2004 18:39:39 -0000 1.4
@@ -3,6 +3,7 @@
fribidi-bidi.h \
fribidi-bidi-type.h \
fribidi-bidi-types.h \
+ fribidi-bidi-types-list.h \
fribidi-common.h \
fribidi-config.h \
fribidi-enddecls.h \
Index: Makefile.am
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- a/Makefile.am 25 May 2004 12:41:17 -0000 1.8
+++ b/Makefile.am 31 May 2004 18:39:39 -0000 1.9
@@ -30,7 +30,6 @@
libfribidi_la_SOURCES = \
bidi-types.h \
- bidi-types-list.h \
bidi-type.tab.i \
common.h \
debug.h \
Index: common.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/common.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- a/common.h 22 May 2004 11:21:40 -0000 1.10
+++ b/common.h 31 May 2004 18:39:39 -0000 1.11
@@ -40,7 +40,7 @@
/* FRIBIDI_PRIVATESPACE is a macro used to name library internal symbols. */
#ifndef FRIBIDI_PRIVATESPACE
-# define FRIBIDI_PRIVATESPACE(SYMBOL) FRIBIDI_NAMESPACE(SYMBOL##__internal__)
+# define FRIBIDI_PRIVATESPACE(SYMBOL) FRIBIDI_NAMESPACE(_##SYMBOL##__internal__)
#endif /* !FRIBIDI_PRIVATESPACE */
#if WIN32
@@ -155,6 +155,8 @@
# define FRIBIDI_EMPTY_STMT FRIBIDI_BEGIN_STMT (void) 0; FRIBIDI_END_STMT
#endif /* !FRIBIDI_EMPTY_STMT */
+/* As per recommendation of GNU Coding Standards. */
+#define _GNU_SOURCE
#include "debug.h"
Index: debug.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/debug.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/debug.h 7 May 2004 06:30:38 -0000 1.4
+++ b/debug.h 31 May 2004 18:39:39 -0000 1.5
@@ -93,7 +93,7 @@
# define fribidi_assert(cond) \
FRIBIDI_BEGIN_STMT \
if (!(cond)) \
- DBG("file " __FILE__ ": line " STRINGIZE(__LINE__) ": " \
+ DBG(__FILE__ ":" STRINGIZE(__LINE__) ": " \
"assertion failed (" STRINGIZE(cond) ")"); \
FRIBIDI_END_STMT
#endif /* !fribidi_assert */
Index: fribidi-bidi.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- a/fribidi-bidi.c 7 May 2004 06:30:38 -0000 1.6
+++ b/fribidi-bidi.c 31 May 2004 18:39:39 -0000 1.7
@@ -335,7 +335,7 @@
FriBidiRun *main_run_list = NULL, *explicits_list = NULL, *pp;
fribidi_boolean status = false;
- DBG ("Entering fribidi_analyse_string");
+ DBG ("entering fribidi_analyse_string");
fribidi_assert (str);
fribidi_assert (pbase_dir);
@@ -343,7 +343,7 @@
fribidi_assert (pmax_level);
/* Determinate character types */
- DBG (" Determine character types");
+ DBG (" determine character types");
{
FriBidiCharType *char_types =
(FriBidiCharType *) fribidi_malloc (len * sizeof (FriBidiCharType));
@@ -357,10 +357,10 @@
if (!main_run_list)
goto out;
}
- DBG (" Determine character types, Done");
+ DBG (" determine character types, done");
/* Find base level */
- DBG (" Finding the base level");
+ DBG (" finding the base level");
if (FRIBIDI_IS_STRONG (*pbase_dir))
base_level = FRIBIDI_DIR_TO_LEVEL (*pbase_dir);
/* P2. P3. Search for first strong character and use its direction as
@@ -379,9 +379,9 @@
}
}
base_dir = FRIBIDI_LEVEL_TO_DIR (base_level);
- DBG2 (" Base level : %c", fribidi_char_from_level (base_level));
- DBG2 (" Base dir : %c", fribidi_char_from_bidi_type (base_dir));
- DBG (" Finding the base level, Done");
+ DBG2 (" base level : %c", fribidi_char_from_level (base_level));
+ DBG2 (" base dir : %c", fribidi_char_from_bidi_type (base_dir));
+ DBG (" finding the base level, done");
# if DEBUG
if UNLIKELY
@@ -392,7 +392,7 @@
# endif /* DEBUG */
/* Explicit Levels and Directions */
- DBG ("Explicit Levels and Directions");
+ DBG ("pxplicit Levels and Directions");
{
FriBidiLevel level, new_level;
FriBidiCharType override, new_override;
@@ -516,7 +516,7 @@
# endif /* DEBUG */
/* 4. Resolving weak types */
- DBG ("Resolving weak types");
+ DBG ("resolving weak types");
{
FriBidiCharType last_strong, prev_type_orig;
fribidi_boolean w4;
@@ -648,7 +648,7 @@
# endif /* DEBUG */
/* 5. Resolving Neutral Types */
- DBG ("Resolving neutral types");
+ DBG ("resolving neutral types");
{
/* N1. and N2.
For each neutral, resolve it. */
@@ -681,7 +681,7 @@
# endif /* DEBUG */
/* 6. Resolving implicit levels */
- DBG ("Resolving implicit levels");
+ DBG ("resolving implicit levels");
{
max_level = base_level;
@@ -720,7 +720,7 @@
/* Reinsert the explicit codes & BN's that are already removed, from the
explicits_list to main_run_list. */
- DBG ("Reinserting explicit codes");
+ DBG ("reinserting explicit codes");
{
register FriBidiRun *p;
register fribidi_boolean stat =
@@ -745,7 +745,7 @@
}
# endif /* DEBUG */
- DBG ("Reset the embedding levels");
+ DBG ("reset the embedding levels");
{
register int j, k, state, pos;
register FriBidiRun *p, *q, *list;
@@ -806,7 +806,7 @@
*pmax_level = max_level;
*pbase_dir = base_dir;
- DBG ("Leaving fribidi_analyse_string");
+ DBG ("leaving fribidi_analyse_string");
out:
if UNLIKELY
(explicits_list) free_run_list (explicits_list);
@@ -865,7 +865,7 @@
FriBidiStrIndex i, j;
fribidi_boolean private_from_this = false;
- DBG ("Entering fribidi_remove_bidi_marks");
+ DBG ("entering fribidi_remove_bidi_marks");
/* If to_this is to not null, we must have from_this as well. If it is
not given by the caller, we have to make a private instance of it. */
@@ -893,18 +893,18 @@
/* Convert the from_this list to to_this */
if (position_to_this_list)
{
- DBG (" Converting from_this list to to_this");
+ DBG (" converting from_this list to to_this");
for (i = 0; i < length; i++)
position_to_this_list[i] = -1;
for (i = 0; i < length; i++)
position_to_this_list[position_from_this_list[i]] = i;
- DBG (" Converting from_this list to to_this, Done");
+ DBG (" converting from_this list to to_this, done");
}
if (private_from_this)
fribidi_free (position_from_this_list);
- DBG ("Leaving fribidi_remove_bidi_marks");
+ DBG ("leaving fribidi_remove_bidi_marks");
return j;
}
@@ -928,7 +928,7 @@
fribidi_boolean private_V_to_L = false;
fribidi_boolean status = true;
- DBG ("Entering fribidi_log2vis()");
+ DBG ("entering fribidi_log2vis()");
fribidi_assert (str);
fribidi_assert (pbase_dir);
@@ -973,7 +973,7 @@
/* 7. Reordering resolved levels */
- DBG ("Reordering resolved levels");
+ DBG ("reordering resolved levels");
{
FriBidiLevel level_idx;
FriBidiStrIndex i;
@@ -981,25 +981,25 @@
/* Set up the ordering array to sorted order */
if (position_V_to_L_list)
{
- DBG (" Initialize position_V_to_L_list");
+ DBG (" initialize position_V_to_L_list");
for (i = 0; i < len; i++)
position_V_to_L_list[i] = i;
- DBG (" Initialize position_V_to_L_list, Done");
+ DBG (" initialize position_V_to_L_list, done");
}
/* Copy the logical string to the visual */
if (visual_str)
{
- DBG (" Initialize visual_str");
+ DBG (" initialize visual_str");
for (i = 0; i < len; i++)
visual_str[i] = str[i];
visual_str[len] = 0;
- DBG (" Initialize visual_str, Done");
+ DBG (" initialize visual_str, done");
}
/* Assign the embedding level array */
if (embedding_level_list)
{
- DBG (" Fill the embedding levels array");
+ DBG (" fill the embedding levels array");
for_run_list (pp, main_run_list)
{
register FriBidiStrIndex i, pos = pp->pos, len = pp->len;
@@ -1007,7 +1007,7 @@
for (i = 0; i < len; i++)
embedding_level_list[pos + i] = level;
}
- DBG (" Fill the embedding levels array, Done");
+ DBG (" fill the embedding levels array, done");
}
/* Reorder both the outstring and the order array */
@@ -1016,7 +1016,7 @@
if (fribidi_mirroring_status () && visual_str)
{
/* L4. Mirror all characters that are in odd levels and have mirrors. */
- DBG (" Mirroring");
+ DBG (" mirroring");
for_run_list (pp, main_run_list)
{
if (pp->level & 1)
@@ -1031,13 +1031,13 @@
}
}
}
- DBG (" Mirroring, Done");
+ DBG (" mirroring, done");
}
if (fribidi_reorder_nsm_status ())
{
/* L3. Reorder NSMs. */
- DBG (" Reordering NSM sequences");
+ DBG (" reordering NSM sequences");
/* We apply this rule before L2, so go backward in odd levels. */
for_run_list (pp, main_run_list)
{
@@ -1075,15 +1075,15 @@
}
if (is_nsm_seq)
{
- DBG ("Warning: NSMs at the beggining of level run.\n");
+ DBG ("warning: NSMs at the beggining of level run.\n");
}
}
}
- DBG (" Reordering NSM sequences, Done");
+ DBG (" reordering NSM sequences, done");
}
/* L2. Reorder. */
- DBG (" Reordering");
+ DBG (" reordering");
for (level_idx = max_level; level_idx > 0; level_idx--)
{
for_run_list (pp, main_run_list)
@@ -1106,21 +1106,21 @@
}
}
}
- DBG (" Reordering, Done");
+ DBG (" reordering, done");
}
/* Convert the v2l list to l2v */
if (position_L_to_V_list)
{
- DBG (" Converting v2l list to l2v");
+ DBG (" converting v2l list to l2v");
for (i = 0; i < len; i++)
position_L_to_V_list[position_V_to_L_list[i]] = i;
- DBG (" Converting v2l list to l2v, Done");
+ DBG (" converting v2l list to l2v, done");
}
}
- DBG ("Reordering resolved levels, Done");
+ DBG ("reordering resolved levels, done");
- DBG ("Leaving fribidi_log2vis()");
+ DBG ("leaving fribidi_log2vis()");
out:
if (private_V_to_L)
fribidi_free (position_V_to_L_list);
@@ -1146,7 +1146,7 @@
FriBidiLevel max_level;
fribidi_boolean status = true;
- DBG ("Entering fribidi_log2vis_get_embedding_levels()");
+ DBG ("entering fribidi_log2vis_get_embedding_levels()");
fribidi_assert (str);
fribidi_assert (pbase_dir);
@@ -1171,7 +1171,7 @@
embedding_level_list[pos++] = level;
}
- DBG ("Leaving fribidi_log2vis_get_embedding_levels()");
+ DBG ("leaving fribidi_log2vis_get_embedding_levels()");
out:
free_run_list (main_run_list);
Index: fribidi-bidi-types.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi-types.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/fribidi-bidi-types.c 3 May 2004 22:05:19 -0000 1.3
+++ b/fribidi-bidi-types.c 31 May 2004 18:39:39 -0000 1.4
@@ -48,7 +48,7 @@
switch (t)
{
# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return SYMBOL;
-# include "bidi-types-list.h"
+# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ADD_TYPE
default:
return '?';
@@ -66,7 +66,7 @@
switch (t)
{
# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return #TYPE;
-# include "bidi-types-list.h"
+# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ADD_TYPE
default:
return "?";
Index: fribidi-common.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-common.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- a/fribidi-common.h 25 May 2004 12:00:29 -0000 1.6
+++ b/fribidi-common.h 31 May 2004 18:39:39 -0000 1.7
@@ -59,23 +59,12 @@
# endif /* !WIN32 */
#endif /* !FRIBIDI_ENTRY */
-/* FRIBIDI_BEGIN_DECLS should be used at the beginning of your declarations,
- * so that C++ compilers don't mangle their names. Use FRIBIDI_END_DECLS at
- * the end of C declarations. */
-#ifndef FRIBIDI_BEGIN_DECLS
-# ifdef __cplusplus
-# define FRIBIDI_BEGIN_DECLS extern "C" {
-# define FRIBIDI_END_DECLS }
-# else /* !__cplusplus */
-# define FRIBIDI_BEGIN_DECLS /* empty */
-# define FRIBIDI_END_DECLS /* empty */
-# endif /* !__cplusplus */
-#endif /* !FRIBIDI_BEGIN_DECLS */
-
#if FRIBIDI_USE_GLIB
# ifndef __C2MAN__
# include <glib/gmacros.h>
# endif /* !__C2MAN__ */
+# define FRIBIDI_BEGIN_DECLS G_BEGIN_DECLS
+# define FRIBIDI_END_DECLS G_END_DECLS
# define FRIBIDI_GNUC_CONST G_GNUC_CONST
# define FRIBIDI_GNUC_DEPRECATED G_GNUC_DEPRECATED
# if __GNUC__ > 2
@@ -98,6 +87,18 @@
# define FRIBIDI_GNUC_HIDDEN
#endif /* !FRIBIDI_USE_GLIB */
+/* FRIBIDI_BEGIN_DECLS should be used at the beginning of your declarations,
+ * so that C++ compilers don't mangle their names. Use FRIBIDI_END_DECLS at
+ * the end of C declarations. */
+#ifndef FRIBIDI_BEGIN_DECLS
+# ifdef __cplusplus
+# define FRIBIDI_BEGIN_DECLS extern "C" {
+# define FRIBIDI_END_DECLS }
+# else /* !__cplusplus */
+# define FRIBIDI_BEGIN_DECLS /* empty */
+# define FRIBIDI_END_DECLS /* empty */
+# endif /* !__cplusplus */
+#endif /* !FRIBIDI_BEGIN_DECLS */
#define fribidi_version_info FRIBIDI_NAMESPACE(version_info)
/* An string containing the version information of the library. */
Index: fribidi-config.h.in
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-config.h.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/fribidi-config.h.in 25 Apr 2004 18:47:57 -0000 1.1.1.1
+++ b/fribidi-config.h.in 31 May 2004 18:39:39 -0000 1.2
@@ -1,6 +1,7 @@
+/* @configure_input@ */
+/* Not copyrighted, in public domain. */
#ifndef FRIBIDI_CONFIG_H
#define FRIBIDI_CONFIG_H
-/* @configure_input@ */
#define FRIBIDI "@PACKAGE@"
#define FRIBIDI_NAME "@PACKAGE_NAME@"
Index: fribidi.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- a/fribidi.c 29 May 2004 11:32:23 -0000 1.5
+++ b/fribidi.c 31 May 2004 18:39:39 -0000 1.6
@@ -41,8 +41,9 @@
const char *fribidi_version_info =
"(" FRIBIDI_NAME ") " FRIBIDI_VERSION "\n"
- "Interface version " FRIBIDI_INTERFACE_VERSION_STRING ",\n"
- "Unicode version " FRIBIDI_UNICODE_VERSION ",\n" "Configure options"
+ "interface version " FRIBIDI_INTERFACE_VERSION_STRING ",\n"
+ "Unicode Character Database version " FRIBIDI_UNICODE_VERSION ",\n"
+ "Configure options"
#if DEBUG
" --enable-debug"
#endif /* DEBUG */
@@ -59,11 +60,10 @@
#endif /* !FRIBIDI_USE_GLIB */
".\n\n"
"Copyright (C) 2004 Sharif FarsiWeb, Inc.\n"
- "Copyright (C) 2001, 2002, 2004 Behdad Esfahbod\n"
- "Copyright (C) 1999, 2000 Dov Grobgeld\n"
- FRIBIDI_NAME " comes with ABSOLUTELY NO WARRANTY.\n"
- "You may redistribute copies of " FRIBIDI_NAME " under the terms of\n"
- "the GNU Lesser General Public License.\n"
+ "Copyright (C) 2004 Behdad Esfahbod\n"
+ FRIBIDI_NAME " comes with NO WARRANTY, to the extent permitted by law.\n"
+ "You may redistribute copies of " FRIBIDI_NAME " under\n"
+ "the terms of the GNU Lesser General Public License.\n"
"For more information about these matters, see the file named COPYING.\n"
"Written by Behdad Esfahbod and Dov Grobgeld.\n";
Index: run.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/run.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/run.h 3 May 2004 22:05:19 -0000 1.2
+++ b/run.h 31 May 2004 18:39:39 -0000 1.3
@@ -135,7 +135,7 @@
#if DEBUG
-#define fribidi_validate_run_list FRIBIDI_NAMESPACE(validate_run_list)
+#define fribidi_validate_run_list FRIBIDI_PRIVATESPACE(validate_run_list)
void fribidi_validate_run_list (
FriBidiRun *run_list /* input run list */
) FRIBIDI_GNUC_HIDDEN;
More information about the FriBidi-Commit
mailing list