diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-09-25 23:26:40 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-09-25 23:26:40 +0200 |
commit | 00937957ac745d4047f025a2e4b598a17493229a (patch) | |
tree | 2c479207007987708e813280555fac018c449d7c /fsa | |
parent | 2e98108d5acbf127d53c9fa42d9142e1c4e34e7f (diff) |
Remove dead code in fsa.
Diffstat (limited to 'fsa')
24 files changed, 0 insertions, 188 deletions
diff --git a/fsa/src/vespa/fsa/automaton-alternate.cpp b/fsa/src/vespa/fsa/automaton-alternate.cpp index 205ed08c4ff..015e270bc63 100644 --- a/fsa/src/vespa/fsa/automaton-alternate.cpp +++ b/fsa/src/vespa/fsa/automaton-alternate.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include <stdio.h> #include <fcntl.h> diff --git a/fsa/src/vespa/fsa/automaton.cpp b/fsa/src/vespa/fsa/automaton.cpp index 75aead62ba5..88777f4e198 100644 --- a/fsa/src/vespa/fsa/automaton.cpp +++ b/fsa/src/vespa/fsa/automaton.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include <stdio.h> #include <fcntl.h> diff --git a/fsa/src/vespa/fsa/base64.cpp b/fsa/src/vespa/fsa/base64.cpp index a326db63ee5..cc72a7a61cf 100644 --- a/fsa/src/vespa/fsa/base64.cpp +++ b/fsa/src/vespa/fsa/base64.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <iostream> #include <string> diff --git a/fsa/src/vespa/fsa/blob.cpp b/fsa/src/vespa/fsa/blob.cpp index 306ad5313b2..21c50fcdbe3 100644 --- a/fsa/src/vespa/fsa/blob.cpp +++ b/fsa/src/vespa/fsa/blob.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "blob.h" diff --git a/fsa/src/vespa/fsa/conceptnet.cpp b/fsa/src/vespa/fsa/conceptnet.cpp index 657f6d3404c..f380270e230 100644 --- a/fsa/src/vespa/fsa/conceptnet.cpp +++ b/fsa/src/vespa/fsa/conceptnet.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "conceptnet.h" #include "fstream" diff --git a/fsa/src/vespa/fsa/detector.cpp b/fsa/src/vespa/fsa/detector.cpp index 02c42c8f0f5..da39c4291ab 100644 --- a/fsa/src/vespa/fsa/detector.cpp +++ b/fsa/src/vespa/fsa/detector.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <list> #include <algorithm> #include <cmath> diff --git a/fsa/src/vespa/fsa/fsa.cpp b/fsa/src/vespa/fsa/fsa.cpp index 4abc6f979d8..be21c78bbeb 100644 --- a/fsa/src/vespa/fsa/fsa.cpp +++ b/fsa/src/vespa/fsa/fsa.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "fsa.h" #include "checksum.h" diff --git a/fsa/src/vespa/fsa/metadata.cpp b/fsa/src/vespa/fsa/metadata.cpp index 59adbf39740..5cd469a1398 100644 --- a/fsa/src/vespa/fsa/metadata.cpp +++ b/fsa/src/vespa/fsa/metadata.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "metadata.h" #include "fstream" diff --git a/fsa/src/vespa/fsa/ngram.cpp b/fsa/src/vespa/fsa/ngram.cpp index c8985a3b385..fafcf663deb 100644 --- a/fsa/src/vespa/fsa/ngram.cpp +++ b/fsa/src/vespa/fsa/ngram.cpp @@ -7,10 +7,6 @@ * @brief n-gram class for tokenized text. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "ngram.h" #include "wordchartokenizer.h" diff --git a/fsa/src/vespa/fsa/permuter.cpp b/fsa/src/vespa/fsa/permuter.cpp index 47165415b52..4a4110bec47 100644 --- a/fsa/src/vespa/fsa/permuter.cpp +++ b/fsa/src/vespa/fsa/permuter.cpp @@ -7,10 +7,6 @@ * @brief Permuter class. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "permuter.h" namespace fsa { diff --git a/fsa/src/vespa/fsa/segmenter.cpp b/fsa/src/vespa/fsa/segmenter.cpp index 0800ae284e3..cfae1db4d3e 100644 --- a/fsa/src/vespa/fsa/segmenter.cpp +++ b/fsa/src/vespa/fsa/segmenter.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "segmenter.h" diff --git a/fsa/src/vespa/fsa/selector.cpp b/fsa/src/vespa/fsa/selector.cpp index 02cf08826fc..b617d00c5c8 100644 --- a/fsa/src/vespa/fsa/selector.cpp +++ b/fsa/src/vespa/fsa/selector.cpp @@ -7,10 +7,6 @@ * @brief Selector class. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "selector.h" namespace fsa { diff --git a/fsa/src/vespa/fsa/unicode.cpp b/fsa/src/vespa/fsa/unicode.cpp index c8af6927083..9574ecf9e29 100644 --- a/fsa/src/vespa/fsa/unicode.cpp +++ b/fsa/src/vespa/fsa/unicode.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "unicode.h" diff --git a/fsa/src/vespa/fsa/unicode_charprops.cpp b/fsa/src/vespa/fsa/unicode_charprops.cpp index c747cbbeff7..821a86c063c 100644 --- a/fsa/src/vespa/fsa/unicode_charprops.cpp +++ b/fsa/src/vespa/fsa/unicode_charprops.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "unicode.h" diff --git a/fsa/src/vespa/fsa/unicode_lowercase.cpp b/fsa/src/vespa/fsa/unicode_lowercase.cpp index 41757ea47f7..208c717c90c 100644 --- a/fsa/src/vespa/fsa/unicode_lowercase.cpp +++ b/fsa/src/vespa/fsa/unicode_lowercase.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "unicode.h" diff --git a/fsa/src/vespa/fsa/unicode_tables.cpp b/fsa/src/vespa/fsa/unicode_tables.cpp index 29072cad49d..6d27d0f98ae 100644 --- a/fsa/src/vespa/fsa/unicode_tables.cpp +++ b/fsa/src/vespa/fsa/unicode_tables.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "unicode.h" diff --git a/fsa/src/vespa/fsa/vectorizer.cpp b/fsa/src/vespa/fsa/vectorizer.cpp index af613fcb715..ff3f26eaa78 100644 --- a/fsa/src/vespa/fsa/vectorizer.cpp +++ b/fsa/src/vespa/fsa/vectorizer.cpp @@ -7,10 +7,6 @@ * @brief Simple document vectorizer based on %FSA (%Finite %State %Automaton) (implementation) */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <list> #include <algorithm> #include <cmath> diff --git a/fsa/src/vespa/fsa/wordchartokenizer.cpp b/fsa/src/vespa/fsa/wordchartokenizer.cpp index 468e7cc257e..ee7fddce76b 100644 --- a/fsa/src/vespa/fsa/wordchartokenizer.cpp +++ b/fsa/src/vespa/fsa/wordchartokenizer.cpp @@ -1,7 +1,4 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "wordchartokenizer.h" #include "unicode.h" diff --git a/fsa/src/vespa/fsamanagers/conceptnetmanager.cpp b/fsa/src/vespa/fsamanagers/conceptnetmanager.cpp index a8dad4345f6..0411a6c7831 100644 --- a/fsa/src/vespa/fsamanagers/conceptnetmanager.cpp +++ b/fsa/src/vespa/fsamanagers/conceptnetmanager.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "conceptnetmanager.h" namespace fsa { diff --git a/fsa/src/vespa/fsamanagers/fsamanager.cpp b/fsa/src/vespa/fsamanagers/fsamanager.cpp index 037e0f53f79..c147be5ab96 100644 --- a/fsa/src/vespa/fsamanagers/fsamanager.cpp +++ b/fsa/src/vespa/fsamanagers/fsamanager.cpp @@ -8,22 +8,8 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "fsamanager.h" -#ifdef HAVE_CURL -#include <stdio.h> -#include <unistd.h> -#include <curl/curl.h> -#include <curl/types.h> -#include <curl/easy.h> -#endif - - - namespace fsa { // {{{ FSAManager::~FSAManager() @@ -80,45 +66,8 @@ bool FSAManager::load(const std::string &id, const std::string &url) bool FSAManager::getUrl(const std::string &url, const std::string &file) { -#ifdef HAVE_CURL - CURL *curl_handle; - FILE *filehandle; - long response_code; - - filehandle = fopen(file.c_str(),"r"); - if(filehandle!=NULL){ - fclose(filehandle); - return true; - } - - filehandle = fopen(file.c_str(),"w"); - if(filehandle==NULL) - return false; - - curl_handle = curl_easy_init(); - - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)filehandle); - curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libfsa-url-agent/0.1"); - - curl_easy_perform(curl_handle); - - curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &response_code); - - curl_easy_cleanup(curl_handle); - - fclose(filehandle); - - if(response_code!=200){ - unlink(file.c_str()); - return false; - } - - return true; -#else // HAVE_CURL (void)url;(void)file; return false; -#endif // HAVE_CURL } // }}} diff --git a/fsa/src/vespa/fsamanagers/metadatamanager.cpp b/fsa/src/vespa/fsamanagers/metadatamanager.cpp index a237a8bd9e9..c49e3069541 100644 --- a/fsa/src/vespa/fsamanagers/metadatamanager.cpp +++ b/fsa/src/vespa/fsamanagers/metadatamanager.cpp @@ -8,10 +8,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "metadatamanager.h" namespace fsa { diff --git a/fsa/src/vespa/fsamanagers/mutex.cpp b/fsa/src/vespa/fsamanagers/mutex.cpp index a1024980472..9a6a9f89a76 100644 --- a/fsa/src/vespa/fsamanagers/mutex.cpp +++ b/fsa/src/vespa/fsamanagers/mutex.cpp @@ -8,15 +8,9 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef DISABLE_THREADS #include <pthread.h> #include <sched.h> #include <cassert> -#endif #include "mutex.h" @@ -26,57 +20,37 @@ namespace fsa { struct Mutex::Impl { -#ifndef DISABLE_THREADS pthread_mutex_t _mutex; /**< lock */ -#else - int _mutex; -#endif }; // }}} Mutex::Mutex(void) : _impl(new Impl) { -#ifndef DISABLE_THREADS int rc; rc = pthread_mutex_init(&(_impl->_mutex),NULL); assert(rc == 0); -#endif } Mutex::~Mutex(void) { -#ifndef DISABLE_THREADS pthread_mutex_destroy(&(_impl->_mutex)); -#endif delete _impl; } bool Mutex::tryLock (void) { -#ifndef DISABLE_THREADS return pthread_mutex_trylock(&(_impl->_mutex)) == 0; -#else - return true; -#endif } bool Mutex::lock (void) { -#ifndef DISABLE_THREADS return pthread_mutex_lock(&(_impl->_mutex)) == 0; -#else - return true; -#endif } bool Mutex::unlock (void) { -#ifndef DISABLE_THREADS return pthread_mutex_unlock(&(_impl->_mutex)) == 0; -#else - return true; -#endif } } // namespace fsa diff --git a/fsa/src/vespa/fsamanagers/rwlock.cpp b/fsa/src/vespa/fsamanagers/rwlock.cpp index 2a0ed5ec982..d654ce5fd4e 100644 --- a/fsa/src/vespa/fsamanagers/rwlock.cpp +++ b/fsa/src/vespa/fsamanagers/rwlock.cpp @@ -8,15 +8,9 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef DISABLE_THREADS #include <pthread.h> #include <sched.h> #include <cassert> -#endif #include "rwlock.h" @@ -26,75 +20,47 @@ namespace fsa { struct RWLock::Impl { -#ifndef DISABLE_THREADS pthread_rwlock_t _rwlock; /**< Lock. */ -#else - int _rwlock; -#endif }; // }}} RWLock::RWLock(void) : _impl(new Impl) { -#ifndef DISABLE_THREADS int rc; rc = pthread_rwlock_init(&(_impl->_rwlock),NULL); assert(rc == 0); -#endif } RWLock::~RWLock(void) { -#ifndef DISABLE_THREADS pthread_rwlock_destroy(&(_impl->_rwlock)); -#endif delete _impl; } bool RWLock::tryRdLock (void) { -#ifndef DISABLE_THREADS return pthread_rwlock_tryrdlock(&(_impl->_rwlock)) == 0; -#else - return true; -#endif } bool RWLock::tryWrLock (void) { -#ifndef DISABLE_THREADS return pthread_rwlock_trywrlock(&(_impl->_rwlock)) == 0; -#else - return true; -#endif } bool RWLock::rdLock (void) { -#ifndef DISABLE_THREADS return pthread_rwlock_rdlock(&(_impl->_rwlock)) == 0; -#else - return true; -#endif } bool RWLock::wrLock (void) { -#ifndef DISABLE_THREADS return pthread_rwlock_wrlock(&(_impl->_rwlock)) == 0; -#else - return true; -#endif } bool RWLock::unlock (void) { -#ifndef DISABLE_THREADS return pthread_rwlock_unlock(&(_impl->_rwlock)) == 0; -#else - return true; -#endif } } // namespace fsa diff --git a/fsa/src/vespa/fsamanagers/singleton.cpp b/fsa/src/vespa/fsamanagers/singleton.cpp index 83ba78b8d82..7b069b74e4d 100644 --- a/fsa/src/vespa/fsamanagers/singleton.cpp +++ b/fsa/src/vespa/fsamanagers/singleton.cpp @@ -7,10 +7,6 @@ * @brief Singleton pattern. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <stdlib.h> #include "singleton.h" |