rpms/hunspell/devel hunspell-1.1.4-capi.patch, NONE, 1.1 hunspell.spec, 1.3, 1.4

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 15 12:37:16 UTC 2006


Author: caolanm

Update of /cvs/dist/rpms/hunspell/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv14503

Modified Files:
	hunspell.spec 
Added Files:
	hunspell-1.1.4-capi.patch 
Log Message:
hunspell#1616353 simple c api for hunspell

hunspell-1.1.4-capi.patch:
 Makefile.am  |    2 +-
 hunspell.cxx |   25 +++++++++++++++++++++++++
 hunspell.h   |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 1 deletion(-)

--- NEW FILE hunspell-1.1.4-capi.patch ---
diff -ru hunspell-1.1.4.orig/src/hunspell/hunspell.cxx hunspell-1.1.4/src/hunspell/hunspell.cxx
--- hunspell-1.1.4.orig/src/hunspell/hunspell.cxx	2006-12-14 10:48:48.000000000 +0000
+++ hunspell-1.1.4/src/hunspell/hunspell.cxx	2006-12-15 09:45:10.000000000 +0000
@@ -6,6 +6,7 @@
 #include <cstdio>
 
 #include "hunspell.hxx"
+#include "hunspell.h"
 
 #ifndef W32
 using namespace std;
@@ -1642,3 +1643,27 @@
   return n;
 }
 
+Hunhandle *Hunspell_create(const char * affpath, const char * dpath)
+{
+	return (Hunhandle*)(new Hunspell(affpath, dpath));
+}
+
+void Hunspell_destroy(Hunhandle *pHunspell)
+{
+	delete (Hunspell*)(pHunspell);
+}
+
+int Hunspell_spell(Hunhandle *pHunspell, const char *word)
+{
+	return ((Hunspell*)pHunspell)->spell(word);
+}
+
+char *Hunspell_get_dic_encoding(Hunhandle *pHunspell)
+{
+	return ((Hunspell*)pHunspell)->get_dic_encoding();
+}
+
+int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word)
+{
+	return ((Hunspell*)pHunspell)->suggest(slst, word);
+}
diff -ru hunspell-1.1.4.orig/src/hunspell/Makefile.am hunspell-1.1.4/src/hunspell/Makefile.am
--- hunspell-1.1.4.orig/src/hunspell/Makefile.am	2006-12-14 10:48:48.000000000 +0000
+++ hunspell-1.1.4/src/hunspell/Makefile.am	2006-12-14 16:28:47.000000000 +0000
@@ -7,7 +7,7 @@
 	             suggestmgr.cxx license.myspell license.hunspell
 
 libhunspell_1_1_include_HEADERS=affentry.hxx htypes.hxx affixmgr.hxx \
-	        csutil.hxx hunspell.hxx atypes.hxx dictmgr.hxx \
+	        csutil.hxx hunspell.hxx hunspell.h atypes.hxx dictmgr.hxx \
 		suggestmgr.hxx baseaffix.hxx hashmgr.hxx langnum.hxx
 
 EXTRA_DIST=hunspell.dsp makefile.mk README
--- /dev/null	2006-12-11 08:20:12.802001576 +0000
+++ hunspell-1.1.4/src/hunspell/hunspell.h	2006-12-15 09:44:36.000000000 +0000
@@ -0,0 +1,33 @@
+#ifndef _MYSPELLMGR_H_
+#define _MYSPELLMGR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct Hunhandle Hunhandle;
+
+Hunhandle *Hunspell_create(const char * affpath, const char * dpath);
+void Hunspell_destroy(Hunhandle *pHunspell);
+
+/* spell(word) - spellcheck word
+ * output: 0 = bad word, not 0 = good word
+ */
+int Hunspell_spell(Hunhandle *pHunspell, const char *);
+
+char *Hunspell_get_dic_encoding(Hunhandle *pHunspell);
+
+/* suggest(suggestions, word) - search suggestions
+ * input: pointer to an array of strings pointer and the (bad) word
+ *   array of strings pointer (here *slst) may not be initialized
+ * output: number of suggestions in string array, and suggestions in
+ *   a newly allocated array of strings (*slts will be NULL when number
+ *   of suggestion equals 0.)
+ */
+int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif


Index: hunspell.spec
===================================================================
RCS file: /cvs/dist/rpms/hunspell/devel/hunspell.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- hunspell.spec	29 Nov 2006 19:45:24 -0000	1.3
+++ hunspell.spec	15 Dec 2006 12:37:11 -0000	1.4
@@ -1,7 +1,7 @@
 Name: hunspell
 Summary: Hunspell is a spell checker and morphological analyzer library
 Version: 1.1.4
-Release: 2%{?dist}
+Release: 3%{?dist}
 Source: %{name}-%{version}.tar.gz
 Group: System Environment/Libraries
 URL: http://hunspell.sourceforge.net/
@@ -10,6 +10,7 @@
 BuildRequires: libtool
 Patch0: hunspell-1.1.4-sharedlibs.patch
 Patch1: hunspell-1.1.4-defaultdictfromlang.patch
+Patch2: hunspell-1.1.4-capi.patch
 
 %description
 Hunspell is a spell checker and morphological analyzer library and program 
@@ -29,6 +30,7 @@
 %setup -q
 %patch0 -p1 -b .sharedlibs.patch
 %patch1 -p1 -b .defaultdictfromlang.patch
+%patch2 -p1 -b .capi.patch
 
 %build
 libtoolize --automake --force
@@ -79,6 +81,9 @@
 %{_bindir}/unmunch
 
 %changelog
+* Fri Dec 15 2006 Caolan McNamara <caolanm at redhat.com> - 1.1.4-3
+- hunspell#1616353 simple c api for hunspell
+
 * Wed Nov 29 2006 Caolan McNamara <caolanm at redhat.com> - 1.1.4-2
 - add hunspell-1.1.4-defaultdictfromlang.patch to take locale as default
   dictionary




More information about the fedora-cvs-commits mailing list