diff --git a/src/archiver.cpp b/src/archiver.cpp index 8856a4eedf8d0df4ed475587fd909cf98f3199f2..42da971590597d1c2580940b61feaf07cd824de7 100644 --- a/src/archiver.cpp +++ b/src/archiver.cpp @@ -348,12 +348,13 @@ static ArchivePtr createArchiveDiskWriter() { archive_write_free(a); }}; } - +#endif //========================== std::vector<std::string> listArchiveContent(const std::string &archivePath) { std::vector<std::string> fileNames; +#ifdef ENABLE_PLUGIN ArchivePtr archiveReader = createArchiveReader(); struct archive_entry* entry; int r; @@ -371,12 +372,13 @@ std::vector<std::string> listArchiveContent(const std::string &archivePath) std::string fileEntry = archive_entry_pathname(entry) ? archive_entry_pathname(entry) : "Undefined"; fileNames.push_back(fileEntry); } - +#endif return fileNames; } void uncompressArchive(const std::string &archivePath, const std::string &dir, const FileMatchPair& f) { +#ifdef ENABLE_PLUGIN int r; ArchivePtr archiveReader = createArchiveReader(); @@ -452,11 +454,14 @@ void uncompressArchive(const std::string &archivePath, const std::string &dir, c } } } +#endif } std::vector<uint8_t> readFileFromArchive(const std::string &archivePath, const std::string &fileRelativePathName) { + std::vector<uint8_t> fileContent; +#ifdef ENABLE_PLUGIN long r; ArchivePtr archiveReader = createArchiveReader(); struct archive_entry* entry; @@ -489,7 +494,6 @@ std::vector<uint8_t> readFileFromArchive(const std::string &archivePath, if(fileEntry == fileRelativePathName){ // Copying the data content DataBlock db; - std::vector<uint8_t> fileContent; while(true) { r = readDataBlock(archiveReader,db); @@ -513,7 +517,8 @@ std::vector<uint8_t> readFileFromArchive(const std::string &archivePath, } } throw std::runtime_error("File " + fileRelativePathName + " not found in the archive"); +#endif + return fileContent; } -#endif //ENABLE_PLUGIN }} // namespace jami::archiver diff --git a/src/archiver.h b/src/archiver.h index 0ff8ad1b79fb43e8bf7872f7473962b81fce3546..6747934b1a3e0318bd13767b342ebac5907d8c3e 100644 --- a/src/archiver.h +++ b/src/archiver.h @@ -88,7 +88,6 @@ std::vector<uint8_t> decompressGzip(const std::string& path); */ gzFile openGzip(const std::string& path, const char *mode); -#ifdef ENABLE_PLUGIN /** * @brief listArchiveContent * @param archivePath @@ -120,7 +119,6 @@ void uncompressArchive(const std::string& path, const std::string &dir, const Fi */ std::vector<uint8_t> readFileFromArchive(const std::string &path, const std::string &fileRelativePathName); -#endif //ENABLE_PLUGIN } } // namespace jami diff --git a/src/plugin/jamipluginmanager.cpp b/src/plugin/jamipluginmanager.cpp index 2b879a0158be9820c0e8bf15827f7003a659b235..e2f9eda6aedd5130209960d59121eccdda56baca 100644 --- a/src/plugin/jamipluginmanager.cpp +++ b/src/plugin/jamipluginmanager.cpp @@ -265,6 +265,7 @@ int JamiPluginManager::uninstallPlugin(const std::string &rootPath) bool JamiPluginManager::loadPlugin(const std::string &rootPath) { +#ifdef ENABLE_PLUGIN try { bool status = pm_.load(getPluginDetails(rootPath).at("soPath")); @@ -279,10 +280,13 @@ bool JamiPluginManager::loadPlugin(const std::string &rootPath) JAMI_ERR() << e.what(); return false; } +#endif + return false; } bool JamiPluginManager::unloadPlugin(const std::string &rootPath) { +#ifdef ENABLE_PLUGIN try { bool status = pm_.unload(getPluginDetails(rootPath).at("soPath")); @@ -297,6 +301,8 @@ bool JamiPluginManager::unloadPlugin(const std::string &rootPath) JAMI_ERR() << e.what(); return false; } +#endif + return false; } void JamiPluginManager::togglePlugin(const std::string &rootPath, bool toggle)