summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiulio Paci <giuliopaci@gmail.com>2012-01-07 16:58:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-01-09 12:17:15 +0000
commit1f484c1e3b3f02155a41a1eb9b77f9a43692368c (patch)
tree1efe42045c61a7ee31aec84a27739b27211f68b0
parent2079aefcff0413d503915b239d825d76302ee3b7 (diff)
Changed utf8 functions naming convention to a more coherent one.
-rw-r--r--src/fingerprint.c6
-rw-r--r--src/libexttextcat.map6
-rw-r--r--src/utf8misc.c6
-rw-r--r--src/utf8misc.h7
4 files changed, 12 insertions, 13 deletions
diff --git a/src/fingerprint.c b/src/fingerprint.c
index f030732..5f5bc3d 100644
--- a/src/fingerprint.c
+++ b/src/fingerprint.c
@@ -143,7 +143,7 @@ static int increasefreq(table_t * t, char *p, int len)
while (entry)
{
- if (issame(entry->str, p, len))
+ if (utf8_issame(entry->str, p, len))
{
/*** Found it! ***/
entry->cnt++;
@@ -438,7 +438,7 @@ static void createngramtable(table_t * t, const char *buf)
char *m = n;
/*** First char may be an underscore ***/
- decay = charcopy(q, m); /* [modified] previously *q++ = *m++ */
+ decay = utf8_charcopy(q, m); /* [modified] previously *q++ = *m++ */
q += decay; /* [modified] */
m += decay; /* [modified] */
@@ -452,7 +452,7 @@ static void createngramtable(table_t * t, const char *buf)
/*** Let the compiler unroll this ***/
for (i = 2; i <= MAXNGRAMSYMBOL; i++)
{
- decay = charcopy(q, m); /* [modified] like above */
+ decay = utf8_charcopy(q, m); /* [modified] like above */
m += decay;
*m = '\0';
diff --git a/src/libexttextcat.map b/src/libexttextcat.map
index 76cce93..07c86aa 100644
--- a/src/libexttextcat.map
+++ b/src/libexttextcat.map
@@ -1,8 +1,8 @@
{
global:
- charcopy
- issame
- utfstrlen
+ utf8_charcopy
+ utf8_issame
+ utf8_strlen
wgmempool_Done
wgmempool_Init
wgmempool_Reset
diff --git a/src/utf8misc.c b/src/utf8misc.c
index ee6709b..e0b151a 100644
--- a/src/utf8misc.c
+++ b/src/utf8misc.c
@@ -84,7 +84,7 @@ const char* utf8_next_char(const char *str)
return str;
}
-int charcopy(const char *str, char *dest)
+int utf8_charcopy(const char *str, char *dest)
{
int pointer = 0;
@@ -119,7 +119,7 @@ int charcopy(const char *str, char *dest)
}
-int issame(char *lex, char *key, int len)
+int utf8_issame(char *lex, char *key, int len)
{
/* printf("[%s] prefix of [%s] with length %i", lex, key, len); */
int char_counter = 0;
@@ -166,7 +166,7 @@ int issame(char *lex, char *key, int len)
return 1;
}
-extern int utfstrlen(const char *str)
+extern int utf8_strlen(const char *str)
{
int char_counter = 0;
while (*str)
diff --git a/src/utf8misc.h b/src/utf8misc.h
index 171fb5d..46df7fd 100644
--- a/src/utf8misc.h
+++ b/src/utf8misc.h
@@ -53,22 +53,21 @@ const char* utf8_next_char(const char *str);
utf8 and the symbol is encoded with more than 1 char return the number of
char jumped This function have been added by Jocelyn Merand to use
libtextcat in OOo */
-int charcopy(const char *str, char *dest);
+int utf8_charcopy(const char *str, char *dest);
/* checks if n-gram lex is a prefix of key and of length len
* len is the number of unicode code points
* strlen("€") == 3 but len == 1
*/
-int issame(char *lex, char *key, int len);
+int utf8_issame(char *lex, char *key, int len);
/*
* len is the number of unicode code points
* strlen("€") == 3 but len == 1
*/
-extern int utfstrlen(const char *str);
-
+extern int utf8_strlen(const char *str);
#ifdef __cplusplus
}
#endif