[tracker/parser-unicode-libs-review: 71/85] Splitting different parser implementations in different files



commit 84125896413855c1fd6d11f61f00c37f2cb8ceca
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Apr 29 11:36:53 2010 +0200

    Splitting different parser implementations in different files

 src/libtracker-fts/Makefile.am                     |   13 ++++++++++---
 .../{tracker-parser.c => tracker-parser-glib.c}    |    2 --
 ...cker-parser.c => tracker-parser-libunistring.c} |    0
 3 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-fts/Makefile.am b/src/libtracker-fts/Makefile.am
index c174566..9b469c6 100644
--- a/src/libtracker-fts/Makefile.am
+++ b/src/libtracker-fts/Makefile.am
@@ -7,13 +7,14 @@ INCLUDES =								\
 	$(WARN_CFLAGS)							\
 	$(GLIB2_CFLAGS)							\
 	$(GCOV_CFLAGS)							\
-	$(PANGO_CFLAGS)							\
 	$(DBUS_CFLAGS)							\
 	$(UNAC_CFLAGS)							\
 	$(SQLITE3_CFLAGS)
 
 if HAVE_LIBUNISTRING
 INCLUDES += $(LIBUNISTRING_CFLAGS)
+else
+INCLUDES += $(PANGO_CFLAGS)
 endif
 
 noinst_LTLIBRARIES = libtracker-fts.la
@@ -25,19 +26,25 @@ libtracker_fts_la_SOURCES = 						\
 	tracker-fts-config.h						\
 	tracker-fts-hash.c						\
 	tracker-fts-hash.h						\
-	tracker-parser.c						\
 	tracker-parser.h
 
+if HAVE_LIBUNISTRING
+libtracker_fts_la_SOURCES += tracker-parser-libunistring.c
+else
+libtracker_fts_la_SOURCES += tracker-parser-glib.c
+endif
+
 libtracker_fts_la_LIBADD =						\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la	\
 	$(SQLITE3_LIBS)							\
 	$(DBUS_LIBS)							\
 	$(GTHREAD_LIBS)							\
 	$(GCOV_LIBS)							\
-	$(PANGO_LIBS)							\
 	$(UNAC_LIBS)							\
 	$(GLIB2_LIBS)
 
 if HAVE_LIBUNISTRING
 libtracker_fts_la_LIBADD += $(LIBUNISTRING_LIBS)
+else
+libtracker_fts_la_LIBADD += $(PANGO_LIBS)
 endif
diff --git a/src/libtracker-fts/tracker-parser.c b/src/libtracker-fts/tracker-parser-glib.c
similarity index 99%
copy from src/libtracker-fts/tracker-parser.c
copy to src/libtracker-fts/tracker-parser-glib.c
index 5ffa73e..c1f3a29 100644
--- a/src/libtracker-fts/tracker-parser.c
+++ b/src/libtracker-fts/tracker-parser-glib.c
@@ -501,7 +501,6 @@ parser_next (TrackerParser *parser,
 		case TRACKER_PARSER_WORD_ASCII_HIGHER:
 			c += 32;
 
-                        /* Fall through */
 		case TRACKER_PARSER_WORD_ASCII_LOWER:
 		case TRACKER_PARSER_WORD_HYPHEN:
 		case TRACKER_PARSER_WORD_UNDERSCORE:
@@ -526,7 +525,6 @@ parser_next (TrackerParser *parser,
 		case TRACKER_PARSER_WORD_ALPHA_HIGHER:
 			c = g_unichar_tolower (c);
 
-			/* Fall through */
 		case TRACKER_PARSER_WORD_ALPHA_LOWER:
 			if (!do_strip) {
 				do_strip = TRUE;
diff --git a/src/libtracker-fts/tracker-parser.c b/src/libtracker-fts/tracker-parser-libunistring.c
similarity index 100%
rename from src/libtracker-fts/tracker-parser.c
rename to src/libtracker-fts/tracker-parser-libunistring.c



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]