]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/fulltext/ft_wordbreaker.c
Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / modules / fulltext / ft_wordbreaker.c
index 664a7de8dc99c4b3794b8e051155d72209b23d2a..3c61697c8ce9f07f229537802fe2c69c7ab78d78 100644 (file)
@@ -1,8 +1,21 @@
 /*
- * $Id$
- *
  * Default wordbreaker module for full text indexing.
  *
+ * Copyright (c) 2005-2012 by the citadel.org team
+ *
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3.
+ *  
+ *  
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  
+ *  
+ *  
  */
 
 
@@ -146,7 +159,7 @@ void noise_word_cleanup(void)
        int i;
        noise_word *cur, *next;
        
-       CtdlLogPrintf(CTDL_INFO, "Cleaning up fulltext noise words.\n");
+       syslog(LOG_INFO, "Cleaning up fulltext noise words.\n");
        
        for (i = 0 ; i < 26 ; i++)
        {
@@ -176,15 +189,15 @@ int intcmp(const void *rec1, const void *rec2) {
 }
 
 
-void wordbreaker(char *text, int *num_tokens, int **tokens) {
+void wordbreaker(const char *text, int *num_tokens, int **tokens) {
 
        int wb_num_tokens = 0;
        int wb_num_alloc = 0;
        int *wb_tokens = NULL;
 
-       char *ptr;
-       char *word_start;
-       char *word_end;
+       const char *ptr;
+       const char *word_start;
+       const char *word_end;
        char ch;
        int word_len;
        char word[256];
@@ -223,7 +236,7 @@ void wordbreaker(char *text, int *num_tokens, int **tokens) {
                        /* extract the word */
                        word_len = word_end - word_start;
                        if (word_len >= sizeof word) {
-                               CtdlLogPrintf(CTDL_DEBUG, "Invalid word length: %d\n", word_len);
+                               syslog(LOG_DEBUG, "Invalid word length: %d\n", word_len);
                                safestrncpy(word, word_start, sizeof word);
                                word[(sizeof word) - 1] = 0;
                        }