This patch should allow Aspell to compile with VC++. The changes were submitted to by Francois Boudreau : It's a bit of a mess, we were not very consistent in our editing. We went for the quickess fix, so a few things were just disabled, like file locking and locales. And we had to remove a few const. I, the author of Aspell, do not even know if it will work or the other steps needed to get Aspell to compile under Win32. If you have problems with this patch please contact Francois Boudreau and not me since I do not have a copy of VC++ and in general dislike Microsoft Windows. Kevin Atkinson diff -rubw aspell-0.50.2/common/asc_ctype.hpp aspell-win32/common/asc_ctype.hpp --- aspell-0.50.2/common/asc_ctype.hpp Tue Jul 23 21:08:14 2002 +++ aspell-win32/common/asc_ctype.hpp Wed Oct 2 04:48:44 2002 @@ -14,7 +14,7 @@ static inline bool asc_isspace(char c) { - return c==' '|c=='\n'|c=='\r'|c=='\t'|c=='\f'|c=='\v'; + return (c==' ')|(c=='\n')|(c=='\r')|(c=='\t')|(c=='\f')|(c=='\v'); } static inline bool asc_isdigit(char c) diff -rubw aspell-0.50.2/common/can_have_error.cpp aspell-win32/common/can_have_error.cpp --- aspell-0.50.2/common/can_have_error.cpp Mon Aug 26 17:01:03 2002 +++ aspell-win32/common/can_have_error.cpp Wed Oct 2 04:48:44 2002 @@ -10,9 +10,10 @@ namespace acommon { + /* template void GenericCopyPtr::Parms> ::reset(Error*, CopyPtr::Parms const&); - +*/ CanHaveError::CanHaveError(Error * e) : err_(e) {} diff -rubw aspell-0.50.2/common/clone_ptr-t.hpp aspell-win32/common/clone_ptr-t.hpp --- aspell-0.50.2/common/clone_ptr-t.hpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/clone_ptr-t.hpp Wed Oct 2 04:48:44 2002 @@ -15,10 +15,10 @@ #include "clone_ptr.hpp" #include -#include "generic_copy_ptr-t.hpp" +#include "generic_copy_ptr.hpp" namespace acommon { - +/* template inline T * ClonePtr::Parms::clone(const T * ptr) const { return ptr->clone(); @@ -39,7 +39,7 @@ inline void ClonePtr::Parms::del(T * ptr) { delete ptr; } - +*/ } #endif diff -rubw aspell-0.50.2/common/clone_ptr.hpp aspell-win32/common/clone_ptr.hpp --- aspell-0.50.2/common/clone_ptr.hpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/clone_ptr.hpp Wed Oct 2 04:48:44 2002 @@ -21,9 +21,18 @@ class ClonePtr { struct Parms { - T * clone(const T * ptr) const; - void assign(T * & rhs, const T * lhs) const; - void del(T * ptr); + T * clone(const T * ptr) const{return ptr->clone();} + void assign(T * & rhs, const T * lhs) const{ + if (typeid(*rhs) == typeid(*lhs)) { + rhs->assign(lhs); + } else { + T * temp = rhs; + rhs = lhs->clone(); + delete temp; + } + } + void del(T * ptr){delete ptr;} + }; GenericCopyPtr impl; diff -rubw aspell-0.50.2/common/config.cpp aspell-win32/common/config.cpp --- aspell-0.50.2/common/config.cpp Sun Aug 25 21:04:33 2002 +++ aspell-win32/common/config.cpp Wed Oct 2 04:48:44 2002 @@ -283,10 +283,12 @@ const KeyInfo * i; i = acommon::find(key, kmi.main_begin, kmi.main_end); - if (i != kmi.main_end) return ret = i; + if (i != kmi.main_end) + return ret = PosibErr(i); //FB i = acommon::find(key, kmi.extra_begin, kmi.extra_end); - if (i != kmi.extra_end) return ret = i; + if (i != kmi.extra_end) + return ret = PosibErr(i); //FB const char * h = strchr(key, '-'); @@ -301,7 +303,8 @@ return ret.prim_err(unknown_key, key); i = acommon::find(key, j->begin, j->end); - if (i != j->end) return ret = i; + if (i != j->end) + return ret = PosibErr(i); //FB return ret.prim_err(unknown_key, key); } diff -rubw aspell-0.50.2/common/config.hpp aspell-win32/common/config.hpp --- aspell-0.50.2/common/config.hpp Mon Aug 12 19:10:18 2002 +++ aspell-win32/common/config.hpp Wed Oct 2 04:48:44 2002 @@ -59,7 +59,7 @@ class PossibleElementsEmul; class NotifierEnumeration; class GetLine; - class MDInfoListofLists; + class MDInfoListofLists; //FB struct ConfigKeyModuleInfo { const KeyInfo * main_begin; diff -rubw aspell-0.50.2/common/convert.cpp aspell-win32/common/convert.cpp --- aspell-0.50.2/common/convert.cpp Sat Aug 24 19:38:38 2002 +++ aspell-win32/common/convert.cpp Wed Oct 2 04:48:44 2002 @@ -37,7 +37,7 @@ class ToUniLookup { Uni32 data[256]; - static const Uni32 npos = (Uni32)(-1); + static const Uni32 npos; // FB = (Uni32)(-1); public: void reset(); Uni32 operator[] (char key) const {return data[(unsigned char)key];} @@ -45,6 +45,8 @@ bool insert(char key, Uni32 value); }; + const Uni32 ToUniLookup::npos = (Uni32)(-1); // FB + void ToUniLookup::reset() { for (int i = 0; i != 256; ++i) @@ -82,7 +84,7 @@ { private: char unknown; - static const Uni32 npos = (Uni32)(-1); + static const Uni32 npos; // FB = (Uni32)(-1); UniItem * overflow_end; UniItem data[256*4]; @@ -95,6 +97,8 @@ inline char operator[] (Uni32 key) const; bool insert(Uni32 key, char value); }; + + const Uni32 FromUniLookup::npos = (Uni32)(-1); // FB void FromUniLookup::reset() { diff -rubw aspell-0.50.2/common/convert.hpp aspell-win32/common/convert.hpp --- aspell-0.50.2/common/convert.hpp Sat Aug 10 11:17:06 2002 +++ aspell-win32/common/convert.hpp Wed Oct 2 04:48:44 2002 @@ -57,7 +57,7 @@ FilterCharVector buf; - static const unsigned int null_len_ = 4; // POSIB FIXME: Be more precise + //static const unsigned int null_len_;// FB = 4; // POSIB FIXME: Be more precise public: @@ -73,11 +73,11 @@ void append_null(CharVector & out) const { - const char nul[8] = {0}; // 8 should be more than enough - out.write(nul, null_len_); + const char nul[8] = {0, 0, 0, 0, 0 ,0 ,0, 0}; // FB // 8 should be more than enough + out.write(nul, /*null_len_*/4); //FB } - unsigned int null_len() const {return null_len_;} + unsigned int null_len() const {return /*null_len_*/4;} // this filters will generally not translate null characters // if you need a null character at the end, add it yourself diff -rubw aspell-0.50.2/common/copy_ptr-t.hpp aspell-win32/common/copy_ptr-t.hpp --- aspell-0.50.2/common/copy_ptr-t.hpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/copy_ptr-t.hpp Wed Oct 2 04:48:44 2002 @@ -14,10 +14,10 @@ #define autil__copy_ptr_t #include "copy_ptr.hpp" -#include "generic_copy_ptr-t.hpp" +#include "generic_copy_ptr.hpp" namespace acommon { - + /* //FB template T * CopyPtr::Parms::clone(const T * ptr) const { return new T(*ptr); @@ -32,6 +32,7 @@ void CopyPtr::Parms::del(T * ptr) { delete ptr; } + */ } #endif diff -rubw aspell-0.50.2/common/copy_ptr.hpp aspell-win32/common/copy_ptr.hpp --- aspell-0.50.2/common/copy_ptr.hpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/copy_ptr.hpp Wed Oct 2 04:48:44 2002 @@ -13,7 +13,7 @@ #ifndef autil__copy_ptr #define autil__copy_ptr -#include "generic_copy_ptr.hpp" +#include "generic_copy_ptr-t.hpp" //FB namespace acommon { @@ -21,9 +21,9 @@ class CopyPtr { struct Parms { - T * clone(const T * ptr) const; - void assign(T * & rhs, const T * lhs) const; - void del(T * ptr); + T * clone(const T * ptr) const {return new T(*ptr);} //FB + void assign(T * & rhs, const T * lhs) const{*rhs = *lhs;} //FB + void del(T * ptr){ delete ptr; } //FB }; GenericCopyPtr impl; diff -rubw aspell-0.50.2/common/enumeration.hpp aspell-win32/common/enumeration.hpp --- aspell-0.50.2/common/enumeration.hpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/enumeration.hpp Wed Oct 2 04:48:44 2002 @@ -74,8 +74,51 @@ Value next() {return p_->next();} bool at_end() const {return p_->at_end();} }; +/* + template // FB (VC++ doesn't understand + // default template param it seems) + // Parms is expected to have the following members: + // typename Value + // typename Iterator; + // bool endf(Iterator) + // Value end_state() + // Value deref(Iterator) + class MakeVirEnumeration : public VirEnumeration { //FB + public: + typedef typename Parms::Iterator Iterator; + typedef typename Parms::Value Value; + private: + Iterator i_; + Parms parms_; + public: + + MakeVirEnumeration(const Iterator i, const Parms & p = Parms()) + : i_(i), parms_(p) {} + + VirEnumeration * clone() const { //FB + return new MakeVirEnumeration(*this); + } - template > + void assign (const VirEnumeration * other) { //FB + *this = *static_cast(other); + } + + Value next() { + if (parms_.endf(i_)) + return parms_.end_state(); + Value temp = parms_.deref(i_); + ++i_; + return temp; + } + + bool at_end() const { + return parms_.endf(i_); + } + }; +*/ + + // FB (All next class) + template // Parms is expected to have the following members: // typename Value // typename Iterator; @@ -115,21 +158,22 @@ } }; + template struct MakeAlwaysEndEnumerationParms { Value end_state() const {return Value();} }; - +/* FB (Not used?) template struct MakeAlwaysEndEnumerationParms { Value * end_state() const {return 0;} }; - +*/ template class MakeAlwaysEndEnumeration : public VirEnumeration { MakeAlwaysEndEnumerationParms parms_; public: - MakeAlwaysEndEnumeration * clone() const { + /*MakeAlwaysEndEnumeration*/VirEnumeration * clone() const {//FB return new MakeAlwaysEndEnumeration(*this); } void assign(const VirEnumeration * that) { diff -rubw aspell-0.50.2/common/errors.cpp aspell-win32/common/errors.cpp --- aspell-0.50.2/common/errors.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/common/errors.cpp Wed Oct 2 04:48:44 2002 @@ -16,7 +16,7 @@ 0, // isa 0, // mesg 0, // num_parms - {} // parms + {""} // FB // parms }; extern "C" const ErrorInfo * const aerror_other = &aerror_other_obj; @@ -24,7 +24,7 @@ 0, // isa 0, // mesg 0, // num_parms - {} // parms + {""} // FB // parms }; extern "C" const ErrorInfo * const aerror_operation_not_supported = &aerror_operation_not_supported_obj; @@ -32,7 +32,7 @@ aerror_operation_not_supported, // isa 0, // mesg 0, // num_parms - {} // parms + {""} // parms }; extern "C" const ErrorInfo * const aerror_cant_copy = &aerror_cant_copy_obj; @@ -232,7 +232,7 @@ 0, // isa 0, // mesg 0, // num_parms - {} // parms + {""} // FB // parms }; extern "C" const ErrorInfo * const aerror_pipe = &aerror_pipe_obj; @@ -240,7 +240,7 @@ aerror_pipe, // isa 0, // mesg 0, // num_parms - {} // parms + {""} // FB// parms }; extern "C" const ErrorInfo * const aerror_cant_create_pipe = &aerror_cant_create_pipe_obj; @@ -248,7 +248,7 @@ aerror_pipe, // isa 0, // mesg 0, // num_parms - {} // parms + {""} // FB// parms }; extern "C" const ErrorInfo * const aerror_process_died = &aerror_process_died_obj; @@ -256,7 +256,7 @@ 0, // isa 0, // mesg 0, // num_parms - {} // parms + {""} //FB // parms }; extern "C" const ErrorInfo * const aerror_bad_input = &aerror_bad_input_obj; @@ -272,7 +272,7 @@ aerror_bad_input, // isa 0, // mesg 0, // num_parms - {} // parms + {""} //FB// parms }; extern "C" const ErrorInfo * const aerror_word_list_flags = &aerror_word_list_flags_obj; @@ -280,7 +280,7 @@ aerror_word_list_flags, // isa 0, // mesg 0, // num_parms - {} // parms + {""} //FB // parms }; extern "C" const ErrorInfo * const aerror_invalid_flag = &aerror_invalid_flag_obj; @@ -288,7 +288,7 @@ aerror_word_list_flags, // isa 0, // mesg 0, // num_parms - {} // parms + {""} //FB// parms }; extern "C" const ErrorInfo * const aerror_conflicting_flags = &aerror_conflicting_flags_obj; diff -rubw aspell-0.50.2/common/file_util.cpp aspell-win32/common/file_util.cpp --- aspell-0.50.2/common/file_util.cpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/file_util.cpp Wed Oct 2 04:48:44 2002 @@ -19,7 +19,8 @@ // This needs to be and not #include -#include +//#include // FB +#include //FB (for _access) #include @@ -130,7 +131,8 @@ } bool file_exists(ParmString name) { - return access(name, F_OK) == 0; + //return access(name, F_OK) == 0; // FB + return _access(name, 0) == 0; //struct stat fileinfo; //return stat(name, &fileinfo) == 0; } diff -rubw aspell-0.50.2/common/fstream.hpp aspell-win32/common/fstream.hpp --- aspell-0.50.2/common/fstream.hpp Wed Sep 18 08:38:18 2002 +++ aspell-win32/common/fstream.hpp Wed Oct 2 04:48:44 2002 @@ -15,6 +15,7 @@ // NOTE: See iostream.hpp for the standard stream (ie standard input, // output, error) +using namespace std; // FB namespace acommon { class String; @@ -43,7 +44,7 @@ // NOTE: Use c_stream only as a last resort as it may // disappear if the underlining impl changes - std::FILE * c_stream(); + FILE * c_stream(); // FB // However, file_no will always be available. int file_no(); Only in aspell-win32/common: fstream.hpp.orig diff -rubw aspell-0.50.2/common/generic_copy_ptr.hpp aspell-win32/common/generic_copy_ptr.hpp --- aspell-0.50.2/common/generic_copy_ptr.hpp Thu Nov 29 22:55:45 2001 +++ aspell-win32/common/generic_copy_ptr.hpp Wed Oct 2 04:48:44 2002 @@ -13,6 +13,10 @@ #ifndef autil__generic_copy_ptr #define autil__generic_copy_ptr +#ifdef WIN32 +# pragma warning(disable:4786) +#endif + namespace acommon { // Parms is expected to have the following members diff -rubw aspell-0.50.2/common/hash-t.hpp aspell-win32/common/hash-t.hpp --- aspell-0.50.2/common/hash-t.hpp Sun Aug 11 08:58:30 2002 +++ aspell-win32/common/hash-t.hpp Wed Oct 2 04:48:44 2002 @@ -84,20 +84,22 @@ } template - std::pair::iterator,bool> HashTable

