From 2721c9054f96693a77cb522358beb9021038edc7 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 15 Dec 2008 17:10:09 +0000 Subject: Provide GPL disclaimers with all sources - Add GPL disclaimers to all sources - Suppress gcc-4.2 warnings --- src/curconfig.c | 19 +++++++++++++ src/curconfig.h | 19 +++++++++++++ src/engine.c | 23 ++++++++++++++-- src/engine.h | 19 +++++++++++++ src/fake_rcd.h | 19 +++++++++++++ src/fs.c | 19 +++++++++++++ src/fs.h | 19 +++++++++++++ src/internal.h | 19 +++++++++++++ src/librcc.c | 19 +++++++++++++ src/librcc.h | 19 +++++++++++++ src/lng.c | 19 +++++++++++++ src/lng.h | 19 +++++++++++++ src/lngconfig.c | 20 ++++++++++++++ src/lngconfig.h | 20 ++++++++++++++ src/lngrecode.c | 19 +++++++++++++ src/lngrecode.h | 19 +++++++++++++ src/opt.c | 19 +++++++++++++ src/opt.h | 19 +++++++++++++ src/plugin.c | 19 +++++++++++++ src/plugin.h | 19 +++++++++++++ src/rccconfig.c | 19 +++++++++++++ src/rccconfig.h | 19 +++++++++++++ src/rccdb4.c | 19 +++++++++++++ src/rccdb4.h | 19 +++++++++++++ src/rccenca.c | 21 ++++++++++++++- src/rccenca.h | 19 +++++++++++++ src/rccexternal.c | 21 ++++++++++++++- src/rccexternal.h | 19 +++++++++++++ src/rcchome.c | 19 +++++++++++++ src/rcchome.h | 19 +++++++++++++ src/rcciconv.c | 21 ++++++++++++++- src/rcciconv.h | 19 +++++++++++++ src/rcclist.c | 20 ++++++++++++++ src/rcclist.h | 20 ++++++++++++++ src/rcclocale.c | 21 ++++++++++++++- src/rcclocale.h | 19 +++++++++++++ src/rcclock.c | 20 ++++++++++++++ src/rcclock.h | 20 ++++++++++++++ src/rccmutex.c | 19 +++++++++++++ src/rccmutex.h | 19 +++++++++++++ src/rccspell.c | 19 +++++++++++++ src/rccspell.h | 19 +++++++++++++ src/rccstring.c | 21 ++++++++++++++- src/rccstring.h | 20 ++++++++++++++ src/rcctranslate.c | 19 +++++++++++++ src/rcctranslate.h | 19 +++++++++++++ src/rccxml.c | 79 +++++++++++++++++++++++++++++++++--------------------- src/rccxml.h | 19 +++++++++++++ src/recode.c | 29 ++++++++++++++++---- src/recode.h | 19 +++++++++++++ 50 files changed, 999 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/curconfig.c b/src/curconfig.c index 6877f87..8cacdd3 100644 --- a/src/curconfig.c +++ b/src/curconfig.c @@ -1,3 +1,22 @@ +/* + LibRCC - module providing access to actual RCC configuration + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include "internal.h" diff --git a/src/curconfig.h b/src/curconfig.h index f1ffaff..3731d97 100644 --- a/src/curconfig.h +++ b/src/curconfig.h @@ -1,3 +1,22 @@ +/* + LibRCC - module providing access to actual RCC configuration + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_CUR_CONFIG_H #define _RCC_CUR_CONFIG_H diff --git a/src/engine.c b/src/engine.c index 3d3e023..57654e8 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1,3 +1,22 @@ +/* + LibRCC - Autodetection engines abstraction + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include @@ -183,7 +202,7 @@ static int CheckWestern(const unsigned char *buf, int len) { long i,j; int bytes=0; - if (!len) len = strlen(buf); + if (!len) len = strlen((char*)buf); for (i=0;i0) { // Western is 0x100-0x17e @@ -213,7 +232,7 @@ rcc_autocharset_id rccEngineDetectCharset(rcc_engine_context ctx, const char *bu /* DS: This should be done directly in autoengines, otherwise we will fail to detect 7bit encodings */ - if (CheckWestern(buf, len)) { + if (CheckWestern((const unsigned char*)buf, len)) { utf=rccConfigGetAutoCharsetByName(ctx->config, "UTF-8"); if (utf != (rcc_autocharset_id)-1) return utf; utf=rccConfigGetAutoCharsetByName(ctx->config, "UTF8"); diff --git a/src/engine.h b/src/engine.h index 3213f2b..af2383b 100644 --- a/src/engine.h +++ b/src/engine.h @@ -1,3 +1,22 @@ +/* + LibRCC - Autodetection engines abstraction + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_ENGINE_H #define _RCC_ENGINE_H diff --git a/src/fake_rcd.h b/src/fake_rcd.h index 8dcb9ae..cd0054a 100644 --- a/src/fake_rcd.h +++ b/src/fake_rcd.h @@ -1,3 +1,22 @@ +/* + LibRCD - Public Interface + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _LIBRCD_H #define _LIBRCD_H diff --git a/src/fs.c b/src/fs.c index 675e061..e1b6997 100644 --- a/src/fs.c +++ b/src/fs.c @@ -1,3 +1,22 @@ +/* + LibRCC - Module providing file names recoding + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/fs.h b/src/fs.h index cc5f4cf..5c38b85 100644 --- a/src/fs.h +++ b/src/fs.h @@ -1,3 +1,22 @@ +/* + LibRCC - module providing file names recoding + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_FS_H #define _RCC_FS_H diff --git a/src/internal.h b/src/internal.h index 98ef6d7..689b661 100644 --- a/src/internal.h +++ b/src/internal.h @@ -1,3 +1,22 @@ +/* + LibRCC - various definitions used internally + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_INTERNAL_H #define _RCC_INTERNAL_H diff --git a/src/librcc.c b/src/librcc.c index a39fef2..6890505 100644 --- a/src/librcc.c +++ b/src/librcc.c @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for library initialization + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/librcc.h b/src/librcc.h index 88cc802..10aa7fa 100644 --- a/src/librcc.h +++ b/src/librcc.h @@ -1,3 +1,22 @@ +/* + LibRCC - public interface + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _LIBRCC_H #define _LIBRCC_H diff --git a/src/lng.c b/src/lng.c index 5605768..5e6284b 100644 --- a/src/lng.c +++ b/src/lng.c @@ -1,3 +1,22 @@ +/* + LibRCC - base module for language manipulations + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include diff --git a/src/lng.h b/src/lng.h index f3a7735..e4c4a86 100644 --- a/src/lng.h +++ b/src/lng.h @@ -1,3 +1,22 @@ +/* + LibRCC - base module for language manipulations + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_LNG_H #define _RCC_LNG_H diff --git a/src/lngconfig.c b/src/lngconfig.c index 670d97f..cf41199 100644 --- a/src/lngconfig.c +++ b/src/lngconfig.c @@ -1,3 +1,23 @@ +/* + LibRCC - language configuration: supported charsets and engines, various + options + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/lngconfig.h b/src/lngconfig.h index b9e9a6b..8da2c4f 100644 --- a/src/lngconfig.h +++ b/src/lngconfig.h @@ -1,3 +1,23 @@ +/* + LibRCC - language configuration: supported charsets and engines, various + options + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_LNGCONFIG_H #define _RCC_LNGCONFIG_H diff --git a/src/lngrecode.c b/src/lngrecode.c index 4b4f298..29f65af 100644 --- a/src/lngrecode.c +++ b/src/lngrecode.c @@ -1,3 +1,22 @@ +/* + LibRCC - module providing charset recoding for the specified language + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/lngrecode.h b/src/lngrecode.h index 218c8b9..384120a 100644 --- a/src/lngrecode.h +++ b/src/lngrecode.h @@ -1,3 +1,22 @@ +/* + LibRCC - module providing charset recoding for the specified language + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_LNG_RECODE_H #define _RCC_LNG_RECODE_H diff --git a/src/opt.c b/src/opt.c index 9e9f00d..87c4b0c 100644 --- a/src/opt.c +++ b/src/opt.c @@ -1,3 +1,22 @@ +/* + LibRCC - abstraction for numerical and boolean configuration options + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include diff --git a/src/opt.h b/src/opt.h index 322c25c..cff0a50 100644 --- a/src/opt.h +++ b/src/opt.h @@ -1,3 +1,22 @@ +/* + LibRCC - abstraction for numerical and boolean configuration options + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_OPT_H #define _RCC_OPT_H diff --git a/src/plugin.c b/src/plugin.c index c53726f..55a1f51 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,3 +1,22 @@ +/* + LibRCC - plugin's abstraction + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/plugin.h b/src/plugin.h index 9c8f512..74e6610 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -1,3 +1,22 @@ +/* + LibRCC - plugin's abstraction + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_PLUGIN_H #define _RCC_PLUGIN_H #include "../config.h" diff --git a/src/rccconfig.c b/src/rccconfig.c index d9e8cba..7cec592 100644 --- a/src/rccconfig.c +++ b/src/rccconfig.c @@ -1,3 +1,22 @@ +/* + LibRCC - default configuration + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include diff --git a/src/rccconfig.h b/src/rccconfig.h index c84403a..54e36ee 100644 --- a/src/rccconfig.h +++ b/src/rccconfig.h @@ -1,3 +1,22 @@ +/* + LibRCC - default configuration + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_CONFIG_H #define _RCC_CONFIG_H #include "librcc.h" diff --git a/src/rccdb4.c b/src/rccdb4.c index d21f36b..2bf0816 100644 --- a/src/rccdb4.c +++ b/src/rccdb4.c @@ -1,3 +1,22 @@ +/* + LibRCC - interface to BerkleyDB + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/rccdb4.h b/src/rccdb4.h index cb978f0..66cd8a6 100644 --- a/src/rccdb4.h +++ b/src/rccdb4.h @@ -1,3 +1,22 @@ +/* + LibRCC - interface to BerkleyDB + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_DB4_H #define _RCC_DB4_H diff --git a/src/rccenca.c b/src/rccenca.c index e46847e..a550051 100644 --- a/src/rccenca.c +++ b/src/rccenca.c @@ -1,3 +1,22 @@ +/* + LibRCC - interface to enca library + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include @@ -96,7 +115,7 @@ rcc_autocharset_id rccEnca(rcc_engine_context ctx, const char *buf, int len) { internal = rccEngineGetInternal(ctx); if ((!internal)||(!buf)) return (rcc_charset_id)-1; - ee = enca_analyse_const((EncaAnalyser)ctx->internal,buf,len?len:strlen(buf)); + ee = enca_analyse_const((EncaAnalyser)ctx->internal,(const unsigned char*)buf,len?len:strlen(buf)); if (ee.charset<0) return (rcc_charset_id)-1; charset = enca_charset_name(ee.charset, ENCA_NAME_STYLE_ICONV); diff --git a/src/rccenca.h b/src/rccenca.h index 308b8fb..0630a5c 100644 --- a/src/rccenca.h +++ b/src/rccenca.h @@ -1,3 +1,22 @@ +/* + LibRCC - interface to enca library + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_ENCA_H #define _RCC_ENCA_H diff --git a/src/rccexternal.c b/src/rccexternal.c index 58b8a23..1ea5ce6 100644 --- a/src/rccexternal.c +++ b/src/rccexternal.c @@ -1,3 +1,22 @@ +/* + LibRCC - module comunicating with rcc-external helper application + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include @@ -211,7 +230,7 @@ again: } } - if (rccExternalWrite(sock, &module, 1, 0)) { + if (rccExternalWrite(sock, (char*)&module, 1, 0)) { close(sock); return -1; } diff --git a/src/rccexternal.h b/src/rccexternal.h index fe7052f..956b1d4 100644 --- a/src/rccexternal.h +++ b/src/rccexternal.h @@ -1,3 +1,22 @@ +/* + LibRCC - module comunicating with rcc-external helper application + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_EXTERNAL_H #define _RCC_EXTERNAL_H diff --git a/src/rcchome.c b/src/rcchome.c index a88a667..742d4d9 100644 --- a/src/rcchome.c +++ b/src/rcchome.c @@ -1,3 +1,22 @@ +/* + LibRCC - module detecting user's home directory + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/rcchome.h b/src/rcchome.h index 0712eab..40187fe 100644 --- a/src/rcchome.h +++ b/src/rcchome.h @@ -1,3 +1,22 @@ +/* + LibRCC - module detecting user's home directory + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_HOME_H #define _RCC_HOME_H diff --git a/src/rcciconv.c b/src/rcciconv.c index 3037dc2..9d851be 100644 --- a/src/rcciconv.c +++ b/src/rcciconv.c @@ -1,3 +1,22 @@ +/* + LibRCC - interface to iconv library + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include @@ -74,7 +93,7 @@ loop_restart: out_left = outsize; loop: - err=iconv(icnv->icnv, (const char**)&in_buf, &in_left, &out_buf, &out_left); + err=iconv(icnv->icnv, (char**)&in_buf, &in_left, &out_buf, &out_left); if (err<0) { if (errno==E2BIG) { *(int*)(outbuf+(RCC_MAX_STRING_CHARS-sizeof(int)))=0; diff --git a/src/rcciconv.h b/src/rcciconv.h index 1520534..ee698b5 100644 --- a/src/rcciconv.h +++ b/src/rcciconv.h @@ -1,3 +1,22 @@ +/* + LibRCC - interface to iconv library + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_ICONV_H #define _RCC_ICONV_H diff --git a/src/rcclist.c b/src/rcclist.c index 375807e..e518abb 100644 --- a/src/rcclist.c +++ b/src/rcclist.c @@ -1,3 +1,23 @@ +/* + LibRCC - module providing access to currently registered languages, engines, + charsets + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include "internal.h" diff --git a/src/rcclist.h b/src/rcclist.h index 71076b7..af729c3 100644 --- a/src/rcclist.h +++ b/src/rcclist.h @@ -1,3 +1,23 @@ +/* + LibRCC - module providing access to currently registered languages, engines, + charsets + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_LIST_H #define _RCC_LIST_H diff --git a/src/rcclocale.c b/src/rcclocale.c index 9869a72..99bc659 100644 --- a/src/rcclocale.c +++ b/src/rcclocale.c @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for extracting locale information + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include @@ -85,7 +104,7 @@ int rccLocaleGetCharset(char *result, const char *lv, unsigned int n) { if (locale_class == LC_CTYPE) { l = getenv("CHARSET"); #ifdef HAVE_LIBCHARSET - if (!l) l = locale_charset(); + if (!l) l = (char*)locale_charset(); #endif /* HAVE_LIBCHARSET */ #ifdef HAVE_CODESET if (!l) l = nl_langinfo(CODESET); diff --git a/src/rcclocale.h b/src/rcclocale.h index b6832ed..50c5f74 100644 --- a/src/rcclocale.h +++ b/src/rcclocale.h @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for extracting locale information + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_LOCALE_H #define _RCC_LOCALE_H diff --git a/src/rcclock.c b/src/rcclock.c index b8f0e8f..dab0e50 100644 --- a/src/rcclock.c +++ b/src/rcclock.c @@ -1,3 +1,23 @@ +/* + LibRCC - module responsible for application synchronization (write access to + a shared config mainly) + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/rcclock.h b/src/rcclock.h index e043150..cfa7c58 100644 --- a/src/rcclock.h +++ b/src/rcclock.h @@ -1,3 +1,23 @@ +/* + LibRCC - module responsible for application synchronization (write access to + a shared config mainly) + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_LOCK_H #define _RCC_LOCK_H diff --git a/src/rccmutex.c b/src/rccmutex.c index e2690fa..3c50d32 100644 --- a/src/rccmutex.c +++ b/src/rccmutex.c @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for thread synchronization + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include diff --git a/src/rccmutex.h b/src/rccmutex.h index 8585621..2684d26 100644 --- a/src/rccmutex.h +++ b/src/rccmutex.h @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for thread synchronization + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_MUTEX_H #define _RCC_MUTEX_H diff --git a/src/rccspell.c b/src/rccspell.c index 19b5abc..6f2c002 100644 --- a/src/rccspell.c +++ b/src/rccspell.c @@ -1,3 +1,22 @@ +/* + LibRCC - interface to spelling libraries used by language recognition code + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include diff --git a/src/rccspell.h b/src/rccspell.h index 4943e93..edd4d7a 100644 --- a/src/rccspell.h +++ b/src/rccspell.h @@ -1,3 +1,22 @@ +/* + LibRCC - interface to spelling libraries used by language recognition code + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_SPELL_H #define _RCC_SPELL_H diff --git a/src/rccstring.c b/src/rccstring.c index 0f46c90..6ccc207 100644 --- a/src/rccstring.c +++ b/src/rccstring.c @@ -1,3 +1,22 @@ +/* + LibRCC - module handling internal string representation + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include @@ -180,7 +199,7 @@ size_t rccStringSizedGetChars(const char *str, size_t size) { size_t i, skip = 0, chars = 0; const unsigned char *tmp; - tmp = rccGetString(str); + tmp = (unsigned char*)rccGetString(str); for (i=0;(size?(size-i):tmp[i]);i++) { if (skip) { diff --git a/src/rccstring.h b/src/rccstring.h index 96f8b2d..4ee8a00 100644 --- a/src/rccstring.h +++ b/src/rccstring.h @@ -1,3 +1,23 @@ +/* + LibRCC - this header defines internal string representation: UTF-8 encoding + string + information on language. + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_STRING_H #define _RCC_STRING_H diff --git a/src/rcctranslate.c b/src/rcctranslate.c index 7c79d8b..638c3fe 100644 --- a/src/rcctranslate.c +++ b/src/rcctranslate.c @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for translation service + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include diff --git a/src/rcctranslate.h b/src/rcctranslate.h index b00cdfd..f5c9d0a 100644 --- a/src/rcctranslate.h +++ b/src/rcctranslate.h @@ -1,3 +1,22 @@ +/* + LibRCC - module responsible for translation service + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_TRANSLATE_H #define _RCC_TRANSLATE_H diff --git a/src/rccxml.c b/src/rccxml.c index e5283af..f5ce045 100644 --- a/src/rccxml.c +++ b/src/rccxml.c @@ -1,3 +1,22 @@ +/* + LibRCC - module handling XML configuration + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include @@ -43,7 +62,7 @@ rcc_config rccGetConfiguration() { } static const char *rccXmlGetText(xmlNodePtr node) { - if ((node)&&(node->children)&&(node->children->type == XML_TEXT_NODE)&&(node->children->content)) return node->children->content; + if ((node)&&(node->children)&&(node->children->type == XML_TEXT_NODE)&&(node->children->content)) return (const char*)node->children->content; return NULL; } @@ -95,7 +114,7 @@ int rccXmlInit(int LoadConfiguration) { xpathctx = xmlXPathNewContext(xmlctx); if (!xpathctx) goto clear; - obj = xmlXPathEvalExpression(XPATH_LANGUAGE, xpathctx); + obj = xmlXPathEvalExpression((xmlChar*)XPATH_LANGUAGE, xpathctx); if (!obj) goto clear; node_set = obj->nodesetval; @@ -106,8 +125,8 @@ int rccXmlInit(int LoadConfiguration) { nnodes = node_set->nodeNr; for (i=0;inodeTab[i]; - attr = xmlHasProp(pnode, "name"); - lang = attr->children->content; + attr = xmlHasProp(pnode, (xmlChar*)"name"); + lang = (const char*)attr->children->content; if ((!lang)||(!lang[0])) continue; @@ -128,18 +147,18 @@ int rccXmlInit(int LoadConfiguration) { for (epos = 1, cpos = 1,node=pnode->children;node;node=node->next) { if (node->type != XML_ELEMENT_NODE) continue; - if (!xmlStrcmp(node->name, "Charsets")) { + if (!xmlStrcmp(node->name, (xmlChar*)"Charsets")) { for (cnode=node->children;cnode;cnode=cnode->next) { if (cnode->type != XML_ELEMENT_NODE) continue; - if ((!xmlStrcmp(cnode->name, "Charset"))&&(rccXmlGetText(cnode))&&(cposname, (xmlChar*)"Charset"))&&(rccXmlGetText(cnode))&&(cposname, "Engines")) { + else if (!xmlStrcmp(node->name, (xmlChar*)"Engines")) { for (enode=node->children;enode;enode=enode->next) { if (enode->type != XML_ELEMENT_NODE) continue; - if ((!xmlStrcmp(enode->name, "Engine"))&&(eposname, (xmlChar*)"Engine"))&&(eposname, "Aliases")) { + else if (!xmlStrcmp(node->name, (xmlChar*)"Aliases")) { for (enode=node->children;enode;enode=enode->next) { if (enode->type != XML_ELEMENT_NODE) continue; - if ((!xmlStrcmp(enode->name, "Alias"))&&(aposname, (xmlChar*)"Alias"))&&(aposname, "Relations")) { + else if (!xmlStrcmp(node->name, (xmlChar*)"Relations")) { rpos = rccDefaultDropLanguageRelations(lang); for (enode=node->children;enode;enode=enode->next) { if (enode->type != XML_ELEMENT_NODE) continue; - if ((!xmlStrcmp(enode->name, "Parrent"))&&(rposname, (xmlChar*)"Parrent"))&&(rposnodesetval; if ((node_set)&&(node_set->nodeNr > 0)) { @@ -328,7 +347,7 @@ int rccSave(rcc_context ctx, const char *name) { } if (!doc) { - doc = xmlNewDoc("1.0"); + doc = xmlNewDoc((xmlChar*)"1.0"); if (!doc) goto clear; pnode = NULL; } else { @@ -341,17 +360,17 @@ int rccSave(rcc_context ctx, const char *name) { onode = rccNodeFind(xpathctx, XPATH_SELECTED_OPTIONS); llnode = rccNodeFind(xpathctx, XPATH_SELECTED_LANGS); } else { - pnode = xmlNewChild((xmlNodePtr)doc, NULL, "Config", NULL); + pnode = xmlNewChild((xmlNodePtr)doc, NULL, (xmlChar*)"Config", NULL); lnode = NULL; onode = NULL; llnode = NULL; } - if (lnode) xmlNodeSetContent(lnode, rccGetSelectedLanguageName(ctx)); - else lnode = xmlNewChild(pnode,NULL, "Language", rccGetSelectedLanguageName(ctx)); + if (lnode) xmlNodeSetContent(lnode, (xmlChar*)rccGetSelectedLanguageName(ctx)); + else lnode = xmlNewChild(pnode,NULL, (xmlChar*)"Language", (xmlChar*)rccGetSelectedLanguageName(ctx)); if (onode) oflag = 1; - else onode = xmlNewChild(pnode, NULL, "Options", NULL); + else onode = xmlNewChild(pnode, NULL, (xmlChar*)"Options", NULL); for (i=0;ilanguages; classes = ctx->classes; @@ -396,18 +415,18 @@ int rccSave(rcc_context ctx, const char *name) { enode = rccNodeFind(xpathctx, XPATH_SELECTED_ENGINE, language->sn); cnode = rccNodeFind(xpathctx, XPATH_SELECTED_CLASSES, language->sn); } else { - lnode = xmlNewChild(llnode, NULL, "Language", NULL); - xmlSetProp(lnode, "name", language->sn); + lnode = xmlNewChild(llnode, NULL, (xmlChar*)"Language", NULL); + xmlSetProp(lnode, (xmlChar*)"name", (xmlChar*)language->sn); enode = NULL; cnode = NULL; } - if (enode) xmlNodeSetContent(enode, rccConfigGetSelectedEngineName(cfg)); - else xmlNewChild(lnode, NULL, "Engine", rccConfigGetSelectedEngineName(cfg)); + if (enode) xmlNodeSetContent(enode, (xmlChar*)rccConfigGetSelectedEngineName(cfg)); + else xmlNewChild(lnode, NULL, (xmlChar*)"Engine", (xmlChar*)rccConfigGetSelectedEngineName(cfg)); if (cnode) cflag = 1; else { - cnode = xmlNewChild(lnode, NULL, "Classes", NULL); + cnode = xmlNewChild(lnode, NULL, (xmlChar*)"Classes", NULL); cflag = 0; } @@ -418,10 +437,10 @@ int rccSave(rcc_context ctx, const char *name) { if (cflag) node = rccNodeFind(xpathctx, XPATH_SELECTED_CLASS, language->sn, cl->name); else node = NULL; - if (node) xmlNodeSetContent(node, rccConfigGetSelectedCharsetName(cfg, (rcc_class_id)j)); + if (node) xmlNodeSetContent(node, (xmlChar*)rccConfigGetSelectedCharsetName(cfg, (rcc_class_id)j)); else { - node = xmlNewChild(cnode, NULL, "Class", rccConfigGetSelectedCharsetName(cfg, (rcc_class_id)j)); - xmlSetProp(node, "name", cl->name); + node = xmlNewChild(cnode, NULL, (xmlChar*)"Class", (xmlChar*)rccConfigGetSelectedCharsetName(cfg, (rcc_class_id)j)); + xmlSetProp(node, (xmlChar*)"name", (xmlChar*)cl->name); } } } diff --git a/src/rccxml.h b/src/rccxml.h index d8d07bf..90aaac3 100644 --- a/src/rccxml.h +++ b/src/rccxml.h @@ -1,3 +1,22 @@ +/* + LibRCC - module handling XML configuration + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_XML_H #define _RCC_XML_H diff --git a/src/recode.c b/src/recode.c index 1d98306..e4a2051 100644 --- a/src/recode.c +++ b/src/recode.c @@ -1,3 +1,22 @@ +/* + LibRCC - module providing language autodetection and recoding + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include #include @@ -125,17 +144,17 @@ static rcc_language_id rccDetectLanguageInternal(rcc_context ctx, rcc_class_id c if (!strcasecmp(config->language->sn, rcc_english_language_sn)) english_mode = 1; else english_mode = 0; - utf8 = (char*)rccStringGetString(recoded); + utf8 = (unsigned char*)rccStringGetString(recoded); for (result=0,own=0,words=0,ownlongest=0,longest=0,mode=0,j=0;utf8[j];j++) { if (isSpace(utf8[j])) { if (mode) { if ((english_mode)&&(!english_word)) is_english_string = 0; - spres = rccSpellerSized(speller, utf8 + mode - 1, j - mode + 1, 1); + spres = rccSpellerSized(speller, (char*)utf8 + mode - 1, j - mode + 1, 1); if (rccSpellerResultIsCorrect(spres)) { result++; - chars = rccStringSizedGetChars(utf8 + mode - 1, j - mode + 1); + chars = rccStringSizedGetChars((char*)utf8 + mode - 1, j - mode + 1); if (chars > longest) longest = chars; } if (rccSpellerResultIsOwn(spres)) { @@ -161,10 +180,10 @@ static rcc_language_id rccDetectLanguageInternal(rcc_context ctx, rcc_class_id c if (mode) { if ((english_mode)&&(!english_word)) is_english_string = 0; - spres = rccSpeller(speller, utf8 + mode - 1); + spres = rccSpeller(speller, (char*)utf8 + mode - 1); if (rccSpellerResultIsCorrect(spres)) { result++; - chars = rccStringSizedGetChars(utf8 + mode - 1, 0); + chars = rccStringSizedGetChars((char*)utf8 + mode - 1, 0); if (chars > longest) longest = chars; } if (rccSpellerResultIsOwn(spres)) { diff --git a/src/recode.h b/src/recode.h index 0e31759..7bb0bc3 100644 --- a/src/recode.h +++ b/src/recode.h @@ -1,3 +1,22 @@ +/* + LibRCC - module providing language autodetection and recoding + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #ifndef _RCC_RECODE_H #define _RCC_RECODE_H -- cgit v1.2.3