diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp')
-rw-r--r-- | contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp b/contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp index 668bb5f64d..e5eb9347f5 100644 --- a/contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp +++ b/contrib/libs/poco/Foundation/src/SharedLibrary_HPUX.cpp @@ -1,100 +1,100 @@ -// -// SharedLibrary_HPUX.cpp -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/SharedLibrary_HPUX.h" -#include <dl.h> - - -namespace Poco { - - -FastMutex SharedLibraryImpl::_mutex; - - -SharedLibraryImpl::SharedLibraryImpl() -{ - _handle = 0; -} - - -SharedLibraryImpl::~SharedLibraryImpl() -{ -} - - -void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) throw LibraryAlreadyLoadedException(path); - _handle = shl_load(path.c_str(), BIND_DEFERRED, 0); - if (!_handle) throw LibraryLoadException(path); - _path = path; -} - - -void SharedLibraryImpl::unloadImpl() -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) - { - shl_unload(_handle); - _handle = 0; - _path.clear(); - } -} - - -bool SharedLibraryImpl::isLoadedImpl() const -{ - return _handle != 0; -} - - -void* SharedLibraryImpl::findSymbolImpl(const std::string& name) -{ - FastMutex::ScopedLock lock(_mutex); - - void* result = 0; - if (_handle && shl_findsym(&_handle, name.c_str(), TYPE_UNDEFINED, &result) != -1) - return result; - else - return 0; -} - - -const std::string& SharedLibraryImpl::getPathImpl() const -{ - return _path; -} - - -std::string SharedLibraryImpl::suffixImpl() -{ -#if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) - return "d.sl"; -#else - return ".sl"; -#endif -} - - -bool SharedLibraryImpl::setSearchPathImpl(const std::string&) -{ - return false; -} - - -} // namespace Poco +// +// SharedLibrary_HPUX.cpp +// +// Library: Foundation +// Package: SharedLibrary +// Module: SharedLibrary +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/SharedLibrary_HPUX.h" +#include <dl.h> + + +namespace Poco { + + +FastMutex SharedLibraryImpl::_mutex; + + +SharedLibraryImpl::SharedLibraryImpl() +{ + _handle = 0; +} + + +SharedLibraryImpl::~SharedLibraryImpl() +{ +} + + +void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) +{ + FastMutex::ScopedLock lock(_mutex); + + if (_handle) throw LibraryAlreadyLoadedException(path); + _handle = shl_load(path.c_str(), BIND_DEFERRED, 0); + if (!_handle) throw LibraryLoadException(path); + _path = path; +} + + +void SharedLibraryImpl::unloadImpl() +{ + FastMutex::ScopedLock lock(_mutex); + + if (_handle) + { + shl_unload(_handle); + _handle = 0; + _path.clear(); + } +} + + +bool SharedLibraryImpl::isLoadedImpl() const +{ + return _handle != 0; +} + + +void* SharedLibraryImpl::findSymbolImpl(const std::string& name) +{ + FastMutex::ScopedLock lock(_mutex); + + void* result = 0; + if (_handle && shl_findsym(&_handle, name.c_str(), TYPE_UNDEFINED, &result) != -1) + return result; + else + return 0; +} + + +const std::string& SharedLibraryImpl::getPathImpl() const +{ + return _path; +} + + +std::string SharedLibraryImpl::suffixImpl() +{ +#if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) + return "d.sl"; +#else + return ".sl"; +#endif +} + + +bool SharedLibraryImpl::setSearchPathImpl(const std::string&) +{ + return false; +} + + +} // namespace Poco |