::insert(const Value & to_insert) + std::pair::iterator,bool> HashTable

::insert(const Value & to_insert) //FB { bool have; iterator put_me_here = find_i(parms_.key(to_insert), have); - if (have && !parms_.is_multi) + if (have && !parms_.is_multi()) //FB return std::pair(put_me_here,false); Node * new_node = node_pool_.new_node(); if (new_node == 0) { resize_i(prime_index_+1); return insert(to_insert); } + new (const_cast(reinterpret_cast(&new_node->data))) Value(to_insert); + new_node->next = *put_me_here.n; *put_me_here.n = new_node; ++size_; @@ -114,6 +116,7 @@ --size_; } + template typename HashTable

::Size HashTable

::erase(const Key & k) { @@ -152,7 +155,7 @@ } template - std::pair::iterator, typename HashTable

::iterator> + std::pair::iterator, /*typename*/ HashTable

::iterator>//FB HashTable

::equal_range_i(const Key & to_find, int & c) { c = 0; @@ -174,6 +177,9 @@ template void HashTable

::del() { + typedef typename P::Value value_type; //FB + typedef value_type Value; //FB + for (Node * * i = table_; i != table_end_; ++i) { Node * n = *i; while (n != 0) { diff -rubw aspell-0.50.2/common/hash.hpp aspell-win32/common/hash.hpp --- aspell-0.50.2/common/hash.hpp Sun Aug 11 08:58:30 2002 +++ aspell-win32/common/hash.hpp Wed Oct 2 04:48:44 2002 @@ -81,6 +81,7 @@ Value * operator->() const {return &n->data;} HT_ConstIterator & operator++() {inc(); return *this;} HT_ConstIterator operator++(int) {HT_ConstIterator tmp(*this); inc(); return tmp;} + }; template @@ -145,7 +146,7 @@ const_iterator begin() const {return const_iterator(table_);} const_iterator end() const {return const_iterator(table_end_,*table_end_);} size_type size() const {return size_;} - bool empty() const {return size_ + 1;} + bool empty() const {return size_ + 1 != 0;} std::pair insert(const value_type &); void erase(iterator); size_type erase(const key_type &); @@ -258,15 +259,18 @@ template struct HashSetParms { - typedef const K Value; +// typedef const K Value; + typedef K Value; typedef const K Key; - static const bool is_multi = m; + // static const bool is_multi = m;//FB + bool is_multi(){ return m; } //FB HF hash; E equal; const K & key(const K & v) {return v;} HashSetParms(const HF & h = HF(), const E & e = E()) : hash(h), equal(e) {} }; + template , typename E = std::equal_to > class hash_set : public HashTable > { @@ -294,7 +298,8 @@ { typedef std::pair Value; typedef const K Key; - static const bool is_multi = m; + //static const bool is_multi = m; //FB + bool is_multi(){ return m; } //FB HF hash; E equal; const K & key(const Value & v) {return v.first;} diff -rubw aspell-0.50.2/common/info.cpp aspell-win32/common/info.cpp --- aspell-0.50.2/common/info.cpp Mon Aug 12 19:10:18 2002 +++ aspell-win32/common/info.cpp Wed Oct 2 04:48:44 2002 @@ -14,7 +14,9 @@ /* BSDi defines u_intXX_t types in machine/types.h */ #include #endif -#include +//#include FB +#include //FB +#include //FB #include "iostream.hpp" @@ -32,7 +34,7 @@ #include "strtonum.hpp" namespace acommon { - +/* FB class Dir { DIR * d_; Dir(const Dir &); @@ -42,7 +44,7 @@ Dir(DIR * d) : d_(d) {} ~Dir() {if (d_) closedir(d_);} }; - +*/ ///////////////////////////////////////////////////////////////// // // Lists of Info Lists @@ -53,13 +55,16 @@ struct DictExt { - static const size_t max_ext_size = 15; + static const size_t max_ext_size; // FB = 15; const ModuleInfo * module; size_t ext_size; - char ext[max_ext_size + 1]; + //char ext[max_ext_size + 1]; //FB + char ext[15 + 1]; //FB DictExt(ModuleInfo * m, const char * e); }; + const size_t DictExt::max_ext_size = 15; // FB + typedef Vector DictExtList; struct MDInfoListAll @@ -77,8 +82,9 @@ void fill_helper_lists(const StringList &); }; - struct MDInfoListofLists + class MDInfoListofLists // FB { + public://FB MDInfoListAll * data; int offset; @@ -163,12 +169,29 @@ StringListEnumeration els = list_all.for_dirs.elements_obj(); const char * dir; while ( (dir = els.next()) != 0) { - Dir d(opendir(dir)); - if (d==0) continue; + int length = strlen(dir); + char *buff = new char[length + 3]; + strcpy(buff, dir); + buff[length] = '\\'; + buff[length+1] = '*'; + buff[length+2] = '\0'; + + + // Dir d(opendir(dir)); //FB + WIN32_FIND_DATA fd; //FB + HANDLE hFile = FindFirstFile( buff/*dir*/,&fd ); //FB + + //if (d==0) continue; FB + if (hFile == INVALID_HANDLE_VALUE){ + DWORD dw = GetLastError(); + continue; // FB + } + //struct dirent * entry; //FB + //while ( (entry = readdir(d)) != 0) { // FB + while(FindNextFile(hFile, &fd) != 0) { // FB - struct dirent * entry; - while ( (entry = readdir(d)) != 0) { - const char * name = entry->d_name; +// const char * name = entry->d_name; // FB + const char * name = fd.cFileName; // FB const char * dot_loc = strrchr(name, '.'); unsigned int name_size = dot_loc == 0 ? strlen(name) : dot_loc - name; @@ -184,6 +207,8 @@ RET_ON_ERR(in.open(path, "r")); RET_ON_ERR(proc_info(list_all, config, name, name_size, in)); } + FindClose(hFile); // FB + delete[] buff; } return no_err; } @@ -215,7 +240,8 @@ { err.prim_err(bad_value, key, data, "a number between 0 and 1"); - goto ERROR; + //goto ERROR; //FB + goto error; //FB } } else if (key == "lib-dir") { to_add->lib_dir = data; @@ -228,7 +254,8 @@ itemize(data, to_add->dict_exts); } else { err.prim_err(unknown_key, key); - goto ERROR; + //goto ERROR; //FB + goto error; // FB } } @@ -239,7 +266,8 @@ *prev = to_add; return err; - ERROR: + //ERROR: + error: // FB Ridiculous isn't? delete to_add; return err; } @@ -292,12 +320,26 @@ StringListEnumeration els = list_all.dict_dirs.elements_obj(); const char * dir; while ( (dir = els.next()) != 0) { - Dir d(opendir(dir)); - if (d==0) continue; + int length = strlen(dir); //FB + char *buff = new char[length + 3]; + strcpy(buff, dir); + buff[length] = '\\'; + buff[length+1] = '*'; + buff[length+2] = '\0'; + + // Dir d(opendir(dir)); //FB + WIN32_FIND_DATA fd; //FB + HANDLE hFile = FindFirstFile( /*dir*/buff,&fd ); //FB + delete[] buff;//FB + //if (d==0) continue; FB + if (hFile == INVALID_HANDLE_VALUE) continue; // FB + + //struct dirent * entry; //FB + //while ( (entry = readdir(d)) != 0) { // FB + while(FindNextFile(hFile, &fd) != 0) { // FB - struct dirent * entry; - while ( (entry = readdir(d)) != 0) { - const char * name = entry->d_name; +// const char * name = entry->d_name; // FB + const char * name = fd.cFileName; // FB unsigned int name_size = strlen(name); DictExtList::const_iterator i = list_all.dict_exts.begin(); @@ -318,7 +360,9 @@ RET_ON_ERR(proc_file(list_all, config, dir, name, name_size, i->module)); } + } + return no_err; } @@ -481,15 +525,15 @@ for_dirs = dirs; err = module_info_list.fill(*this, c); - if (err.has_err()) goto ERROR; + if (err.has_err()) goto error;// FB fill_helper_lists(dirs); err = dict_info_list.fill(*this, c); - if (err.has_err()) goto ERROR; + if (err.has_err()) goto error; // FB return err; - ERROR: + error: //FB clear(); return err; } diff -rubw aspell-0.50.2/common/posib_err.cpp aspell-win32/common/posib_err.cpp --- aspell-0.50.2/common/posib_err.cpp Fri Jul 26 21:27:10 2002 +++ aspell-win32/common/posib_err.cpp Wed Oct 2 04:48:44 2002 @@ -9,12 +9,12 @@ #include #include "posib_err.hpp" - +using namespace std; // FB namespace acommon { String & String::operator= (const PosibErr & s) { - std::string::operator=(s.data); + string::operator=(s.data); //FB return *this; } @@ -74,7 +74,7 @@ { assert(err_ != 0); assert(err_->refcount == 1); - char * & m = const_cast(err_->err->mesg); + char * /*&*/ m = const_cast(err_->err->mesg); // FB uncertain unsigned int orig_len = strlen(m); unsigned int new_len = fn.size() + 2 + orig_len + 1; char * s = new char[new_len]; diff -rubw aspell-0.50.2/common/posib_err.hpp aspell-win32/common/posib_err.hpp --- aspell-0.50.2/common/posib_err.hpp Sun Aug 11 08:58:30 2002 +++ aspell-win32/common/posib_err.hpp Wed Oct 2 04:48:44 2002 @@ -10,6 +10,8 @@ #include "string.hpp" #include "error.hpp" +using namespace std; // FB + namespace acommon { // PosibErr is a special Error handling device that will make @@ -204,7 +206,7 @@ inline String & String::operator= (const PosibErr & s) { - std::string::operator=(s.data); + string::operator=(s.data); // FB return *this; } diff -rubw aspell-0.50.2/common/stack_ptr.hpp aspell-win32/common/stack_ptr.hpp --- aspell-0.50.2/common/stack_ptr.hpp Sun Aug 11 08:58:30 2002 +++ aspell-win32/common/stack_ptr.hpp Wed Oct 2 04:49:03 2002 @@ -21,9 +21,9 @@ // PosibErr > pe = fun(); // and operator* and StackPtr(T *) will be used. The explicit // doesn't protect us here due to PosibErr - StackPtr(const StackPtr & other); + //StackPtr(const StackPtr & other); FB // becuase I am paranoid - StackPtr & operator=(const StackPtr & other); + //StackPtr & operator=(const StackPtr & other); FB public: diff -rubw aspell-0.50.2/common/string.hpp aspell-win32/common/string.hpp --- aspell-0.50.2/common/string.hpp Thu Nov 29 22:55:46 2001 +++ aspell-win32/common/string.hpp Wed Oct 2 04:49:03 2002 @@ -15,6 +15,7 @@ #include "istream.hpp" #include "ostream.hpp" +using namespace std; // FB namespace acommon { template class PosibErr; @@ -22,27 +23,27 @@ class String : public std::string, public OStream { public: - String() : std::string() {} - String(const char * s) : std::string(s) {} - String(const char * s, unsigned int size) : std::string(s, size) {} - String(ParmString s) : std::string(s) {} - String(const std::string & s) : std::string(s) {} - String(const String & other) : std::string(other) {} + String() : string() {} + String(const char * s) : string(s) {} + String(const char * s, unsigned int size) : string(s, size) {} + String(ParmString s) : string(s) {} + String(const std::string & s) : string(s) {} + String(const String & other) : string(other) {} String & operator= (const char * s) { - std::string::operator= (s); + string::operator= (s); return *this; } inline String & operator= (const PosibErr & s); String & operator= (ParmString s) { - std::string::operator= (s); + string::operator= (s); return *this; } String & operator= (const std::string & s) { - std::string::operator= (s); + string::operator= (s); return *this; } String & operator= (const String & other) { - std::string::operator= (other); + string::operator= (other); return *this; } /*inline*/ String & operator= (const PosibErr & s); diff -rubw aspell-0.50.2/common/string_buffer.cpp aspell-win32/common/string_buffer.cpp --- aspell-0.50.2/common/string_buffer.cpp Thu Nov 29 22:55:46 2001 +++ aspell-win32/common/string_buffer.cpp Wed Oct 2 04:49:03 2002 @@ -17,7 +17,7 @@ } char * StringBuffer::alloc(unsigned int size) { - if (fill + size > buf_size) { + if (fill + size > get_buf_size()) { fill = 1; bufs.push_front(sbuf); } diff -rubw aspell-0.50.2/common/string_buffer.hpp aspell-win32/common/string_buffer.hpp --- aspell-0.50.2/common/string_buffer.hpp Thu Nov 29 22:55:46 2001 +++ aspell-win32/common/string_buffer.hpp Wed Oct 2 04:49:03 2002 @@ -10,10 +10,11 @@ class StringBuffer { public: // but dont use - static const unsigned int buf_size = 1024 - 16; + //static const unsigned int buf_size; // FB = 1024 - 16; struct Buf { - char buf[buf_size]; + char buf[1024 - 16]; // FB }; + unsigned int get_buf_size(){ return 1024 - 16; } //FB private: static const Buf sbuf; BasicList bufs; @@ -22,5 +23,7 @@ StringBuffer(); char * alloc(unsigned int size); }; + + //const unsigned int StringBuffer::buf_size = 1024 - 16; // FB } diff -rubw aspell-0.50.2/interfaces/cc/aspell.h aspell-win32/interfaces/cc/aspell.h --- aspell-0.50.2/interfaces/cc/aspell.h Fri Aug 30 14:20:35 2002 +++ aspell-win32/interfaces/cc/aspell.h Wed Oct 2 04:49:03 2002 @@ -9,10 +9,17 @@ #ifndef ASPELL_ASPELL__H #define ASPELL_ASPELL__H -#ifdef __cplusplus -extern "C" { +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) #endif + +//#ifdef __cplusplus +//"C" { +//#endif + /******************************* type id *******************************/ @@ -34,13 +41,13 @@ typedef struct AspellMutableContainer AspellMutableContainer; -int aspell_mutable_container_add(struct AspellMutableContainer * ths, const char * to_add); +ASPELL_ALL_DLL_API int aspell_mutable_container_add(struct AspellMutableContainer * ths, const char * to_add); -int aspell_mutable_container_remove(struct AspellMutableContainer * ths, const char * to_rem); +ASPELL_ALL_DLL_API int aspell_mutable_container_remove(struct AspellMutableContainer * ths, const char * to_rem); -void aspell_mutable_container_clear(struct AspellMutableContainer * ths); +ASPELL_ALL_DLL_API void aspell_mutable_container_clear(struct AspellMutableContainer * ths); -struct AspellMutableContainer * aspell_mutable_container_to_mutable_container(struct AspellMutableContainer * ths); +ASPELL_ALL_DLL_API struct AspellMutableContainer * aspell_mutable_container_to_mutable_container(struct AspellMutableContainer * ths); @@ -82,50 +89,50 @@ typedef struct AspellKeyInfoEnumeration AspellKeyInfoEnumeration; -int aspell_key_info_enumeration_at_end(const struct AspellKeyInfoEnumeration * ths); +ASPELL_ALL_DLL_API int aspell_key_info_enumeration_at_end(const struct AspellKeyInfoEnumeration * ths); -const struct AspellKeyInfo * aspell_key_info_enumeration_next(struct AspellKeyInfoEnumeration * ths); +ASPELL_ALL_DLL_API const struct AspellKeyInfo * aspell_key_info_enumeration_next(struct AspellKeyInfoEnumeration * ths); -void delete_aspell_key_info_enumeration(struct AspellKeyInfoEnumeration * ths); +ASPELL_ALL_DLL_API void delete_aspell_key_info_enumeration(struct AspellKeyInfoEnumeration * ths); -struct AspellKeyInfoEnumeration * aspell_key_info_enumeration_clone(const struct AspellKeyInfoEnumeration * ths); +ASPELL_ALL_DLL_API struct AspellKeyInfoEnumeration * aspell_key_info_enumeration_clone(const struct AspellKeyInfoEnumeration * ths); -void aspell_key_info_enumeration_assign(struct AspellKeyInfoEnumeration * ths, const struct AspellKeyInfoEnumeration * other); +ASPELL_ALL_DLL_API void aspell_key_info_enumeration_assign(struct AspellKeyInfoEnumeration * ths, const struct AspellKeyInfoEnumeration * other); typedef struct AspellConfig AspellConfig; -struct AspellConfig * new_aspell_config(); +ASPELL_ALL_DLL_API struct AspellConfig * new_aspell_config(); -void delete_aspell_config(struct AspellConfig * ths); +ASPELL_ALL_DLL_API void delete_aspell_config(struct AspellConfig * ths); -struct AspellConfig * aspell_config_clone(const struct AspellConfig * ths); +ASPELL_ALL_DLL_API struct AspellConfig * aspell_config_clone(const struct AspellConfig * ths); -void aspell_config_assign(struct AspellConfig * ths, const struct AspellConfig * other); +ASPELL_ALL_DLL_API void aspell_config_assign(struct AspellConfig * ths, const struct AspellConfig * other); -unsigned int aspell_config_error_number(const struct AspellConfig * ths); +ASPELL_ALL_DLL_API unsigned int aspell_config_error_number(const struct AspellConfig * ths); -const char * aspell_config_error_message(const struct AspellConfig * ths); +ASPELL_ALL_DLL_API const char * aspell_config_error_message(const struct AspellConfig * ths); -const struct AspellError * aspell_config_error(const struct AspellConfig * ths); +ASPELL_ALL_DLL_API const struct AspellError * aspell_config_error(const struct AspellConfig * ths); /* sets extra keys which this config class should accept * begin and end are expected to point to the begging * and end of an array of Aspell Key Info */ -void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end); +ASPELL_ALL_DLL_API void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end); /* returns the KeyInfo object for the * corresponding key or returns null and sets * error_num to PERROR_UNKNOWN_KEY if the key is * not valid. The pointer returned is valid for * the lifetime of the object. */ -const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key); /* returns a newly allocated enumeration of all the * possible objects this config class uses */ -struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra); +ASPELL_ALL_DLL_API struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra); /* returns the default value for given key which * way involve substating variables, thus it is @@ -133,12 +140,12 @@ * and sets error_num to PERROR_UNKNOWN_KEY if * the key is not valid. Uses the temporary * string. */ -const char * aspell_config_get_default(struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API const char * aspell_config_get_default(struct AspellConfig * ths, const char * key); /* returns a newly alloacted enumeration of all the * key/value pairs. This DOES not include ones * which are set to their default values */ -struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths); +ASPELL_ALL_DLL_API struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths); /* inserts an item, if the item already exists it * will be replaced. returns true if it succesed @@ -150,7 +157,7 @@ * PERROR_CANT_CHANGE_VALUE, and if the value is * a list and you are trying to set it directory * it sets error_num to PERROR_LIST_SET */ -int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value); +ASPELL_ALL_DLL_API int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value); /* remove a key and returns true if it exists * otherise return false. This effictly sets the @@ -162,20 +169,20 @@ * PERROR_UNKNOWN_KEY, if the value can not be * changed sets error_num to * PERROR_CANT_CHANGE_VALUE */ -int aspell_config_remove(struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API int aspell_config_remove(struct AspellConfig * ths, const char * key); -int aspell_config_have(const struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API int aspell_config_have(const struct AspellConfig * ths, const char * key); /* returns null on error */ -const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key); -int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst); +ASPELL_ALL_DLL_API int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst); /* return -1 on error, 0 if false, 1 if true */ -int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key); /* return -1 on error */ -int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key); +ASPELL_ALL_DLL_API int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key); @@ -193,7 +200,7 @@ typedef struct AspellError AspellError; -int aspell_error_is_a(const struct AspellError * ths, const struct AspellErrorInfo * e); +ASPELL_ALL_DLL_API int aspell_error_is_a(const struct AspellError * ths, const struct AspellErrorInfo * e); struct AspellErrorInfo { @@ -218,13 +225,13 @@ typedef struct AspellCanHaveError AspellCanHaveError; -unsigned int aspell_error_number(const struct AspellCanHaveError * ths); +ASPELL_ALL_DLL_API unsigned int aspell_error_number(const struct AspellCanHaveError * ths); -const char * aspell_error_message(const struct AspellCanHaveError * ths); +ASPELL_ALL_DLL_API const char * aspell_error_message(const struct AspellCanHaveError * ths); -const struct AspellError * aspell_error(const struct AspellCanHaveError * ths); +ASPELL_ALL_DLL_API const struct AspellError * aspell_error(const struct AspellCanHaveError * ths); -void delete_aspell_can_have_error(struct AspellCanHaveError * ths); +ASPELL_ALL_DLL_API void delete_aspell_can_have_error(struct AspellCanHaveError * ths); @@ -274,44 +281,44 @@ typedef struct AspellSpeller AspellSpeller; -struct AspellCanHaveError * new_aspell_speller(struct AspellConfig * config); +ASPELL_ALL_DLL_API struct AspellCanHaveError * new_aspell_speller(struct AspellConfig * config); -struct AspellSpeller * to_aspell_speller(struct AspellCanHaveError * obj); +ASPELL_ALL_DLL_API struct AspellSpeller * to_aspell_speller(struct AspellCanHaveError * obj); -void delete_aspell_speller(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API void delete_aspell_speller(struct AspellSpeller * ths); -unsigned int aspell_speller_error_number(const struct AspellSpeller * ths); +ASPELL_ALL_DLL_API unsigned int aspell_speller_error_number(const struct AspellSpeller * ths); -const char * aspell_speller_error_message(const struct AspellSpeller * ths); +ASPELL_ALL_DLL_API const char * aspell_speller_error_message(const struct AspellSpeller * ths); -const struct AspellError * aspell_speller_error(const struct AspellSpeller * ths); +ASPELL_ALL_DLL_API const struct AspellError * aspell_speller_error(const struct AspellSpeller * ths); -struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths); /* returns 0 if it is not in the dictionary, * 1 if it is, or -1 on error. */ -int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size); +ASPELL_ALL_DLL_API int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size); -int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size); +ASPELL_ALL_DLL_API int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size); -int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size); +ASPELL_ALL_DLL_API int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size); -const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths); -const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths); -const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths); -int aspell_speller_save_all_word_lists(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API int aspell_speller_save_all_word_lists(struct AspellSpeller * ths); -int aspell_speller_clear_session(struct AspellSpeller * ths); +ASPELL_ALL_DLL_API int aspell_speller_clear_session(struct AspellSpeller * ths); /* Return null on error. * the word list returned by suggest is only valid until the next * call to suggest */ -const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size); +ASPELL_ALL_DLL_API const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size); -int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size); +ASPELL_ALL_DLL_API int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size); @@ -321,15 +328,15 @@ typedef struct AspellFilter AspellFilter; -void delete_aspell_filter(struct AspellFilter * ths); +ASPELL_ALL_DLL_API void delete_aspell_filter(struct AspellFilter * ths); -unsigned int aspell_filter_error_number(const struct AspellFilter * ths); +ASPELL_ALL_DLL_API unsigned int aspell_filter_error_number(const struct AspellFilter * ths); -const char * aspell_filter_error_message(const struct AspellFilter * ths); +ASPELL_ALL_DLL_API const char * aspell_filter_error_message(const struct AspellFilter * ths); -const struct AspellError * aspell_filter_error(const struct AspellFilter * ths); +ASPELL_ALL_DLL_API const struct AspellError * aspell_filter_error(const struct AspellFilter * ths); -struct AspellFilter * to_aspell_filter(struct AspellCanHaveError * obj); +ASPELL_ALL_DLL_API struct AspellFilter * to_aspell_filter(struct AspellCanHaveError * obj); @@ -351,13 +358,13 @@ typedef struct AspellDocumentChecker AspellDocumentChecker; -void delete_aspell_document_checker(struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API void delete_aspell_document_checker(struct AspellDocumentChecker * ths); -unsigned int aspell_document_checker_error_number(const struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API unsigned int aspell_document_checker_error_number(const struct AspellDocumentChecker * ths); -const char * aspell_document_checker_error_message(const struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API const char * aspell_document_checker_error_message(const struct AspellDocumentChecker * ths); -const struct AspellError * aspell_document_checker_error(const struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API const struct AspellError * aspell_document_checker_error(const struct AspellDocumentChecker * ths); /* Creates a new document checker. * The speller class is expect to last until this @@ -368,13 +375,13 @@ * If filter is given then it will take ownership of * the filter class and use it to do the filtering. * You are expected to free the checker when done. */ -struct AspellCanHaveError * new_aspell_document_checker(struct AspellSpeller * speller); +ASPELL_ALL_DLL_API struct AspellCanHaveError * new_aspell_document_checker(struct AspellSpeller * speller); -struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj); +ASPELL_ALL_DLL_API struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj); /* reset the internal state of the filter. * should be called whenever a new document is being filtered */ -void aspell_document_checker_reset(struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API void aspell_document_checker_reset(struct AspellDocumentChecker * ths); /* process a string * The string passed in should only be split on white space @@ -383,15 +390,15 @@ * in the document. Passing in stings out of order, skipping * strings or passing them in more than once may lead to undefined * results. */ -void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size); +ASPELL_ALL_DLL_API void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size); /* returns the next misspelled word in the processed string * if there are no more misspelled word than token.word * will be null and token.size will be 0 */ -struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths); /* returns the underlying filter class */ -struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths); +ASPELL_ALL_DLL_API struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths); @@ -401,11 +408,11 @@ typedef struct AspellWordList AspellWordList; -int aspell_word_list_empty(const struct AspellWordList * ths); +ASPELL_ALL_DLL_API int aspell_word_list_empty(const struct AspellWordList * ths); -unsigned int aspell_word_list_size(const struct AspellWordList * ths); +ASPELL_ALL_DLL_API unsigned int aspell_word_list_size(const struct AspellWordList * ths); -struct AspellStringEnumeration * aspell_word_list_elements(const struct AspellWordList * ths); +ASPELL_ALL_DLL_API struct AspellStringEnumeration * aspell_word_list_elements(const struct AspellWordList * ths); @@ -415,15 +422,15 @@ typedef struct AspellStringEnumeration AspellStringEnumeration; -void delete_aspell_string_enumeration(struct AspellStringEnumeration * ths); +ASPELL_ALL_DLL_API void delete_aspell_string_enumeration(struct AspellStringEnumeration * ths); -struct AspellStringEnumeration * aspell_string_enumeration_clone(const struct AspellStringEnumeration * ths); +ASPELL_ALL_DLL_API struct AspellStringEnumeration * aspell_string_enumeration_clone(const struct AspellStringEnumeration * ths); -void aspell_string_enumeration_assign(struct AspellStringEnumeration * ths, const struct AspellStringEnumeration * other); +ASPELL_ALL_DLL_API void aspell_string_enumeration_assign(struct AspellStringEnumeration * ths, const struct AspellStringEnumeration * other); -int aspell_string_enumeration_at_end(const struct AspellStringEnumeration * ths); +ASPELL_ALL_DLL_API int aspell_string_enumeration_at_end(const struct AspellStringEnumeration * ths); -const char * aspell_string_enumeration_next(struct AspellStringEnumeration * ths); +ASPELL_ALL_DLL_API const char * aspell_string_enumeration_next(struct AspellStringEnumeration * ths); @@ -472,56 +479,56 @@ typedef struct AspellModuleInfoList AspellModuleInfoList; -struct AspellModuleInfoList * get_aspell_module_info_list(struct AspellConfig * config); +ASPELL_ALL_DLL_API struct AspellModuleInfoList * get_aspell_module_info_list(struct AspellConfig * config); -int aspell_module_info_list_empty(const struct AspellModuleInfoList * ths); +ASPELL_ALL_DLL_API int aspell_module_info_list_empty(const struct AspellModuleInfoList * ths); -unsigned int aspell_module_info_list_size(const struct AspellModuleInfoList * ths); +ASPELL_ALL_DLL_API unsigned int aspell_module_info_list_size(const struct AspellModuleInfoList * ths); -struct AspellModuleInfoEnumeration * aspell_module_info_list_elements(const struct AspellModuleInfoList * ths); +ASPELL_ALL_DLL_API struct AspellModuleInfoEnumeration * aspell_module_info_list_elements(const struct AspellModuleInfoList * ths); typedef struct AspellDictInfoList AspellDictInfoList; -struct AspellDictInfoList * get_aspell_dict_info_list(struct AspellConfig * config); +ASPELL_ALL_DLL_API struct AspellDictInfoList * get_aspell_dict_info_list(struct AspellConfig * config); -int aspell_dict_info_list_empty(const struct AspellDictInfoList * ths); +ASPELL_ALL_DLL_API int aspell_dict_info_list_empty(const struct AspellDictInfoList * ths); -unsigned int aspell_dict_info_list_size(const struct AspellDictInfoList * ths); +ASPELL_ALL_DLL_API unsigned int aspell_dict_info_list_size(const struct AspellDictInfoList * ths); -struct AspellDictInfoEnumeration * aspell_dict_info_list_elements(const struct AspellDictInfoList * ths); +ASPELL_ALL_DLL_API struct AspellDictInfoEnumeration * aspell_dict_info_list_elements(const struct AspellDictInfoList * ths); typedef struct AspellModuleInfoEnumeration AspellModuleInfoEnumeration; -int aspell_module_info_enumeration_at_end(const struct AspellModuleInfoEnumeration * ths); +ASPELL_ALL_DLL_API int aspell_module_info_enumeration_at_end(const struct AspellModuleInfoEnumeration * ths); -const struct AspellModuleInfo * aspell_module_info_enumeration_next(struct AspellModuleInfoEnumeration * ths); +ASPELL_ALL_DLL_API const struct AspellModuleInfo * aspell_module_info_enumeration_next(struct AspellModuleInfoEnumeration * ths); -void delete_aspell_module_info_enumeration(struct AspellModuleInfoEnumeration * ths); +ASPELL_ALL_DLL_API void delete_aspell_module_info_enumeration(struct AspellModuleInfoEnumeration * ths); -struct AspellModuleInfoEnumeration * aspell_module_info_enumeration_clone(const struct AspellModuleInfoEnumeration * ths); +ASPELL_ALL_DLL_API struct AspellModuleInfoEnumeration * aspell_module_info_enumeration_clone(const struct AspellModuleInfoEnumeration * ths); -void aspell_module_info_enumeration_assign(struct AspellModuleInfoEnumeration * ths, const struct AspellModuleInfoEnumeration * other); +ASPELL_ALL_DLL_API void aspell_module_info_enumeration_assign(struct AspellModuleInfoEnumeration * ths, const struct AspellModuleInfoEnumeration * other); typedef struct AspellDictInfoEnumeration AspellDictInfoEnumeration; -int aspell_dict_info_enumeration_at_end(const struct AspellDictInfoEnumeration * ths); +ASPELL_ALL_DLL_API int aspell_dict_info_enumeration_at_end(const struct AspellDictInfoEnumeration * ths); -const struct AspellDictInfo * aspell_dict_info_enumeration_next(struct AspellDictInfoEnumeration * ths); +ASPELL_ALL_DLL_API const struct AspellDictInfo * aspell_dict_info_enumeration_next(struct AspellDictInfoEnumeration * ths); -void delete_aspell_dict_info_enumeration(struct AspellDictInfoEnumeration * ths); +ASPELL_ALL_DLL_API void delete_aspell_dict_info_enumeration(struct AspellDictInfoEnumeration * ths); -struct AspellDictInfoEnumeration * aspell_dict_info_enumeration_clone(const struct AspellDictInfoEnumeration * ths); +ASPELL_ALL_DLL_API struct AspellDictInfoEnumeration * aspell_dict_info_enumeration_clone(const struct AspellDictInfoEnumeration * ths); -void aspell_dict_info_enumeration_assign(struct AspellDictInfoEnumeration * ths, const struct AspellDictInfoEnumeration * other); +ASPELL_ALL_DLL_API void aspell_dict_info_enumeration_assign(struct AspellDictInfoEnumeration * ths, const struct AspellDictInfoEnumeration * other); @@ -531,27 +538,27 @@ typedef struct AspellStringList AspellStringList; -struct AspellStringList * new_aspell_string_list(); +ASPELL_ALL_DLL_API struct AspellStringList * new_aspell_string_list(); -int aspell_string_list_empty(const struct AspellStringList * ths); +ASPELL_ALL_DLL_API int aspell_string_list_empty(const struct AspellStringList * ths); -unsigned int aspell_string_list_size(const struct AspellStringList * ths); +ASPELL_ALL_DLL_API unsigned int aspell_string_list_size(const struct AspellStringList * ths); -struct AspellStringEnumeration * aspell_string_list_elements(const struct AspellStringList * ths); +ASPELL_ALL_DLL_API struct AspellStringEnumeration * aspell_string_list_elements(const struct AspellStringList * ths); -int aspell_string_list_add(struct AspellStringList * ths, const char * to_add); +ASPELL_ALL_DLL_API int aspell_string_list_add(struct AspellStringList * ths, const char * to_add); -int aspell_string_list_remove(struct AspellStringList * ths, const char * to_rem); +ASPELL_ALL_DLL_API int aspell_string_list_remove(struct AspellStringList * ths, const char * to_rem); -void aspell_string_list_clear(struct AspellStringList * ths); +ASPELL_ALL_DLL_API void aspell_string_list_clear(struct AspellStringList * ths); -struct AspellMutableContainer * aspell_string_list_to_mutable_container(struct AspellStringList * ths); +ASPELL_ALL_DLL_API struct AspellMutableContainer * aspell_string_list_to_mutable_container(struct AspellStringList * ths); -void delete_aspell_string_list(struct AspellStringList * ths); +ASPELL_ALL_DLL_API void delete_aspell_string_list(struct AspellStringList * ths); -struct AspellStringList * aspell_string_list_clone(const struct AspellStringList * ths); +ASPELL_ALL_DLL_API struct AspellStringList * aspell_string_list_clone(const struct AspellStringList * ths); -void aspell_string_list_assign(struct AspellStringList * ths, const struct AspellStringList * other); +ASPELL_ALL_DLL_API void aspell_string_list_assign(struct AspellStringList * ths, const struct AspellStringList * other); @@ -561,43 +568,43 @@ typedef struct AspellStringMap AspellStringMap; -struct AspellStringMap * new_aspell_string_map(); +ASPELL_ALL_DLL_API struct AspellStringMap * new_aspell_string_map(); -int aspell_string_map_add(struct AspellStringMap * ths, const char * to_add); +ASPELL_ALL_DLL_API int aspell_string_map_add(struct AspellStringMap * ths, const char * to_add); -int aspell_string_map_remove(struct AspellStringMap * ths, const char * to_rem); +ASPELL_ALL_DLL_API int aspell_string_map_remove(struct AspellStringMap * ths, const char * to_rem); -void aspell_string_map_clear(struct AspellStringMap * ths); +ASPELL_ALL_DLL_API void aspell_string_map_clear(struct AspellStringMap * ths); -struct AspellMutableContainer * aspell_string_map_to_mutable_container(struct AspellStringMap * ths); +ASPELL_ALL_DLL_API struct AspellMutableContainer * aspell_string_map_to_mutable_container(struct AspellStringMap * ths); -void delete_aspell_string_map(struct AspellStringMap * ths); +ASPELL_ALL_DLL_API void delete_aspell_string_map(struct AspellStringMap * ths); -struct AspellStringMap * aspell_string_map_clone(const struct AspellStringMap * ths); +ASPELL_ALL_DLL_API struct AspellStringMap * aspell_string_map_clone(const struct AspellStringMap * ths); -void aspell_string_map_assign(struct AspellStringMap * ths, const struct AspellStringMap * other); +ASPELL_ALL_DLL_API void aspell_string_map_assign(struct AspellStringMap * ths, const struct AspellStringMap * other); -int aspell_string_map_empty(const struct AspellStringMap * ths); +ASPELL_ALL_DLL_API int aspell_string_map_empty(const struct AspellStringMap * ths); -unsigned int aspell_string_map_size(const struct AspellStringMap * ths); +ASPELL_ALL_DLL_API unsigned int aspell_string_map_size(const struct AspellStringMap * ths); -struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths); +ASPELL_ALL_DLL_API struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths); /* Insert a new element. * Will NOT overright an existing entry. * Returns false if the element already exists. */ -int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value); +ASPELL_ALL_DLL_API int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value); /* Insert a new element. * Will overright an existing entry. * Always returns true. */ -int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value); +ASPELL_ALL_DLL_API int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value); /* Looks up an element. * Returns null if the element did not exist. * Returns an empty string if the element exists but has a null value. * Otherwises returns the value */ -const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key); +ASPELL_ALL_DLL_API const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key); @@ -622,19 +629,20 @@ typedef struct AspellStringPairEnumeration AspellStringPairEnumeration; -int aspell_string_pair_enumeration_at_end(const struct AspellStringPairEnumeration * ths); +ASPELL_ALL_DLL_API int aspell_string_pair_enumeration_at_end(const struct AspellStringPairEnumeration * ths); -struct AspellStringPair aspell_string_pair_enumeration_next(struct AspellStringPairEnumeration * ths); +ASPELL_ALL_DLL_API struct AspellStringPair aspell_string_pair_enumeration_next(struct AspellStringPairEnumeration * ths); -void delete_aspell_string_pair_enumeration(struct AspellStringPairEnumeration * ths); +ASPELL_ALL_DLL_API void delete_aspell_string_pair_enumeration(struct AspellStringPairEnumeration * ths); -struct AspellStringPairEnumeration * aspell_string_pair_enumeration_clone(const struct AspellStringPairEnumeration * ths); +ASPELL_ALL_DLL_API struct AspellStringPairEnumeration * aspell_string_pair_enumeration_clone(const struct AspellStringPairEnumeration * ths); -void aspell_string_pair_enumeration_assign(struct AspellStringPairEnumeration * ths, const struct AspellStringPairEnumeration * other); +ASPELL_ALL_DLL_API void aspell_string_pair_enumeration_assign(struct AspellStringPairEnumeration * ths, const struct AspellStringPairEnumeration * other); -#ifdef __cplusplus -} -#endif +//#ifdef __cplusplus +//} +//#endif + #endif /* ASPELL_ASPELL__H */ diff -rubw aspell-0.50.2/lib/can_have_error-c.cpp aspell-win32/lib/can_have_error-c.cpp --- aspell-0.50.2/lib/can_have_error-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/can_have_error-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,27 +9,35 @@ #include "can_have_error.hpp" #include "error.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class CanHaveError; struct Error; -extern "C" unsigned int aspell_error_number(const CanHaveError * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_error_number(const CanHaveError * ths) { return ths->err_ == 0 ? 0 : 1; } -extern "C" const char * aspell_error_message(const CanHaveError * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_error_message(const CanHaveError * ths) { return ths->err_ ? ths->err_->mesg : ""; } -extern "C" const Error * aspell_error(const CanHaveError * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const Error * aspell_error(const CanHaveError * ths) { return ths->err_; } -extern "C" void delete_aspell_can_have_error(CanHaveError * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_can_have_error(CanHaveError * ths) { delete ths; } diff -rubw aspell-0.50.2/lib/config-c.cpp aspell-win32/lib/config-c.cpp --- aspell-0.50.2/lib/config-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/config-c.cpp Wed Oct 2 04:49:03 2002 @@ -11,6 +11,13 @@ #include "posib_err.hpp" #include "string.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + namespace acommon { class Config; @@ -20,72 +27,72 @@ class MutableContainer; class StringPairEnumeration; -extern "C" int aspell_key_info_enumeration_at_end(const KeyInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_key_info_enumeration_at_end(const KeyInfoEnumeration * ths) { return ths->at_end(); } -extern "C" const KeyInfo * aspell_key_info_enumeration_next(KeyInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const KeyInfo * aspell_key_info_enumeration_next(KeyInfoEnumeration * ths) { return ths->next(); } -extern "C" void delete_aspell_key_info_enumeration(KeyInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_key_info_enumeration(KeyInfoEnumeration * ths) { delete ths; } -extern "C" KeyInfoEnumeration * aspell_key_info_enumeration_clone(const KeyInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ KeyInfoEnumeration * aspell_key_info_enumeration_clone(const KeyInfoEnumeration * ths) { return ths->clone(); } -extern "C" void aspell_key_info_enumeration_assign(KeyInfoEnumeration * ths, const KeyInfoEnumeration * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_key_info_enumeration_assign(KeyInfoEnumeration * ths, const KeyInfoEnumeration * other) { ths->assign(other); } -extern "C" Config * new_aspell_config() +ASPELL_ALL_DLL_API /*extern "C"*/ Config * new_aspell_config() { return new_config(); } -extern "C" void delete_aspell_config(Config * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_config(Config * ths) { delete ths; } -extern "C" Config * aspell_config_clone(const Config * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ Config * aspell_config_clone(const Config * ths) { return ths->clone(); } -extern "C" void aspell_config_assign(Config * ths, const Config * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_config_assign(Config * ths, const Config * other) { ths->assign(other); } -extern "C" unsigned int aspell_config_error_number(const Config * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_config_error_number(const Config * ths) { return ths->err_ == 0 ? 0 : 1; } -extern "C" const char * aspell_config_error_message(const Config * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_config_error_message(const Config * ths) { return ths->err_ ? ths->err_->mesg : ""; } -extern "C" const Error * aspell_config_error(const Config * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const Error * aspell_config_error(const Config * ths) { return ths->err_; } -extern "C" void aspell_config_set_extra(Config * ths, const KeyInfo * begin, const KeyInfo * end) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_config_set_extra(Config * ths, const KeyInfo * begin, const KeyInfo * end) { ths->set_extra(begin, end); } -extern "C" const KeyInfo * aspell_config_keyinfo(Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ const KeyInfo * aspell_config_keyinfo(Config * ths, const char * key) { PosibErr ret = ths->keyinfo(key); ths->err_.reset(ret.release_err()); @@ -93,12 +100,12 @@ return ret.data; } -extern "C" KeyInfoEnumeration * aspell_config_possible_elements(Config * ths, int include_extra) +ASPELL_ALL_DLL_API /*extern "C"*/ KeyInfoEnumeration * aspell_config_possible_elements(Config * ths, int include_extra) { - return ths->possible_elements(include_extra); + return ths->possible_elements(include_extra != 0);//FB } -extern "C" const char * aspell_config_get_default(Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_config_get_default(Config * ths, const char * key) { PosibErr ret = ths->get_default(key); ths->err_.reset(ret.release_err()); @@ -107,12 +114,12 @@ return ths->temp_str.c_str(); } -extern "C" StringPairEnumeration * aspell_config_elements(Config * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringPairEnumeration * aspell_config_elements(Config * ths) { return ths->elements(); } -extern "C" int aspell_config_replace(Config * ths, const char * key, const char * value) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_config_replace(Config * ths, const char * key, const char * value) { PosibErr ret = ths->replace(key, value); ths->err_.reset(ret.release_err()); @@ -120,7 +127,7 @@ return 1; } -extern "C" int aspell_config_remove(Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_config_remove(Config * ths, const char * key) { PosibErr ret = ths->remove(key); ths->err_.reset(ret.release_err()); @@ -128,12 +135,12 @@ return 1; } -extern "C" int aspell_config_have(const Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_config_have(const Config * ths, const char * key) { return ths->have(key); } -extern "C" const char * aspell_config_retrieve(Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_config_retrieve(Config * ths, const char * key) { PosibErr ret = ths->retrieve(key); ths->err_.reset(ret.release_err()); @@ -142,7 +149,7 @@ return ths->temp_str.c_str(); } -extern "C" int aspell_config_retrieve_list(Config * ths, const char * key, MutableContainer * lst) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_config_retrieve_list(Config * ths, const char * key, MutableContainer * lst) { PosibErr ret = ths->retrieve_list(key, lst); ths->err_.reset(ret.release_err()); @@ -150,7 +157,7 @@ return 1; } -extern "C" int aspell_config_retrieve_bool(Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_config_retrieve_bool(Config * ths, const char * key) { PosibErr ret = ths->retrieve_bool(key); ths->err_.reset(ret.release_err()); @@ -158,7 +165,7 @@ return ret.data; } -extern "C" int aspell_config_retrieve_int(Config * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_config_retrieve_int(Config * ths, const char * key) { PosibErr ret = ths->retrieve_int(key); ths->err_.reset(ret.release_err()); diff -rubw aspell-0.50.2/lib/document_checker-c.cpp aspell-win32/lib/document_checker-c.cpp --- aspell-0.50.2/lib/document_checker-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/document_checker-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,6 +9,14 @@ #include "document_checker.hpp" #include "error.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class CanHaveError; @@ -17,27 +25,27 @@ class Filter; class Speller; -extern "C" void delete_aspell_document_checker(DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_document_checker(DocumentChecker * ths) { delete ths; } -extern "C" unsigned int aspell_document_checker_error_number(const DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_document_checker_error_number(const DocumentChecker * ths) { return ths->err_ == 0 ? 0 : 1; } -extern "C" const char * aspell_document_checker_error_message(const DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_document_checker_error_message(const DocumentChecker * ths) { return ths->err_ ? ths->err_->mesg : ""; } -extern "C" const Error * aspell_document_checker_error(const DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const Error * aspell_document_checker_error(const DocumentChecker * ths) { return ths->err_; } -extern "C" CanHaveError * new_aspell_document_checker(Speller * speller) +ASPELL_ALL_DLL_API /*extern "C"*/ CanHaveError * new_aspell_document_checker(Speller * speller) { PosibErr ret = new_document_checker(speller); if (ret.has_err()) { @@ -47,27 +55,27 @@ } } -extern "C" DocumentChecker * to_aspell_document_checker(CanHaveError * obj) +ASPELL_ALL_DLL_API /*extern "C"*/ DocumentChecker * to_aspell_document_checker(CanHaveError * obj) { return static_cast(obj); } -extern "C" void aspell_document_checker_reset(DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_document_checker_reset(DocumentChecker * ths) { ths->reset(); } -extern "C" void aspell_document_checker_process(DocumentChecker * ths, const char * str, int size) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_document_checker_process(DocumentChecker * ths, const char * str, int size) { ths->process(str, size); } -extern "C" Token aspell_document_checker_next_misspelling(DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ Token aspell_document_checker_next_misspelling(DocumentChecker * ths) { return ths->next_misspelling(); } -extern "C" Filter * aspell_document_checker_filter(DocumentChecker * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ Filter * aspell_document_checker_filter(DocumentChecker * ths) { return ths->filter(); } diff -rubw aspell-0.50.2/lib/error-c.cpp aspell-win32/lib/error-c.cpp --- aspell-0.50.2/lib/error-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/error-c.cpp Wed Oct 2 04:49:03 2002 @@ -8,6 +8,12 @@ #include "error.hpp" +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + namespace acommon { struct Error; diff -rubw aspell-0.50.2/lib/filter-c.cpp aspell-win32/lib/filter-c.cpp --- aspell-0.50.2/lib/filter-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/filter-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,33 +9,39 @@ #include "error.hpp" #include "filter.hpp" +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + namespace acommon { class CanHaveError; struct Error; class Filter; -extern "C" void delete_aspell_filter(Filter * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_filter(Filter * ths) { delete ths; } -extern "C" unsigned int aspell_filter_error_number(const Filter * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_filter_error_number(const Filter * ths) { return ths->err_ == 0 ? 0 : 1; } -extern "C" const char * aspell_filter_error_message(const Filter * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_filter_error_message(const Filter * ths) { return ths->err_ ? ths->err_->mesg : ""; } -extern "C" const Error * aspell_filter_error(const Filter * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const Error * aspell_filter_error(const Filter * ths) { return ths->err_; } -extern "C" Filter * to_aspell_filter(CanHaveError * obj) +ASPELL_ALL_DLL_API /*extern "C"*/ Filter * to_aspell_filter(CanHaveError * obj) { return static_cast(obj); } diff -rubw aspell-0.50.2/lib/find_speller.cpp aspell-win32/lib/find_speller.cpp --- aspell-0.50.2/lib/find_speller.cpp Sun Aug 18 07:52:02 2002 +++ aspell-win32/lib/find_speller.cpp Wed Oct 2 04:49:03 2002 @@ -9,7 +9,7 @@ // POSIX includes #include -#include +//#include //FB #include "asc_ctype.hpp" #include "can_have_error.hpp" diff -rubw aspell-0.50.2/lib/info-c.cpp aspell-win32/lib/info-c.cpp --- aspell-0.50.2/lib/info-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/info-c.cpp Wed Oct 2 04:49:03 2002 @@ -8,6 +8,12 @@ #include "info.hpp" +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + namespace acommon { class Config; @@ -18,92 +24,92 @@ class ModuleInfoEnumeration; class ModuleInfoList; -extern "C" ModuleInfoList * get_aspell_module_info_list(Config * config) +ASPELL_ALL_DLL_API /*extern "C"*/ ModuleInfoList * get_aspell_module_info_list(Config * config) { return get_module_info_list(config); } -extern "C" int aspell_module_info_list_empty(const ModuleInfoList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_module_info_list_empty(const ModuleInfoList * ths) { return ths->empty(); } -extern "C" unsigned int aspell_module_info_list_size(const ModuleInfoList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_module_info_list_size(const ModuleInfoList * ths) { return ths->size(); } -extern "C" ModuleInfoEnumeration * aspell_module_info_list_elements(const ModuleInfoList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ ModuleInfoEnumeration * aspell_module_info_list_elements(const ModuleInfoList * ths) { return ths->elements(); } -extern "C" DictInfoList * get_aspell_dict_info_list(Config * config) +ASPELL_ALL_DLL_API /*extern "C"*/ DictInfoList * get_aspell_dict_info_list(Config * config) { return get_dict_info_list(config); } -extern "C" int aspell_dict_info_list_empty(const DictInfoList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_dict_info_list_empty(const DictInfoList * ths) { return ths->empty(); } -extern "C" unsigned int aspell_dict_info_list_size(const DictInfoList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_dict_info_list_size(const DictInfoList * ths) { return ths->size(); } -extern "C" DictInfoEnumeration * aspell_dict_info_list_elements(const DictInfoList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ DictInfoEnumeration * aspell_dict_info_list_elements(const DictInfoList * ths) { return ths->elements(); } -extern "C" int aspell_module_info_enumeration_at_end(const ModuleInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_module_info_enumeration_at_end(const ModuleInfoEnumeration * ths) { return ths->at_end(); } -extern "C" const ModuleInfo * aspell_module_info_enumeration_next(ModuleInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const ModuleInfo * aspell_module_info_enumeration_next(ModuleInfoEnumeration * ths) { return ths->next(); } -extern "C" void delete_aspell_module_info_enumeration(ModuleInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_module_info_enumeration(ModuleInfoEnumeration * ths) { delete ths; } -extern "C" ModuleInfoEnumeration * aspell_module_info_enumeration_clone(const ModuleInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ ModuleInfoEnumeration * aspell_module_info_enumeration_clone(const ModuleInfoEnumeration * ths) { return ths->clone(); } -extern "C" void aspell_module_info_enumeration_assign(ModuleInfoEnumeration * ths, const ModuleInfoEnumeration * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_module_info_enumeration_assign(ModuleInfoEnumeration * ths, const ModuleInfoEnumeration * other) { ths->assign(other); } -extern "C" int aspell_dict_info_enumeration_at_end(const DictInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_dict_info_enumeration_at_end(const DictInfoEnumeration * ths) { return ths->at_end(); } -extern "C" const DictInfo * aspell_dict_info_enumeration_next(DictInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const DictInfo * aspell_dict_info_enumeration_next(DictInfoEnumeration * ths) { return ths->next(); } -extern "C" void delete_aspell_dict_info_enumeration(DictInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_dict_info_enumeration(DictInfoEnumeration * ths) { delete ths; } -extern "C" DictInfoEnumeration * aspell_dict_info_enumeration_clone(const DictInfoEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ DictInfoEnumeration * aspell_dict_info_enumeration_clone(const DictInfoEnumeration * ths) { return ths->clone(); } -extern "C" void aspell_dict_info_enumeration_assign(DictInfoEnumeration * ths, const DictInfoEnumeration * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_dict_info_enumeration_assign(DictInfoEnumeration * ths, const DictInfoEnumeration * other) { ths->assign(other); } diff -rubw aspell-0.50.2/lib/mutable_container-c.cpp aspell-win32/lib/mutable_container-c.cpp --- aspell-0.50.2/lib/mutable_container-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/mutable_container-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,26 +9,34 @@ #include "mutable_container.hpp" #include "posib_err.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class MutableContainer; -extern "C" int aspell_mutable_container_add(MutableContainer * ths, const char * to_add) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_mutable_container_add(MutableContainer * ths, const char * to_add) { return ths->add(to_add); } -extern "C" int aspell_mutable_container_remove(MutableContainer * ths, const char * to_rem) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_mutable_container_remove(MutableContainer * ths, const char * to_rem) { return ths->remove(to_rem); } -extern "C" void aspell_mutable_container_clear(MutableContainer * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_mutable_container_clear(MutableContainer * ths) { ths->clear(); } -extern "C" MutableContainer * aspell_mutable_container_to_mutable_container(MutableContainer * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ MutableContainer * aspell_mutable_container_to_mutable_container(MutableContainer * ths) { return ths; } diff -rubw aspell-0.50.2/lib/new_config.cpp aspell-win32/lib/new_config.cpp --- aspell-0.50.2/lib/new_config.cpp Fri Jul 26 21:27:10 2002 +++ aspell-win32/lib/new_config.cpp Wed Oct 2 04:49:03 2002 @@ -38,7 +38,7 @@ Config * config; ModeNotifierImpl(Config * c) : config(c) {} - ModeNotifierImpl * clone(Config * c) const {return new ModeNotifierImpl(c);} + /*Mode*/Notifier/*Impl*/ * clone(Config * c) const {return new ModeNotifierImpl(c);} //FB PosibErr item_updated(const KeyInfo * ki, ParmString value) { if (strcmp(ki->name, "mode") == 0) { diff -rubw aspell-0.50.2/lib/speller-c.cpp aspell-win32/lib/speller-c.cpp --- aspell-0.50.2/lib/speller-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/speller-c.cpp Wed Oct 2 04:49:03 2002 @@ -12,6 +12,15 @@ #include "posib_err.hpp" #include "speller.hpp" #include "word_list.hpp" +#include "copy_ptr-t.hpp" //FB + + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + namespace acommon { @@ -21,7 +30,7 @@ class Speller; class WordList; -extern "C" CanHaveError * new_aspell_speller(Config * config) +ASPELL_ALL_DLL_API /*extern "C"*/ CanHaveError * new_aspell_speller(Config * config) { PosibErr ret = new_speller(config); if (ret.has_err()) { @@ -31,37 +40,37 @@ } } -extern "C" Speller * to_aspell_speller(CanHaveError * obj) +ASPELL_ALL_DLL_API /*extern "C"*/ Speller * to_aspell_speller(CanHaveError * obj) { return static_cast(obj); } -extern "C" void delete_aspell_speller(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_speller(Speller * ths) { delete ths; } -extern "C" unsigned int aspell_speller_error_number(const Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_speller_error_number(const Speller * ths) { return ths->err_ == 0 ? 0 : 1; } -extern "C" const char * aspell_speller_error_message(const Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_speller_error_message(const Speller * ths) { return ths->err_ ? ths->err_->mesg : ""; } -extern "C" const Error * aspell_speller_error(const Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const Error * aspell_speller_error(const Speller * ths) { return ths->err_; } -extern "C" Config * aspell_speller_config(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ Config * aspell_speller_config(Speller * ths) { return ths->config(); } -extern "C" int aspell_speller_check(Speller * ths, const char * word, int word_size) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_speller_check(Speller * ths, const char * word, int word_size) { ths->temp_str_0.clear(); ths->to_internal_->convert(word, word_size, ths->temp_str_0); @@ -74,7 +83,7 @@ return ret.data; } -extern "C" int aspell_speller_add_to_personal(Speller * ths, const char * word, int word_size) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_speller_add_to_personal(Speller * ths, const char * word, int word_size) { ths->temp_str_0.clear(); ths->to_internal_->convert(word, word_size, ths->temp_str_0); @@ -87,7 +96,7 @@ return 1; } -extern "C" int aspell_speller_add_to_session(Speller * ths, const char * word, int word_size) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_speller_add_to_session(Speller * ths, const char * word, int word_size) { ths->temp_str_0.clear(); ths->to_internal_->convert(word, word_size, ths->temp_str_0); @@ -100,7 +109,7 @@ return 1; } -extern "C" const WordList * aspell_speller_personal_word_list(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const WordList * aspell_speller_personal_word_list(Speller * ths) { PosibErr ret = ths->personal_word_list(); ths->err_.reset(ret.release_err()); @@ -109,7 +118,7 @@ return ret.data; } -extern "C" const WordList * aspell_speller_session_word_list(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const WordList * aspell_speller_session_word_list(Speller * ths) { PosibErr ret = ths->session_word_list(); ths->err_.reset(ret.release_err()); @@ -118,7 +127,7 @@ return ret.data; } -extern "C" const WordList * aspell_speller_main_word_list(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const WordList * aspell_speller_main_word_list(Speller * ths) { PosibErr ret = ths->main_word_list(); ths->err_.reset(ret.release_err()); @@ -127,7 +136,7 @@ return ret.data; } -extern "C" int aspell_speller_save_all_word_lists(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_speller_save_all_word_lists(Speller * ths) { PosibErr ret = ths->save_all_word_lists(); ths->err_.reset(ret.release_err()); @@ -135,7 +144,7 @@ return 1; } -extern "C" int aspell_speller_clear_session(Speller * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_speller_clear_session(Speller * ths) { PosibErr ret = ths->clear_session(); ths->err_.reset(ret.release_err()); @@ -143,7 +152,7 @@ return 1; } -extern "C" const WordList * aspell_speller_suggest(Speller * ths, const char * word, int word_size) +ASPELL_ALL_DLL_API /*extern "C"*/ const WordList * aspell_speller_suggest(Speller * ths, const char * word, int word_size) { ths->temp_str_0.clear(); ths->to_internal_->convert(word, word_size, ths->temp_str_0); @@ -157,7 +166,7 @@ return ret.data; } -extern "C" int aspell_speller_store_replacement(Speller * ths, const char * mis, int mis_size, const char * cor, int cor_size) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_speller_store_replacement(Speller * ths, const char * mis, int mis_size, const char * cor, int cor_size) { ths->temp_str_0.clear(); ths->to_internal_->convert(mis, mis_size, ths->temp_str_0); diff -rubw aspell-0.50.2/lib/string_enumeration-c.cpp aspell-win32/lib/string_enumeration-c.cpp --- aspell-0.50.2/lib/string_enumeration-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/string_enumeration-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,31 +9,39 @@ #include "convert.hpp" #include "string_enumeration.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class StringEnumeration; -extern "C" void delete_aspell_string_enumeration(StringEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_string_enumeration(StringEnumeration * ths) { delete ths; } -extern "C" StringEnumeration * aspell_string_enumeration_clone(const StringEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringEnumeration * aspell_string_enumeration_clone(const StringEnumeration * ths) { return ths->clone(); } -extern "C" void aspell_string_enumeration_assign(StringEnumeration * ths, const StringEnumeration * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_string_enumeration_assign(StringEnumeration * ths, const StringEnumeration * other) { ths->assign(other); } -extern "C" int aspell_string_enumeration_at_end(const StringEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_enumeration_at_end(const StringEnumeration * ths) { return ths->at_end(); } -extern "C" const char * aspell_string_enumeration_next(StringEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_string_enumeration_next(StringEnumeration * ths) { const char * s = ths->next(); if (s == 0 || ths->from_internal_ == 0) { diff -rubw aspell-0.50.2/lib/string_list-c.cpp aspell-win32/lib/string_list-c.cpp --- aspell-0.50.2/lib/string_list-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/string_list-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,63 +9,71 @@ #include "posib_err.hpp" #include "string_list.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class MutableContainer; class StringEnumeration; class StringList; -extern "C" StringList * new_aspell_string_list() +ASPELL_ALL_DLL_API /*extern "C"*/ StringList * new_aspell_string_list() { return new_string_list(); } -extern "C" int aspell_string_list_empty(const StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_list_empty(const StringList * ths) { return ths->empty(); } -extern "C" unsigned int aspell_string_list_size(const StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_string_list_size(const StringList * ths) { return ths->size(); } -extern "C" StringEnumeration * aspell_string_list_elements(const StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringEnumeration * aspell_string_list_elements(const StringList * ths) { return ths->elements(); } -extern "C" int aspell_string_list_add(StringList * ths, const char * to_add) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_list_add(StringList * ths, const char * to_add) { return ths->add(to_add); } -extern "C" int aspell_string_list_remove(StringList * ths, const char * to_rem) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_list_remove(StringList * ths, const char * to_rem) { return ths->remove(to_rem); } -extern "C" void aspell_string_list_clear(StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_string_list_clear(StringList * ths) { ths->clear(); } -extern "C" MutableContainer * aspell_string_list_to_mutable_container(StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ MutableContainer * aspell_string_list_to_mutable_container(StringList * ths) { return ths; } -extern "C" void delete_aspell_string_list(StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_string_list(StringList * ths) { delete ths; } -extern "C" StringList * aspell_string_list_clone(const StringList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringList * aspell_string_list_clone(const StringList * ths) { return ths->clone(); } -extern "C" void aspell_string_list_assign(StringList * ths, const StringList * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_string_list_assign(StringList * ths, const StringList * other) { ths->assign(other); } diff -rubw aspell-0.50.2/lib/string_map-c.cpp aspell-win32/lib/string_map-c.cpp --- aspell-0.50.2/lib/string_map-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/string_map-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,78 +9,85 @@ #include "posib_err.hpp" #include "string_map.hpp" +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class MutableContainer; class StringMap; class StringPairEnumeration; -extern "C" StringMap * new_aspell_string_map() +ASPELL_ALL_DLL_API /*extern "C"*/ StringMap * new_aspell_string_map() { return new_string_map(); } -extern "C" int aspell_string_map_add(StringMap * ths, const char * to_add) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_map_add(StringMap * ths, const char * to_add) { return ths->add(to_add); } -extern "C" int aspell_string_map_remove(StringMap * ths, const char * to_rem) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_map_remove(StringMap * ths, const char * to_rem) { return ths->remove(to_rem); } -extern "C" void aspell_string_map_clear(StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_string_map_clear(StringMap * ths) { ths->clear(); } -extern "C" MutableContainer * aspell_string_map_to_mutable_container(StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ MutableContainer * aspell_string_map_to_mutable_container(StringMap * ths) { return ths; } -extern "C" void delete_aspell_string_map(StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_string_map(StringMap * ths) { delete ths; } -extern "C" StringMap * aspell_string_map_clone(const StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringMap * aspell_string_map_clone(const StringMap * ths) { return ths->clone(); } -extern "C" void aspell_string_map_assign(StringMap * ths, const StringMap * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_string_map_assign(StringMap * ths, const StringMap * other) { ths->assign(other); } -extern "C" int aspell_string_map_empty(const StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_map_empty(const StringMap * ths) { return ths->empty(); } -extern "C" unsigned int aspell_string_map_size(const StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_string_map_size(const StringMap * ths) { return ths->size(); } -extern "C" StringPairEnumeration * aspell_string_map_elements(const StringMap * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringPairEnumeration * aspell_string_map_elements(const StringMap * ths) { return ths->elements(); } -extern "C" int aspell_string_map_insert(StringMap * ths, const char * key, const char * value) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_map_insert(StringMap * ths, const char * key, const char * value) { return ths->insert(key, value); } -extern "C" int aspell_string_map_replace(StringMap * ths, const char * key, const char * value) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_map_replace(StringMap * ths, const char * key, const char * value) { return ths->replace(key, value); } -extern "C" const char * aspell_string_map_lookup(const StringMap * ths, const char * key) +ASPELL_ALL_DLL_API /*extern "C"*/ const char * aspell_string_map_lookup(const StringMap * ths, const char * key) { return ths->lookup(key); } diff -rubw aspell-0.50.2/lib/string_pair_enumeration-c.cpp aspell-win32/lib/string_pair_enumeration-c.cpp --- aspell-0.50.2/lib/string_pair_enumeration-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/string_pair_enumeration-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,31 +9,39 @@ #include "string_pair.hpp" #include "string_pair_enumeration.hpp" + +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + + namespace acommon { class StringPairEnumeration; -extern "C" int aspell_string_pair_enumeration_at_end(const StringPairEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_string_pair_enumeration_at_end(const StringPairEnumeration * ths) { return ths->at_end(); } -extern "C" StringPair aspell_string_pair_enumeration_next(StringPairEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringPair aspell_string_pair_enumeration_next(StringPairEnumeration * ths) { return ths->next(); } -extern "C" void delete_aspell_string_pair_enumeration(StringPairEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ void delete_aspell_string_pair_enumeration(StringPairEnumeration * ths) { delete ths; } -extern "C" StringPairEnumeration * aspell_string_pair_enumeration_clone(const StringPairEnumeration * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringPairEnumeration * aspell_string_pair_enumeration_clone(const StringPairEnumeration * ths) { return ths->clone(); } -extern "C" void aspell_string_pair_enumeration_assign(StringPairEnumeration * ths, const StringPairEnumeration * other) +ASPELL_ALL_DLL_API /*extern "C"*/ void aspell_string_pair_enumeration_assign(StringPairEnumeration * ths, const StringPairEnumeration * other) { ths->assign(other); } diff -rubw aspell-0.50.2/lib/word_list-c.cpp aspell-win32/lib/word_list-c.cpp --- aspell-0.50.2/lib/word_list-c.cpp Fri Aug 30 14:20:35 2002 +++ aspell-win32/lib/word_list-c.cpp Wed Oct 2 04:49:03 2002 @@ -9,22 +9,28 @@ #include "string_enumeration.hpp" #include "word_list.hpp" +#ifdef ASPELL_ALL_DLL_EXPORTS +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllexport) +#else +#define ASPELL_ALL_DLL_API extern "C" __declspec(dllimport) +#endif + namespace acommon { class StringEnumeration; class WordList; -extern "C" int aspell_word_list_empty(const WordList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ int aspell_word_list_empty(const WordList * ths) { return ths->empty(); } -extern "C" unsigned int aspell_word_list_size(const WordList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ unsigned int aspell_word_list_size(const WordList * ths) { return ths->size(); } -extern "C" StringEnumeration * aspell_word_list_elements(const WordList * ths) +ASPELL_ALL_DLL_API /*extern "C"*/ StringEnumeration * aspell_word_list_elements(const WordList * ths) { StringEnumeration * els = ths->elements(); els->from_internal_ = ths->from_internal_; diff -rubw aspell-0.50.2/modules/speller/default/block_vector.hpp aspell-win32/modules/speller/default/block_vector.hpp --- aspell-0.50.2/modules/speller/default/block_vector.hpp Thu Nov 29 22:55:47 2001 +++ aspell-win32/modules/speller/default/block_vector.hpp Wed Oct 2 04:49:03 2002 @@ -30,7 +30,10 @@ typedef T & reference; typedef const T & const_reference; typedef T * pointer; + typedef T * _Tptr; //FB typedef T * const_pointer; + typedef T * _Ctptr; //FB; + typedef std::random_access_iterator_tag iterator_category; typedef ptrdiff_t distance_type; diff -rubw aspell-0.50.2/modules/speller/default/data.cpp aspell-win32/modules/speller/default/data.cpp --- aspell-0.50.2/modules/speller/default/data.cpp Thu Aug 15 19:12:51 2002 +++ aspell-win32/modules/speller/default/data.cpp Wed Oct 2 04:49:03 2002 @@ -73,7 +73,7 @@ } bool DataSet::is_attached() const { - return attach_count_; + return attach_count_ == 0; //FB } const char * DataSet::lang_name() const { diff -rubw aspell-0.50.2/modules/speller/default/data.hpp aspell-win32/modules/speller/default/data.hpp --- aspell-0.50.2/modules/speller/default/data.hpp Thu Aug 15 19:12:51 2002 +++ aspell-win32/modules/speller/default/data.hpp Wed Oct 2 04:49:03 2002 @@ -26,7 +26,7 @@ class SpellerImpl; class Language; - class SensitiveCompare; + struct SensitiveCompare; class DataSet { friend class SpellerImpl; @@ -46,9 +46,9 @@ void clear(); void set(ParmString); - FileName() {clear();} - explicit FileName(ParmString str) {set(str);} - FileName(const FileName & other) {copy(other);} + FileName() : name("") {clear();} + explicit FileName(ParmString str) : name("") {set(str);} + FileName(const FileName & other) : name("") {copy(other);} FileName & operator=(const FileName & other) {copy(other); return *this;} }; class Id; @@ -113,19 +113,19 @@ d |= c; } - bool mid_required () const {return d & 1<<2; } + bool mid_required () const {return (d & 1<<2) != 0; } //FB void mid_required (bool c) { d |= c<<2;} - bool beg () const {return d & 1<<3;} + bool beg () const {return (d & 1<<3) != 0;} //FB void beg (bool c) {d |= c<<3;} - bool mid () const {return d & 1<<4;} + bool mid () const {return (d & 1<<4) != 0;} //FB void mid (bool c) {d |= c<<4;} - bool end () const {return d & 1<<5;} + bool end () const {return (d & 1<<5) != 0;} //FB void end (bool c) {d |= c<<5;} - bool any() const {return d & (1<<3|1<<4|1<<5);} + bool any() const {return (d & (1<<3|1<<4|1<<5)) != 0;} //FB const char * read(const char * str, const Language & l); OStream & write(OStream &, const Language & l) const; @@ -143,7 +143,7 @@ const char * soundslike; const void * word_list_pointer; - operator bool () const {return soundslike;} + operator bool () const {return soundslike != 0;} //FB SoundslikeWord() : soundslike(0) {} SoundslikeWord(const char * w, const void * p) diff -rubw aspell-0.50.2/modules/speller/default/language.cpp aspell-win32/modules/speller/default/language.cpp --- aspell-0.50.2/modules/speller/default/language.cpp Wed Jul 24 03:02:51 2002 +++ aspell-win32/modules/speller/default/language.cpp Wed Oct 2 04:49:03 2002 @@ -107,6 +107,7 @@ String temp; char_data.getline(temp); char_data.getline(temp); + /* FB for (int i = 0; i != 256; ++i) { char_data >> to_uni_[i]; char_data >> temp; @@ -123,28 +124,45 @@ if (char_data.peek() != '\n') return make_err(bad_file_format, char_data_name); } + */ + for (int j = 0; j != 256; ++j) { //FB + char_data >> to_uni_[j]; //FB + char_data >> temp; + char_type_[j] = temp == "letter" ? letter //FB + : temp == "space" ? space + : other; + int num = -1; + char_data >> num; to_lower_[j] = static_cast(num); //FB + char_data >> num; to_upper_[j] = static_cast(num); //FB + char_data >> num; to_title_[j] = static_cast(num); //FB + char_data >> num; to_sl_[j] = static_cast(num); //FB + char_data >> num; to_stripped_[j] = static_cast(num); //FB + char_data >> num; de_accent_[j] = static_cast(num); //FB + if (char_data.peek() != '\n') + return make_err(bad_file_format, char_data_name); + } // // // - for (int i = 0; i != 256; ++i) - to_normalized_[i] = 0; + for (j = 0; j != 256; ++j) //FB + to_normalized_[j] = 0; //FB int c = 1; - for (int i = 0; i != 256; ++i) { - if (is_alpha(i)) { - if (to_normalized_[to_uchar(to_stripped_[i])] == 0) { - to_normalized_[i] = c; - to_normalized_[to_uchar(to_stripped_[i])] = c; + for (j = 0; j != 256; ++j) {//FB + if (is_alpha(j)) { //FB + if (to_normalized_[to_uchar(to_stripped_[j])] == 0) { //FB + to_normalized_[j] = c; //FB + to_normalized_[to_uchar(to_stripped_[j])] = c; //FB ++c; } else { - to_normalized_[i] = to_normalized_[to_uchar(to_stripped_[i])]; + to_normalized_[j] = to_normalized_[to_uchar(to_stripped_[j])]; //FB } } } - for (int i = 0; i != 256; ++i) { - if (to_normalized_[i]==0) to_normalized_[i] = c; + for (j = 0; j != 256; ++j) { //FB + if (to_normalized_[j]==0) to_normalized_[j] = c; //FB } max_normalized_ = c; diff -rubw aspell-0.50.2/modules/speller/default/multi_ws.cpp aspell-win32/modules/speller/default/multi_ws.cpp --- aspell-0.50.2/modules/speller/default/multi_ws.cpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/multi_ws.cpp Wed Oct 2 04:49:03 2002 @@ -86,7 +86,7 @@ MultiWS::VirEmul * MultiWS::detailed_elements() const { - return new MakeVirEnumeration(wss.begin(), wss.end()); + return new MakeVirEnumeration >(wss.begin(), wss.end());//FB } unsigned int MultiWS::size() const diff -rubw aspell-0.50.2/modules/speller/default/phonet.cpp aspell-win32/modules/speller/default/phonet.cpp --- aspell-0.50.2/modules/speller/default/phonet.cpp Sun Aug 11 08:58:30 2002 +++ aspell-win32/modules/speller/default/phonet.cpp Wed Oct 2 04:49:03 2002 @@ -70,7 +70,7 @@ *this = *(const PhonetParmsImpl *)other; this->rules = &rdata.front(); } - PhonetParmsImpl * clone() const { + PhonetParms/*Impl*/ * clone() const { //FB ??? (worried) PhonetParmsImpl * other = new PhonetParmsImpl(*this); return other; } @@ -191,7 +191,7 @@ int i, k; - for (i = 0; i < parms.hash_size; i++) { + for (i = 0; i < parms.get_hash_size(); i++) { parms.hash[i] = -1; } diff -rubw aspell-0.50.2/modules/speller/default/phonet.hpp aspell-win32/modules/speller/default/phonet.hpp --- aspell-0.50.2/modules/speller/default/phonet.hpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/phonet.hpp Wed Oct 2 04:49:03 2002 @@ -39,13 +39,16 @@ char to_upper[256]; bool is_alpha[256]; - static const int hash_size = 256; - int hash[hash_size]; + //static const int hash_size; //FB = 256; + int get_hash_size(){ return 256;} //FB + int hash[256]; //FB virtual PhonetParms * clone() const = 0; virtual void assign(const PhonetParms *) = 0; virtual ~PhonetParms() {} }; + +// const int hash_size = 256; //FB void init_phonet_charinfo(PhonetParms & parms); void init_phonet_hash(PhonetParms & parms); diff -rubw aspell-0.50.2/modules/speller/default/phonetic.cpp aspell-win32/modules/speller/default/phonetic.cpp --- aspell-0.50.2/modules/speller/default/phonetic.cpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/phonetic.cpp Wed Oct 2 04:49:03 2002 @@ -7,6 +7,7 @@ #include "file_util.hpp" #include "file_data_util.hpp" #include "clone_ptr-t.hpp" +#include "generic_copy_ptr-t.hpp" #include @@ -33,7 +34,7 @@ char c = lang->to_sl(static_cast(i)); if (c) chars_set[static_cast(c)] = true; } - for (int i = 0; i != 256; ++i) + for (/*int*/ i = 0; i != 256; ++i) //FB { if (chars_set[i]) chars_list += static_cast(i); @@ -86,7 +87,7 @@ if (lang->is_alpha(c) || lang->special(c).any()) chars_set[static_cast(lang->to_stripped(c))] = true; } - for (int i = 0; i != 256; ++i) + for (/*int*/ i = 0; i != 256; ++i) //FB { if (chars_set[i]) chars_list += static_cast(i); @@ -158,10 +159,10 @@ chars_set[static_cast(*j)] = true; } } - for (int i = 0; i != 256; ++i) + for (int k = 0; k != 256; ++k) //FB { - if (chars_set[i]) - chars_list += static_cast(i); + if (chars_set[k]) //FB + chars_list += static_cast(k); //FB } return chars_list; } @@ -207,6 +208,8 @@ } +#ifndef WIN32 namespace acommon { template class ClonePtr; } +#endif diff -rubw aspell-0.50.2/modules/speller/default/readonly_ws.cpp aspell-win32/modules/speller/default/readonly_ws.cpp --- aspell-0.50.2/modules/speller/default/readonly_ws.cpp Sun Mar 24 01:35:15 2002 +++ aspell-win32/modules/speller/default/readonly_ws.cpp Wed Oct 2 04:49:03 2002 @@ -66,6 +66,10 @@ // And like the .wrd file the hash table contains offsets not pointers. // +#ifdef WIN32 +# pragma warning(disable:4786) +#endif + #include using std::vector; @@ -175,7 +179,7 @@ typedef BlockVector Vector; typedef u32int Value; typedef const char * Key; - static const bool is_multi = true; +// static const bool is_multi = true; Key key(Value v) const {assert (v != u32int_max); return block_begin + v;} InsensitiveHash hash; @@ -192,7 +196,7 @@ typedef BlockVector Vector; typedef u32int Value; typedef const char * Key; - static const bool is_multi = false; +// static const bool is_multi = false; Key key(Value v) const {return block_begin + v;} hash hash; bool equal(Key rhs, Key lhs) const {return strcmp(rhs,lhs) == 0;} @@ -267,7 +271,7 @@ }; ReadOnlyWS::VirEmul * ReadOnlyWS::detailed_elements() const { - return new MakeVirEnumeration + return new MakeVirEnumeration > (word_lookup.begin(), ElementsParms(block)); } @@ -512,12 +516,14 @@ if (use_soundslike) { - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (soundslike_lookup.begin(), soundslike_block); } else { - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (word_lookup.begin(), SoundslikeElementsParmsNoSL(max_word_length,block,lang())); @@ -530,7 +536,31 @@ if (use_soundslike) { SoundslikeLookup::const_iterator i = soundslike_lookup.find(soundslike); - if (i == soundslike_lookup.end()) { + SoundslikeLookup::const_iterator end = soundslike_lookup.end(); + +// const char* t1 = "test1"; +// const char* t2 = "test2"; + + //VectorHashTable v; + //ReadOnlyWS::SoundslikeLookupParms *p1 = new ReadOnlyWS::SoundslikeLookupParms(); + //ReadOnlyWS::SoundslikeLookupParms *p2 = new ReadOnlyWS::SoundslikeLookupParms(); + //vector v; +/* v.insert(&t1); + v.insert(&t2); + bool b = v.begin() == v.end(); +*/ + int ent1 = 5; + int ent2 = 6; + +// BlockVector v(2); + + + // v.insert(t1); + // v[0] = t2; + +// bool b = v.begin() == v.end(); + + if (i == end) { return new MakeAlwaysEndEnumeration(); } else { return ReadOnlyWS::words_w_soundslike @@ -540,7 +570,8 @@ } else { WordLookup::ConstFindIterator i = word_lookup.multi_find(soundslike); - return new MakeVirEnumeration(i, block); + return new MakeVirEnumeration >(i, block); } @@ -554,7 +585,8 @@ const u32int * end = reinterpret_cast(w.soundslike - 2); u16int size = *reinterpret_cast(end); - return new MakeVirEnumeration + return new MakeVirEnumeration > (end - size, SoundslikeWordsParms(word_block, end)); } else { @@ -584,7 +616,7 @@ typedef vector Vector; typedef const char * Value; typedef const char * Key; - static const bool is_multi = true; + static const bool is_multi;//FB = true; const Key & key(const Value & v) const {return v;} InsensitiveHash hash_; size_t hash(const Key & k) const {return hash_(k);} @@ -595,6 +627,7 @@ bool is_nonexistent(const Value & v) const {return v == 0;} void make_nonexistent(Value & v) const {v = 0;} }; + const bool WordLookupParms::is_multi = true; typedef VectorHashTable WordHash; @@ -610,7 +643,7 @@ }; typedef pair Value; typedef vector Vector; - static const bool is_multi = false; + static const bool is_multi;//FB = false; const Key & key(const Value & v) const {return v.first;} hash hash; bool equal(const Key & rhs, const Key & lhs) const {return strcmp(rhs,lhs) == 0;} @@ -620,6 +653,8 @@ } }; + const bool SoundslikeLookupParms::is_multi = false; + typedef VectorHashTable SoundHash; static inline unsigned int round_up(unsigned int i, unsigned int size) { diff -rubw aspell-0.50.2/modules/speller/default/simple_string.hpp aspell-win32/modules/speller/default/simple_string.hpp --- aspell-0.50.2/modules/speller/default/simple_string.hpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/simple_string.hpp Wed Oct 2 04:49:03 2002 @@ -33,8 +33,10 @@ SimpleString(const char * other, int) : str_(other), delete_(false) {} - ~SimpleString() {if (delete_) delete[] str_;} + ~SimpleString() {if (delete_) delete[] const_cast(str_);} //FB const char * c_str() const {return str_;} + + }; inline bool operator== (SimpleString rhs, SimpleString lhs) { diff -rubw aspell-0.50.2/modules/speller/default/speller_impl.cpp aspell-win32/modules/speller/default/speller_impl.cpp --- aspell-0.50.2/modules/speller/default/speller_impl.cpp Mon Sep 23 21:30:27 2002 +++ aspell-win32/modules/speller/default/speller_impl.cpp Wed Oct 2 17:04:00 2002 @@ -240,7 +240,7 @@ words[0].set(s.word, *i == m ? m : '\0'); words[1].clear(); if ((!check_if_valid || !c.mid_required()) // if check then !s.mid_required() - && check(i, word_end, run_together_limit - 1, end_pos, words + 1)) + && (bool) check(i, word_end, run_together_limit - 1, end_pos, words + 1)) //FB return true; if ((check_if_valid ? *i == m : strchr(run_together_middle_, *i) != 0) && word_end - (i + 1) >= static_cast(run_together_min_)) { @@ -277,7 +277,7 @@ } SpellerImpl::WordLists SpellerImpl::wordlists() const { - return WordLists(MakeVirEnumeration + return WordLists(MakeVirEnumeration > //FB (wls_->begin(), DataSetCollection::Parms(wls_->end()))); } @@ -430,6 +430,7 @@ const char * name; enum Type {String, Int, Bool, Add, Rem, RemAll}; Type type; + union Fun { typedef PosibErr (*WithStr )(SpellerImpl *, const char *); typedef PosibErr (*WithInt )(SpellerImpl *, int); @@ -448,6 +449,7 @@ PosibErr call(SpellerImpl * m, bool val) const {return (*with_bool)(m,val);} } fun; + typedef SpellerImpl::ConfigNotifier CN; }; @@ -520,7 +522,43 @@ }; - static UpdateMember update_members[] = + + + template + PosibErr callback(SpellerImpl * m, const KeyInfo * ki, T value, + UpdateMember::Type t) + { + //FB (well, VC++ gets totally confused by fun) + static UpdateMember update_members[9]; + update_members[0].name = "ignore"; + update_members[0].type = UpdateMember::Int; + update_members[0].fun = UpdateMember::CN::ignore; + update_members[1].name = "ignore_accents"; + update_members[1].type = UpdateMember::Bool; + update_members[1].fun = UpdateMember::CN::ignore_accents; + update_members[2].name = "ignore_case"; + update_members[2].type = UpdateMember::Bool; + update_members[2].fun = UpdateMember::CN::ignore_case; + update_members[3].name = "ignore_repl"; + update_members[3].type = UpdateMember::Bool; + update_members[3].fun = UpdateMember::CN::ignore_repl; + update_members[4].name = "save_repl"; + update_members[4].type = UpdateMember::Bool; + update_members[4].fun = UpdateMember::CN::save_repl; + update_members[5].name = "sug-mode"; + update_members[5].type = UpdateMember::String; + update_members[5].fun = UpdateMember::CN::sug_mode; + update_members[6].name = "run-together-min"; + update_members[6].type = UpdateMember::Bool; + update_members[6].fun = UpdateMember::CN::run_together; + update_members[7].name = "run-together-limit"; + update_members[7].type = UpdateMember::Int; + update_members[7].fun = UpdateMember::CN::run_together_limit; + update_members[8].name = "run-together-min"; + update_members[8].type = UpdateMember::Int; + update_members[8].fun = UpdateMember::CN::run_together_min; + +/* { {"ignore", UpdateMember::Int, UpdateMember::CN::ignore} ,{"ignore-accents",UpdateMember::Bool, UpdateMember::CN::ignore_accents} @@ -528,21 +566,12 @@ ,{"ignore-repl", UpdateMember::Bool, UpdateMember::CN::ignore_repl} ,{"save-repl", UpdateMember::Bool, UpdateMember::CN::save_repl} ,{"sug-mode", UpdateMember::String, UpdateMember::CN::sug_mode} - ,{"run-together", - UpdateMember::Bool, - UpdateMember::CN::run_together} - ,{"run-together-limit", - UpdateMember::Int, - UpdateMember::CN::run_together_limit} - ,{"run-together-min", - UpdateMember::Int, - UpdateMember::CN::run_together_min} + ,{"run-together", UpdateMember::Bool, UpdateMember::CN::run_together} + ,{"run-together-limit",UpdateMember::Int, UpdateMember::CN::run_together_limit} + ,{"run-together-min",UpdateMember::Int, UpdateMember::CN::run_together_min} }; +*/ - template - PosibErr callback(SpellerImpl * m, const KeyInfo * ki, T value, - UpdateMember::Type t) - { const UpdateMember * i = update_members; const UpdateMember * end @@ -573,7 +602,7 @@ config_.reset(c); ignore_repl = config_->retrieve_bool("ignore-repl"); - ignore_count = config_->retrieve_int("ignore"); + ignore_count = (unsigned int)config_->retrieve_int("ignore"); wls_.reset(new DataSetCollection()); @@ -638,14 +667,14 @@ run_together_specified_ = config_->retrieve_bool("run-together-specified"); run_together_middle_ = lang().mid_chars(); - run_together_limit_ = config_->retrieve_int("run-together-limit"); + run_together_limit_ = (unsigned int)config_->retrieve_int("run-together-limit"); //FB if (run_together_limit_ > 8) { config_->replace("run-together-limit", "8"); run_together_limit_ = 8; } - run_together_min_ = config_->retrieve_int("run-together-min"); + run_together_min_ = (unsigned int)config_->retrieve_int("run-together-min"); //FB - run_together_start_len_ = config_->retrieve_int("run-together-specified"); + run_together_start_len_ = (unsigned int)config_->retrieve_int("run-together-specified"); //FB if (unconditional_run_together_ && run_together_min_ < run_together_start_len_) run_together_start_len_ = run_together_min_; @@ -720,7 +749,8 @@ } } +#ifndef WIN32 namespace acommon { template class CopyPtr; } - +#endif diff -rubw aspell-0.50.2/modules/speller/default/speller_impl.hpp aspell-win32/modules/speller/default/speller_impl.hpp --- aspell-0.50.2/modules/speller/default/speller_impl.hpp Fri Jul 26 21:27:10 2002 +++ aspell-win32/modules/speller/default/speller_impl.hpp Wed Oct 2 04:49:03 2002 @@ -26,7 +26,7 @@ namespace aspeller { class Language; - class SensitiveCompare; + struct SensitiveCompare; class Suggest; class SpellerImpl : public Speller diff -rubw aspell-0.50.2/modules/speller/default/suggest.cpp aspell-win32/modules/speller/default/suggest.cpp --- aspell-0.50.2/modules/speller/default/suggest.cpp Fri Jul 26 21:27:10 2002 +++ aspell-win32/modules/speller/default/suggest.cpp Wed Oct 2 04:49:03 2002 @@ -167,10 +167,10 @@ BasicList strings; - static const bool do_count = true; - static const bool dont_count = false; - static const bool do_need_alloc = true; - static const bool dont_need_alloc = false; + static const bool do_count; //FB = true; + static const bool dont_count; //FB = false; + static const bool do_need_alloc;//FB = true; + static const bool dont_need_alloc;//FB = false; void try_sound(const char *, int ms); void add_nearmiss(const char * word, int ms, bool count, @@ -279,6 +279,11 @@ } } + const bool Working::do_count = true; + const bool Working::dont_count = false; + const bool Working::do_need_alloc = true; + const bool Working::dont_need_alloc = false; + // // try_others - tries to come up with possible suggestions // @@ -311,7 +316,7 @@ new_word[i+1] = new_word[i]; new_word[i] = '\0'; - if (speller->check(new_word) && speller->check(new_word + i + 1)) { + if ((bool)speller->check(new_word) && (bool)speller->check(new_word + i + 1)) { //FB uncertain new_word[i] = ' '; add_nearmiss(new_word, parms.edit_distance_weights.del2, dont_count, do_need_alloc); @@ -636,9 +641,9 @@ dup_pair = duplicates_check.insert(fix_case(word)); if (dup_pair.second && ((pos = dup_pair.first->find(' '), pos == String::npos) - ? (bool)speller->check(*dup_pair.first) - : (speller->check((String)dup_pair.first->substr(0,pos)) - && speller->check((String)dup_pair.first->substr(pos+1))) )) + ? (bool)speller->check(*dup_pair.first) //FB + : ((bool)speller->check((String)dup_pair.first->substr(0,pos)) //FB + && (bool)speller->check((String)dup_pair.first->substr(pos+1))) )) //FB near_misses_final->push_back(*dup_pair.first); } } else { @@ -825,7 +830,7 @@ l.to_normalized(key[0])) = w.extra_dis1; } - for (int i = 0; i != c; ++i) { + for (/*int*/ i = 0; i != c; ++i) { w.repl(i,i) = 0; w.extra(i,i) = w.extra_dis1; } diff -rubw aspell-0.50.2/modules/speller/default/vector_hash-t.hpp aspell-win32/modules/speller/default/vector_hash-t.hpp --- aspell-0.50.2/modules/speller/default/vector_hash-t.hpp Sun Aug 11 08:58:30 2002 +++ aspell-win32/modules/speller/default/vector_hash-t.hpp Wed Oct 2 04:49:03 2002 @@ -19,7 +19,7 @@ #include "primes.hpp" namespace aspeller { - +/* FB template VectorHashTable::FindIterator ::FindIterator(const HashTable * ht, const key_type & k) @@ -41,7 +41,7 @@ } while (!parms->is_nonexistent((*vector)[i]) && !parms->equal(parms->key((*vector)[i]), key)); } - +*/ template void VectorHashTable::nonexistent_vector() { vector_iterator vector_end = vector_.end(); @@ -51,7 +51,7 @@ } template - std::pair::iterator, bool> + std::pair::iterator, bool> //FB VectorHashTable::insert(const value_type & d) { MutableFindIterator j(this, parms_.key(d)); @@ -167,8 +167,8 @@ } VectorHashTable temp(i,parms_); iterator e = end(); - for (iterator i = begin(); i != e; ++i) - temp.insert(*i); + for (iterator i2 = begin(); i2 != e; ++i2) //FB + temp.insert(*i2); //FB swap(temp); } diff -rubw aspell-0.50.2/modules/speller/default/vector_hash.hpp aspell-win32/modules/speller/default/vector_hash.hpp --- aspell-0.50.2/modules/speller/default/vector_hash.hpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/vector_hash.hpp Wed Oct 2 04:49:03 2002 @@ -13,12 +13,18 @@ #ifndef __aspeller_vector_hash_hh__ #define __aspeller_vector_hash_hh__ +#ifdef WIN32 +# pragma warning(disable:4786) +#endif + #include #include + #include "settings.h" #undef REL_OPS_POLLUTION // FIXME + namespace aspeller { // @@ -44,10 +50,18 @@ class VHTIterator { template - friend bool operator== (VHTIterator, VHTIterator); +// friend bool operator== (VHTIterator, VHTIterator); + bool operator== (VHTIterator rhs) + { + return pos == rhs.pos; + } #ifndef REL_OPS_POLLUTION template - friend bool operator!= (VHTIterator, VHTIterator); +// friend bool operator!= (VHTIterator, VHTIterator); + bool operator!= (VHTIterator rhs) + { + return pos != rhs.pos; + } #endif public: //but don't use typedef typename Parms::TableIter TableIter; @@ -57,9 +71,9 @@ public: typedef std::bidirectional_iterator_tag iterator_category; typedef typename Parms::Value value_type; - typedef typename std::iterator_traits::difference_type difference_type; - typedef typename std::iterator_traits::pointer pointer; - typedef typename std::iterator_traits::reference reference; + //typedef typename std::iterator_traits::difference_type difference_type; + //typedef typename std::iterator_traits::pointer pointer; + //typedef typename std::iterator_traits::reference reference; //VHTIterator vector_iterator() const {return pos;} public: @@ -107,23 +121,23 @@ return temp; } }; - +/* template inline bool operator== (VHTIterator rhs, VHTIterator lhs) { return rhs.pos == lhs.pos; } - +*/ #ifndef REL_OPS_POLLUTION - +/* template inline bool operator!= (VHTIterator rhs, VHTIterator lhs) { return rhs.pos != lhs.pos; } - +*/ #endif //////////////////////////////////////////////////////// @@ -148,14 +162,14 @@ class VectorHashTable { typedef typename Parms::Vector Vector; public: - typedef typename Parms::Vector vector_type; - typedef typename Vector::value_type value_type; - typedef typename Vector::size_type size_type; - typedef typename Vector::difference_type difference_type; - - typedef typename Vector::pointer pointer; - typedef typename Vector::reference reference; - typedef typename Vector::const_reference const_reference; + typedef typename Vector vector_type; + typedef typename Parms::Vector::value_type value_type; //FB + typedef typename Parms::Vector::size_type size_type; //FB + typedef typename Parms::Vector::difference_type difference_type; //FB + + typedef typename Parms::Vector::_Tptr pointer; //FB + typedef typename Parms::Vector::reference reference; //FB + typedef typename Parms::Vector::const_reference const_reference; //FB typedef typename Parms::Key key_type; public: // but don't use @@ -181,8 +195,8 @@ size_type size_; public: // but don't use - typedef typename Vector::iterator vector_iterator; - typedef typename Vector::const_iterator const_vector_iterator; + typedef typename Parms::Vector::iterator vector_iterator; //FB + typedef typename Parms::Vector::const_iterator const_vector_iterator; //FB private: int hash1(const key_type &d) const { @@ -248,11 +262,29 @@ int i; int hash2; FindIterator() {} - FindIterator(const HashTable * ht, const key_type & k); + FindIterator(const HashTable * ht, const key_type & k) : vector(&ht->vector()) //FB + , parms(&ht->parms()) + , key(k) + , i(ht->hash1(k)) + , hash2(ht->hash2(k)) + { + if (!parms->is_nonexistent((*vector)[i]) + && !parms->equal(parms->key((*vector)[i]), key)) + adv(); + } + public: bool at_end() const {return parms->is_nonexistent((*vector)[i]);} - void adv(); + void adv(){ //FB + do { + i = (i + hash2) % vector->size(); + } while (!parms->is_nonexistent((*vector)[i]) + && !parms->equal(parms->key((*vector)[i]), key)); + } + FindIterator & operator ++() {adv(); return *this;} + + }; friend class FindIterator; diff -rubw aspell-0.50.2/modules/speller/default/writable_repl.cpp aspell-win32/modules/speller/default/writable_repl.cpp --- aspell-0.50.2/modules/speller/default/writable_repl.cpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/writable_repl.cpp Wed Oct 2 04:49:03 2002 @@ -1,5 +1,9 @@ // Copyright 2000 by Kevin Atkinson under the terms of the LGPL +#ifdef WIN32 +# pragma warning(disable:4786) +#endif + #include #include "data_util.hpp" @@ -87,7 +91,7 @@ {lookup_table = new LookupTable();} ~WritableReplS() {delete lookup_table;} - struct ElementsVirEmulImpl; + class ElementsVirEmulImpl;//FB VirEmul * elements() const; Size size() const; bool empty() const; @@ -152,9 +156,9 @@ // this assums LookupTable is non empty ElementsVirEmulImpl (const LookupTable & c) : outer_(c.begin()), end_(c.end()) - {if (outer_ != end_) inner_ = outer_->second.begin();} + {if (!(outer_ == end_)) inner_ = outer_->second.begin();} //FB - ElementsVirEmulImpl * clone() const { + /*ElementsVirEmulImpl*/ VirEnumeration* clone() const { //FB ? return new ElementsVirEmulImpl(*this); } @@ -171,7 +175,8 @@ } ReplacementList temp (inner_->misspelled_word().c_str(), - new MakeVirEnumeration > + new MakeVirEnumeration, //FB + VirEnumeration::Value> > //FB (inner_->begin(), inner_->end())); ++inner_; return temp; @@ -225,7 +230,8 @@ Value deref(Iterator i) const { return ReplacementList (i->misspelled_word().c_str(), - new MakeVirEnumeration > + new MakeVirEnumeration,//FB + VirEnumeration::Value> > //FB (i->begin(), i->end())); } }; @@ -239,7 +245,8 @@ if (i == lookup_table->end()) { return new MakeAlwaysEndEnumeration(); } else { - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (i->second.begin(), ReplsWSoundslikeParms(i->second.end())); } } @@ -251,7 +258,8 @@ const RealReplList * p = reinterpret_cast(soundslike.word_list_pointer); - return new MakeVirEnumeration(p->begin(), p->end()); + return new MakeVirEnumeration >(p->begin(), p->end()); //FB } @@ -270,7 +278,8 @@ WritableReplS::VirSoundslikeEmul * WritableReplS::soundslike_elements() const { - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (lookup_table->begin(),SoundslikeElementsParms(lookup_table->end())); } @@ -281,7 +290,7 @@ LookupTable::iterator i = lookup_table->begin(); LookupTable::iterator e = lookup_table->end(); - for (;i != e; ++i) { + for (;!(i == e); ++i) { //FB for (RealReplList::iterator j = i->second.begin(); j != i->second.end(); ++j) diff -rubw aspell-0.50.2/modules/speller/default/writable_ws.cpp aspell-win32/modules/speller/default/writable_ws.cpp --- aspell-0.50.2/modules/speller/default/writable_ws.cpp Thu Nov 29 22:55:48 2001 +++ aspell-win32/modules/speller/default/writable_ws.cpp Wed Oct 2 04:49:03 2002 @@ -1,5 +1,9 @@ // Copyright 2000 by Kevin Atkinson under the terms of the LGPL +#ifdef WIN32 +# pragma warning(disable:4786) +#endif + #include #include "copy_ptr-t.hpp" @@ -92,7 +96,8 @@ WritableWS::VirEmul * WritableWS::detailed_elements() const { - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (word_lookup->begin(),ElementsParms(word_lookup->end())); } @@ -153,7 +158,7 @@ RealSoundslikeWordList::const_iterator j; - for (;i != e; ++i) { + for (;!(i == e); ++i) { //FB (strange) for (j = i->second.begin(); j != i->second.end(); ++j) { out << *j << '\n'; } @@ -185,7 +190,7 @@ { pair p(word_lookup->equal_range(SimpleString(word,1))); - while (p.first != p.second) { + while (!(p.first == p.second)) { //FB if (c(word,p.first->c_str())) return p.first->c_str(); ++p.first; @@ -212,7 +217,8 @@ if (i == soundslike_lookup.end()) { return new MakeAlwaysEndEnumeration(); } else { - return new MakeVirEnumeration + return new MakeVirEnumeration > (i->second.begin(), SoundslikeWordsParms(i->second.end())); } } @@ -232,7 +238,8 @@ WritableWS::VirSoundslikeEmul * WritableWS::soundslike_elements() const { - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (soundslike_lookup.begin(), soundslike_lookup.end()); } @@ -243,7 +250,8 @@ = reinterpret_cast (word.word_list_pointer); - return new MakeVirEnumeration + return new MakeVirEnumeration > //FB (temp->begin(), SoundslikeWordsParms(temp->end())); }