SET_TARGET_PROPERTIES(${TARGET_CSR_COMMON}
PROPERTIES
- COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=default" # TODO: visibility hidden
+ COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden"
SOVERSION ${API_VERSION}
VERSION ${VERSION}
)
#include "client/handle-ext.h"
#include "client/async-logic.h"
#include "client/canonicalize.h"
+#include "common/macros.h"
#include "common/types.h"
#include "common/cs-context.h"
#include "common/cs-detected.h"
#include "client/utils.h"
#include "client/handle.h"
+#include "common/macros.h"
#include "common/command-id.h"
#include "common/em-context.h"
#include "common/audit/logger.h"
#include "client/callback.h"
-#define API __attribute__((visibility("default")))
-
#define EXCEPTION_SAFE_START return Csr::Client::exceptionGuard([&]()->int {
#define EXCEPTION_SAFE_END });
#include "client/utils.h"
#include "client/handle.h"
+#include "common/macros.h"
#include "common/types.h"
#include "common/command-id.h"
#include "common/wp-context.h"
#include <cstring>
+#include "common/macros.h"
+
namespace Csr {
namespace Audit {
Trace
};
-class Logger {
+class API Logger {
public:
static void log(LogLevel level,
const std::string &file,
#include <memory>
#include <cstddef>
+#include "common/macros.h"
#include "common/serialization.h"
#include "common/types.h"
namespace Csr {
-class BinaryQueue : public IStream {
+class API BinaryQueue : public IStream {
public:
BinaryQueue() noexcept;
virtual ~BinaryQueue() = default;
#include <memory>
#include <mutex>
+#include "common/macros.h"
#include "common/socket.h"
#include "common/types.h"
#include "common/credential.h"
namespace Csr {
-class Connection {
+class API Connection {
public:
explicit Connection(Socket &&socket) noexcept;
virtual ~Connection() = default;
#include <string>
#include <sys/types.h>
+#include "common/macros.h"
+
namespace Csr {
-struct Credential {
+struct API Credential {
uid_t uid;
gid_t gid;
std::string label;
#include <string>
#include <memory>
-#include "common/icontext.h"
#include <csr-content-screening-types.h>
+#include "common/macros.h"
+#include "common/icontext.h"
+
namespace Csr {
struct CsContext;
using CsContextPtr = std::unique_ptr<CsContext>;
using CsContextShPtr = std::shared_ptr<CsContext>;
-struct CsContext : public IContext {
+struct API CsContext : public IContext {
enum class Key : int {
PopupMessage = 0x01, // string
#include <string>
#include <ctime>
-#include "common/iresult.h"
#include <csr-content-screening-types.h>
+#include "common/macros.h"
+#include "common/iresult.h"
+
namespace Csr {
class CsDetected;
using CsDetectedPtr = std::unique_ptr<CsDetected>;
-struct CsDetected : public IResult {
+struct API CsDetected : public IResult {
CsDetected() noexcept;
virtual ~CsDetected() = default;
#include <string>
+#include "common/macros.h"
#include "common/connection.h"
#include "common/binary-queue.h"
namespace Csr {
-class Dispatcher {
+class API Dispatcher {
public:
Dispatcher(SockId) noexcept;
virtual ~Dispatcher() = default;
*/
#pragma once
-#include "common/icontext.h"
#include <csr-engine-manager.h>
+#include "common/macros.h"
+#include "common/icontext.h"
+
namespace Csr {
struct EmContext;
using EmContextShPtr = std::shared_ptr<EmContext>;
-struct EmContext : public IContext {
+struct API EmContext : public IContext {
enum class Key : int {
EngineId = 0x01 // int
};
#include <csr-error.h>
#include "common/audit/logger.h"
+#include "common/macros.h"
namespace Csr {
-class Exception : public std::exception {
+class API Exception : public std::exception {
public:
Exception(int ec, const char *file, const char *function, unsigned int line,
const std::string &message) noexcept;
#include <string>
#include <ctime>
+#include "common/macros.h"
+
namespace Csr {
// set/get key-value pairs. Key should be defined in each derived classes
-class KvpContainer {
+class API KvpContainer {
public:
virtual ~KvpContainer() = default;
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+/*
+ * @file macros.h
+ * @author Kyungwook Tak (k.tak@samsung.com)
+ * @version 1.0
+ * @brief Preprocessor macros
+ */
+#pragma once
+
+#define API __attribute__((visibility("default")))
#include <mutex>
#include <unordered_map>
+#include "common/macros.h"
+
namespace Csr {
-class Mainloop {
+class API Mainloop {
public:
- typedef std::function<void(uint32_t event)> Callback;
+ using Callback = std::function<void(uint32_t event)>;
Mainloop();
virtual ~Mainloop();
#include <set>
#include <memory>
-#include "common/command-id.h"
#include <csr-error.h>
+#include "common/macros.h"
+#include "common/command-id.h"
+
namespace Csr {
// Abstract data stream buffer
};
// Serializable interface
-class ISerializable {
+class API ISerializable {
public:
ISerializable() {}
ISerializable(IStream &) {}
#include <functional>
#include <set>
+#include "common/macros.h"
#include "common/connection.h"
#include "common/mainloop.h"
#include "common/socket-descriptor.h"
using ConnCallback = std::function<void(const ConnShPtr &)>;
-class Service {
+class API Service {
public:
Service();
virtual ~Service() = default;
#include <map>
#include <string>
+#include "common/macros.h"
+
namespace Csr {
enum class SockId : int {
POPUP = 0x04, // Popup service
};
-struct SocketDescriptor {
+struct API SocketDescriptor {
const std::string path;
const std::string privilege;
const std::string label;
const std::string &label);
};
+API
const SocketDescriptor &getSockDesc(const SockId &);
}
#include <string>
+#include "common/macros.h"
#include "common/types.h"
#include "common/socket-descriptor.h"
namespace Csr {
-class Socket {
+class API Socket {
public:
// Socket with accepted / connected
Socket(SockId sockId, int fd);
#include <string>
#include <memory>
-#include "common/icontext.h"
#include <csr-web-protection-types.h>
+#include "common/macros.h"
+#include "common/icontext.h"
+
namespace Csr {
struct WpContext;
using WpContextPtr = std::unique_ptr<WpContext>;
using WpContextShPtr = std::shared_ptr<WpContext>;
-struct WpContext : public IContext {
+struct API WpContext : public IContext {
enum class Key : int {
PopupMessage = 0x01, // string
AskUser = 0x10, // int
#include <string>
-#include "common/iresult.h"
#include <csr-web-protection-types.h>
+#include "common/macros.h"
+#include "common/iresult.h"
+
namespace Csr {
-struct WpResult : public IResult {
+struct API WpResult : public IResult {
WpResult() noexcept;
virtual ~WpResult() = default;
*/
#pragma once
-#include "common/socket-descriptor.h"
#include "common/connection.h"
+#include "common/socket-descriptor.h"
namespace Csr {