Skip to content

Commit

Permalink
Rename USE_ for HAVE_ in symbol definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioAriasGa committed Sep 29, 2014
1 parent 8ce4a51 commit b1e82b9
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions hdt-lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ OS := $(shell uname)
LIBCDSPATH = ../libcds-v1.0.12

# Uncomment here to enable optional dependencies
#RAPTOR_SUPPORT=true
RAPTOR_SUPPORT=true
#KYOTO_SUPPORT=true
LIBZ_SUPPORT=true
#SERD_SUPPORT=true
SERD_SUPPORT=true

CPP=g++
FLAGS=-O3 -Wno-deprecated
Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/qmake/hdt-lib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CONFIG += staticlib
DEFINES += HAVE_CDS

DEFINES += HAVE_LIBZ HAVE_LIBRAPTOR2 RAPTOR_STATIC
#HAVE_LIBSERD_0
#HAVE_SERD

win32:OutputDir = 'win32'
unix:OutputDir = 'unix'
Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/src/dictionary/KyotoDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <HDTVocabulary.hpp>
#include <HDTEnums.hpp>

#ifdef USE_KYOTO
#ifdef HAVE_KYOTO

namespace hdt {

Expand Down
4 changes: 2 additions & 2 deletions hdt-lib/src/dictionary/KyotoDictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <fstream>
#include <iostream>

#ifdef HAVE_LIBKYOTOCABINET
#ifdef HAVE_KYOTO

#include <kcpolydb.h>

Expand Down Expand Up @@ -156,6 +156,6 @@ class KyotoDictIterator : public IteratorUCharString {

}

#endif /* USE_KYOTO */
#endif /* HAVE_KYOTO */

#endif /* KYOTODICTIONARY_H_ */
2 changes: 1 addition & 1 deletion hdt-lib/src/hdt/BasicHDT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ void BasicHDT::mapHDT(const char *fileNameChar, ProgressListener *listener) {
std::string suffix = fileStr.substr(pos + 1);

if( suffix == "gz") {
#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
this->fileName.assign(fileStr.substr(0, pos));
ifstream test(fileName.c_str());
if(test.good()) {
Expand Down
8 changes: 4 additions & 4 deletions hdt-lib/src/rdf/RDFParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/

#include "RDFParser.hpp"
#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
#include "RDFParserRaptorCallback.hpp"
#endif
#include "RDFParserNtriples.hpp"
#include "RDFParserNtriplesCallback.hpp"
#ifdef HAVE_LIBSERD_0
#ifdef HAVE_SERD
#include "RDFParserSerd.hpp"
#endif

Expand All @@ -35,15 +35,15 @@ RDFParserPull *RDFParserPull::getParserPull(const char *fileName, RDFNotation no


RDFParserCallback *RDFParserCallback::getParserCallback(RDFNotation notation) {
#ifdef USE_SERD
#ifdef HAVE_SERD
if(notation==TURTLE) {
return new RDFParserSerd();
}
#endif
if(notation==NTRIPLES) {
return new RDFParserNtriplesCallback();
} else {
#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
return new RDFParserRaptorCallback();
#else
throw "No Parser available for input RDF Format";
Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/src/rdf/RDFParserRaptorCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: mck
*/

#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
#include "RDFParserRaptorCallback.hpp"
#include "../util/fileUtil.hpp"

Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/src/rdf/RDFParserRaptorCallback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef RDFPARSERRAPTORCALLBACK_H_
#define RDFPARSERRAPTORCALLBACK_H_

#ifdef HAVE_LIBRAPTOR2
#ifdef HAVE_RAPTOR

#include <stdint.h>

Expand Down
4 changes: 2 additions & 2 deletions hdt-lib/src/rdf/RDFParserSerd.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#ifdef USE_SERD
#ifdef HAVE_SERD


#include "../util/fileUtil.hpp"
Expand Down Expand Up @@ -117,7 +117,7 @@ SerdStatus hdtserd_end(void* handle, const SerdNode* node) {



RDFParserSerd::RDFParserSerd()
RDFParserSerd::RDFParserSerd() : numByte(0)
{
}

Expand Down
4 changes: 2 additions & 2 deletions hdt-lib/src/rdf/RDFParserSerd.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef RDFPARSERSERD_HPP
#define RDFPARSERSERD_HPP

#ifdef HAVE_LIBSERD_0
#ifdef HAVE_SERD

#include <stdint.h>

Expand All @@ -19,7 +19,7 @@ class RDFParserSerd : public RDFParserCallback {
SerdEnv *env;
RDFCallback *callback;
string error;
uint64_t numByte=0;
uint64_t numByte;

string getString(const SerdNode *term);
string getStringObject(const SerdNode *term, const SerdNode *dataType, const SerdNode *lang);
Expand Down
6 changes: 3 additions & 3 deletions hdt-lib/src/rdf/RDFSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "RDFSerializer.hpp"
#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
#include "RDFSerializerRaptor.hpp"
#endif
#include "RDFSerializerNTriples.hpp"
Expand All @@ -15,7 +15,7 @@ namespace hdt {

RDFSerializer *RDFSerializer::getSerializer(std::ostream &out, RDFNotation notation) {

#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
return new RDFSerializerRaptor(out, notation);
#else
if(notation==NTRIPLES) {
Expand All @@ -28,7 +28,7 @@ RDFSerializer *RDFSerializer::getSerializer(std::ostream &out, RDFNotation notat

RDFSerializer *RDFSerializer::getSerializer(const char *fileName, RDFNotation notation) {

#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
return new RDFSerializerRaptor(fileName, notation);
#else
if(notation==NTRIPLES) {
Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/src/rdf/RDFSerializerRaptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: mck
*/

#ifdef USE_RAPTOR
#ifdef HAVE_RAPTOR
#include "RDFSerializerRaptor.hpp"

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/src/rdf/RDFSerializerRaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef RDFSERIALIZERRAPTOR_H_
#define RDFSERIALIZERRAPTOR_H_

#ifdef HAVE_LIBRAPTOR2
#ifdef HAVE_RAPTOR
#include <raptor2/raptor2.h>

#include "RDFSerializer.hpp"
Expand Down
4 changes: 2 additions & 2 deletions hdt-lib/src/triples/TriplesKyoto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#include "../util/Histogram.h"

#ifdef USE_KYOTO
#ifdef HAVE_KYOTO

namespace hdt {

Expand Down Expand Up @@ -295,4 +295,4 @@ TripleID *TriplesKyotoIterator::next() {

}

#endif /* USE_KYOTO */
#endif /* HAVE_KYOTO */
4 changes: 2 additions & 2 deletions hdt-lib/src/triples/TriplesKyoto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "TriplesComparator.hpp"
#include "../libdcs/CSD.h"

#ifdef HAVE_LIBKYOTOCABINET
#ifdef HAVE_KYOTO

#include <kcpolydb.h>

Expand Down Expand Up @@ -204,7 +204,7 @@ class TriplesKyotoIterator : public IteratorTripleID {

}

#endif /* USE_KYOTO */
#endif /* HAVE_KYOTO */

#endif /* TRIPLESKYOTO_H_ */

10 changes: 5 additions & 5 deletions hdt-lib/src/util/fileUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <sys/stat.h>
#include "fileUtil.hpp"

#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif

Expand Down Expand Up @@ -64,7 +64,7 @@ uint64_t fileUtil::getSize(const char *file) {

void fileUtil::decompress(const char *input, const char * output, hdt::ProgressListener *listener) {

#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
#ifdef WIN32
const size_t CHUNK=64*1024;
#else
Expand Down Expand Up @@ -159,7 +159,7 @@ void fileUtil::decompress(const char *input, const char * output, hdt::ProgressL

DecompressStream::DecompressStream(const char *fileName) : filePipe(NULL), fileStream(NULL), in(NULL) {

#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
gzStream = NULL;
#endif
string fn = fileName;
Expand All @@ -168,7 +168,7 @@ DecompressStream::DecompressStream(const char *fileName) : filePipe(NULL), fileS

#ifdef WIN32
if( suffix == "gz") {
#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
in = gzStream = new igzstream(fileName);
#else
throw "Support for GZIP was not compiled in this version. Please Decompress the file before importing it.";
Expand Down Expand Up @@ -208,7 +208,7 @@ DecompressStream::DecompressStream(const char *fileName) : filePipe(NULL), fileS
void DecompressStream::close() {
if(fileStream) fileStream->close();
if(filePipe) pclose(filePipe);
#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
if(gzStream) gzStream->close();
#endif
delete in;
Expand Down
2 changes: 1 addition & 1 deletion hdt-lib/third/gzstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
namespace GZSTREAM_NAMESPACE {
#endif

#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
// ----------------------------------------------------------------------------
// Internal classes to implement gzstream. See header file for user classes.
// ----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions hdt-lib/tools/hdtInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char **argv) {


try {
#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
igzstream *inGz;
#endif
ifstream *inF;
Expand All @@ -92,7 +92,7 @@ int main(int argc, char **argv) {
std::string pipeCommand;

if( suffix == "gz"){
#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
in = inGz = new igzstream(inputFile.c_str());
#else
throw "Support for GZIP was not compiled in this version. Please Decompress the file before importing it.";
Expand All @@ -118,7 +118,7 @@ int main(int argc, char **argv) {
header->load(*in, controlInformation);

if( suffix == "gz") {
#ifdef USE_LIBZ
#ifdef HAVE_LIBZ
inGz->close();
#endif
} else {
Expand Down

0 comments on commit b1e82b9

Please sign in to comment.