visibility support sandbox/denis13/visibility
authorDenis Khalikov <d.khalikov@partner.samsung.com>
Tue, 29 Nov 2016 09:48:58 +0000 (12:48 +0300)
committerDenis Khalikov <d.khalikov@partner.samsung.com>
Tue, 29 Nov 2016 09:48:58 +0000 (12:48 +0300)
24 files changed:
packaging/sensord.spec
src/client/client_common.h
src/client/command_channel.h
src/client/dbus_listener.h
src/client/external_data_channel.h
src/client/external_sensor_manager.h
src/client/reg_event_info.h
src/client/sensor_callback_deliverer.h
src/client/sensor_client_info.h
src/client/sensor_event_listener.h
src/client/sensor_handle_info.h
src/client/sensor_info_manager.h
src/client/sensor_internal.h
src/client/sensor_internal_deprecated.h
src/hal/sensor_hal.h
src/shared/cbase_lock.h
src/shared/cmutex.h
src/shared/command_common.h
src/shared/cpacket.h
src/shared/csocket.h
src/shared/poller.h
src/shared/sensor_common.h
src/shared/sensor_info.h
src/shared/sensor_log.h

index fe4facfd7a3e6fd962485a83453531989cd98cf8..64c72bf7315aa136979f644019385712a7749a72 100644 (file)
@@ -65,6 +65,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{ver
        -DARCH=%{BUILD_ARCH}
 
 %build
+export CFLAGS+=" -fvisibility=hidden "
 make %{?jobs:-j%jobs}
 
 %install
index 56719870c53ffe60f671522db968cedc84299ece..8e6e9203250a901d7a9c90b3b4b2fa2f20eed395 100644 (file)
@@ -44,16 +44,16 @@ typedef struct {
        void *accuracy_user_data;
 } client_callback_info;
 
-const char *get_sensor_name(sensor_id_t sensor_id);
-const char *get_event_name(unsigned int event_type);
+__attribute__ ((visibility("default"))) const char *get_sensor_name(sensor_id_t sensor_id);
+__attribute__ ((visibility("default"))) const char *get_event_name(unsigned int event_type);
 
-unsigned int get_calibration_event_type(unsigned int event_type);
-unsigned int get_log_per_count(sensor_id_t id);
+__attribute__ ((visibility("default"))) unsigned int get_calibration_event_type(unsigned int event_type);
+__attribute__ ((visibility("default"))) unsigned int get_log_per_count(sensor_id_t id);
 
-void print_event_occurrence_log(sensor_handle_info &sensor_handle_info);
+__attribute__ ((visibility("default"))) void print_event_occurrence_log(sensor_handle_info &sensor_handle_info);
 
 class sensor_info;
-sensor_info *sensor_to_sensor_info(sensor_t sensor);
-sensor_t sensor_info_to_sensor(const sensor_info *info);
+__attribute__ ((visibility("default"))) sensor_info *sensor_to_sensor_info(sensor_t sensor);
+__attribute__ ((visibility("default"))) sensor_t sensor_info_to_sensor(const sensor_info *info);
 
 #endif /* _CLIENT_COMMON_H_ */
index 0a9cbc4b1d7f8f1fa6d4b714111084d1b2b8dda3..54957f5b33e05041f8dc9c0be6922661b1868997 100644 (file)
@@ -25,7 +25,7 @@
 #include <cpacket.h>
 #include <csocket.h>
 
-class command_channel {
+class __attribute__ ((visibility("default"))) command_channel {
 public:
        command_channel();
        ~command_channel();
index 3d4a80460d1353cb23fc7dddd35da0ef39c0bb08..133465610eef31ceabf4ab70bc849d2fd196fff9 100644 (file)
@@ -24,7 +24,7 @@
 #include <gio/gio.h>
 #include <cmutex.h>
 
-class dbus_listener {
+class __attribute__ ((visibility("default"))) dbus_listener {
 public:
        static void init(void);
 
index 19a2a41a34157f9bef169cb678b081a86d97c356..0ead93532fb567567063dd3650baf632a7abf189 100644 (file)
@@ -25,7 +25,7 @@
 
 class cpacket;
 
-class external_data_channel {
+class __attribute__ ((visibility("default"))) external_data_channel {
 public:
        external_data_channel();
        ~external_data_channel();
index 9259c2cd62accffbab03473d47751008e3dbbbba..f1b96328861f3307efbc0116c6e2b35a440980a4 100644 (file)
@@ -33,7 +33,7 @@
 class external_data_channel;
 class poller;
 
-class sensor_ext_handle_info {
+class __attribute__ ((visibility("default"))) sensor_ext_handle_info {
 public:
        int m_handle;
        sensor_id_t m_sensor;
@@ -51,7 +51,7 @@ typedef struct {
        void *user_data;
 } command_cb_info;
 
-class external_sensor_manager {
+class __attribute__ ((visibility("default"))) external_sensor_manager {
 public:
        typedef void (*hup_observer_t)(void);
 
index 1f65f1d8c26a291b2723486e1de7e2a3c731d245..a8886c66da536a6b17cceab9ed32fbae58b333ab 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <sensor_common.h>
 
-class reg_event_info {
+class __attribute__ ((visibility("default"))) reg_event_info {
 public:
        unsigned long long m_id;
        int m_handle;
index db2145df0652e6abef70aee38a155dea30d14e1b..6c02e38b188254a9c9944c00569f426cf511f415 100644 (file)
@@ -26,7 +26,7 @@
 #include <thread>
 #include <atomic>
 
-class sensor_callback_deliverer {
+class __attribute__ ((visibility("default"))) sensor_callback_deliverer {
 public:
        sensor_callback_deliverer();
        ~sensor_callback_deliverer();
index 905d682cf2b3a79f1408c527ed5017445606207f..9abe0fae44586c114873b7d21180982d64096a9b 100644 (file)
@@ -38,7 +38,7 @@ typedef std::vector<sensor_id_t> sensor_id_vector;
 typedef std::unordered_map<int, sensor_handle_info> sensor_handle_info_map;
 typedef std::unordered_map<sensor_id_t, command_channel *> sensor_command_channel_map;
 
-typedef struct sensor_rep {
+typedef struct __attribute__ ((visibility("default"))) sensor_rep {
        bool active;
        int pause_policy;
        unsigned int interval;
@@ -46,7 +46,7 @@ typedef struct sensor_rep {
        event_type_vector event_types;
 } sensor_rep;
 
-class sensor_client_info {
+class __attribute__ ((visibility("default"))) sensor_client_info {
 public:
        static sensor_client_info& get_instance(void);
        int create_handle(sensor_id_t sensor_id);
index 63dd6d9fbc3e4866fb141eb7384de5b60115baa6..78be24212bf3351815bc83d99f36170e38ab7d70 100644 (file)
@@ -50,7 +50,7 @@ typedef std::unordered_map<sensor_id_t, command_channel*> sensor_command_channel
 
 typedef void (*hup_observer_t)(void);
 
-class sensor_event_listener {
+class __attribute__ ((visibility("default"))) sensor_event_listener {
 public:
        static sensor_event_listener& get_instance(void);
 
index 70cf5c97087cb5c4ce77bae5401c3e214ad4e7b6..d41e82f96d5d06e85542c607225104a0e9624868 100644 (file)
@@ -28,7 +28,7 @@
 #include <string>
 #include <map>
 
-class attribute_info {
+class __attribute__ ((visibility("default"))) attribute_info {
 public:
        attribute_info();
        ~attribute_info();
@@ -47,7 +47,7 @@ typedef std::unordered_map<unsigned int, reg_event_info> event_info_map;
 typedef std::map<int, int> sensor_attribute_int_map;
 typedef std::map<int, attribute_info *> sensor_attribute_str_map;
 
-class sensor_handle_info {
+class __attribute__ ((visibility("default"))) sensor_handle_info {
 public:
        sensor_handle_info();
        ~sensor_handle_info();
index 86fa8fed35cc557107660ae2f2d3644b24e6817e..be397c96aa001ac3d830fa8dace65963a867b2d2 100644 (file)
@@ -26,7 +26,7 @@
 #include <unordered_map>
 #include <unordered_set>
 
-class sensor_info_manager {
+class __attribute__ ((visibility("default"))) sensor_info_manager {
 public:
        static sensor_info_manager& get_instance(void);
        const sensor_info* get_info(sensor_type_t type);
index 47452d48897193d1d0326eb9f2975ae066fc1dcd..ad458c96610f339ddd023b72df72f436631f6249 100644 (file)
@@ -50,7 +50,7 @@ typedef void (*sensor_accuracy_changed_cb_t) (sensor_t sensor, unsigned long lon
  * @param[out] sensor count the count of sensors contained in the list.
  * @return true on success, otherwise false.
  */
-bool sensord_get_sensor_list(sensor_type_t type, sensor_t **list, int *sensor_count);
+__attribute__ ((visibility("default"))) bool sensord_get_sensor_list(sensor_type_t type, sensor_t **list, int *sensor_count);
 
 /**
  * @brief Get the default sensor for a given type.
@@ -58,7 +58,7 @@ bool sensord_get_sensor_list(sensor_type_t type, sensor_t **list, int *sensor_co
  * @param[in] type the type of a sensor requested.
  * @return the default sensor matching the asked type on success, otherwise NULL.
  */
-sensor_t sensord_get_sensor(sensor_type_t type);
+__attribute__ ((visibility("default"))) sensor_t sensord_get_sensor(sensor_type_t type);
 
 /**
  * @brief Get the list of available sensors of a certain type,  use ALL_SENSOR to get all the sensors.
@@ -72,7 +72,7 @@ sensor_t sensord_get_sensor(sensor_type_t type);
  * @retval -EACCES Permission denied
  * @retval -ENODATA NO sensor available
  */
-int sensord_get_sensors(sensor_type_t type, sensor_t **list, int *sensor_count);
+__attribute__ ((visibility("default"))) int sensord_get_sensors(sensor_type_t type, sensor_t **list, int *sensor_count);
 
 /**
  * @brief Get the default sensor for a given type.
@@ -84,7 +84,7 @@ int sensord_get_sensors(sensor_type_t type, sensor_t **list, int *sensor_count);
  * @retval -EPERM Operation not permitted
  * @retval -EACCES Permission denied
  */
-int sensord_get_default_sensor(sensor_type_t type, sensor_t *sensor);
+__attribute__ ((visibility("default"))) int sensord_get_default_sensor(sensor_type_t type, sensor_t *sensor);
 
 /**
  * @brief Get the type of this sensor.
@@ -93,7 +93,7 @@ int sensord_get_default_sensor(sensor_type_t type, sensor_t *sensor);
  * @param[out] type the type of this sensor.
  * @return return true on success, otherwise false.
  */
-bool sensord_get_type(sensor_t sensor, sensor_type_t *type);
+__attribute__ ((visibility("default"))) bool sensord_get_type(sensor_t sensor, sensor_type_t *type);
 
 /**
  * @brief Get the name string of this sensor.
@@ -101,7 +101,7 @@ bool sensord_get_type(sensor_t sensor, sensor_type_t *type);
  * @param[in] sensor a sensor to get name.
  * @return the name string of this sensor on success, otherwise NULL.
  */
-const char* sensord_get_name(sensor_t sensor);
+__attribute__ ((visibility("default"))) const char* sensord_get_name(sensor_t sensor);
 
 /**
  * @brief Get the vendor string of this sensor.
@@ -109,7 +109,7 @@ const char* sensord_get_name(sensor_t sensor);
  * @param[in] sensor a sensor to get vendor.
  * @return the vendor string of this sensor on success, otherwise NULL.
  */
-const char* sensord_get_vendor(sensor_t sensor);
+__attribute__ ((visibility("default"))) const char* sensord_get_vendor(sensor_t sensor);
 
 /**
  * @brief Get the privilege of this sensor.
@@ -118,7 +118,7 @@ const char* sensord_get_vendor(sensor_t sensor);
  * @param[out] privilege the privilege of this sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_get_privilege(sensor_t sensor, sensor_privilege_t *privilege);
+__attribute__ ((visibility("default"))) bool sensord_get_privilege(sensor_t sensor, sensor_privilege_t *privilege);
 
 /**
  * @brief Get the minimum range of this sensor in the sensor's unit.
@@ -127,7 +127,7 @@ bool sensord_get_privilege(sensor_t sensor, sensor_privilege_t *privilege);
  * @param[out] min_range the minimum range of this sensor in the sensor's unit.
  * @return true on success, otherwise false.
  */
-bool sensord_get_min_range(sensor_t sensor, float *min_range);
+__attribute__ ((visibility("default"))) bool sensord_get_min_range(sensor_t sensor, float *min_range);
 
 /**
  * @brief Get the maximum range of this sensor in the sensor's unit.
@@ -136,7 +136,7 @@ bool sensord_get_min_range(sensor_t sensor, float *min_range);
  * @param[out] max_range the maximum range of this sensor in the sensor's unit.
  * @return true on success, otherwise false.
  */
-bool sensord_get_max_range(sensor_t sensor, float *max_range);
+__attribute__ ((visibility("default"))) bool sensord_get_max_range(sensor_t sensor, float *max_range);
 
 /**
  * @brief Get the resolution of this sensor in the sensor's unit.
@@ -145,7 +145,7 @@ bool sensord_get_max_range(sensor_t sensor, float *max_range);
  * @param[out] resolution the resolution of this sensor in the sensor's unit.
  * @return true on success, otherwise false.
  */
-bool sensord_get_resolution(sensor_t sensor, float *resolution);
+__attribute__ ((visibility("default"))) bool sensord_get_resolution(sensor_t sensor, float *resolution);
 
 /**
  * @brief Get the minimum interval allowed between two events in microsecond or zero if this sensor only returns a value when the data it's measuring changes.
@@ -154,7 +154,7 @@ bool sensord_get_resolution(sensor_t sensor, float *resolution);
  * @param[out] min_interval the minimum interval of this sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_get_min_interval(sensor_t sensor, int *min_interval);
+__attribute__ ((visibility("default"))) bool sensord_get_min_interval(sensor_t sensor, int *min_interval);
 
 /**
  * @brief Get the number of events reserved for this sensor in the batch mode FIFO.
@@ -163,7 +163,7 @@ bool sensord_get_min_interval(sensor_t sensor, int *min_interval);
  * @param[out] fifo_count the number of events reserved for this sensor in the batch mode FIFO
  * @return true on success, otherwise false
  */
-bool sensord_get_fifo_count(sensor_t sensor, int *fifo_count);
+__attribute__ ((visibility("default"))) bool sensord_get_fifo_count(sensor_t sensor, int *fifo_count);
 
 /**
  * @brief Get the maximum number of events of this sensor that could be batched. If this value is zero it indicates that batch mode is not supported for this sensor.
@@ -172,7 +172,7 @@ bool sensord_get_fifo_count(sensor_t sensor, int *fifo_count);
  * @param[out] max_batch_count the maximum number of events of this sensor that could be batched.
  * @return true on success, otherwise false.
  */
-bool sensord_get_max_batch_count(sensor_t sensor, int *max_batch_count);
+__attribute__ ((visibility("default"))) bool sensord_get_max_batch_count(sensor_t sensor, int *max_batch_count);
 
 /**
  * @brief Get the supported event types of this sensor.
@@ -182,7 +182,7 @@ bool sensord_get_max_batch_count(sensor_t sensor, int *max_batch_count);
  * @param[out] count the count of the supported event types of this sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_get_supported_event_types(sensor_t sensor, unsigned int **event_types, int *count);
+__attribute__ ((visibility("default"))) bool sensord_get_supported_event_types(sensor_t sensor, unsigned int **event_types, int *count);
 
 /**
  * @brief Check a given event type is supporeted by this sensor.
@@ -192,7 +192,7 @@ bool sensord_get_supported_event_types(sensor_t sensor, unsigned int **event_typ
  * @param[out] supported whether a given event is supported or not in this sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_is_supported_event_type(sensor_t sensor, unsigned int event_type, bool *supported);
+__attribute__ ((visibility("default"))) bool sensord_is_supported_event_type(sensor_t sensor, unsigned int event_type, bool *supported);
 
 /**
  * @brief Check a wakeup supported or not by this sensor.
@@ -200,7 +200,7 @@ bool sensord_is_supported_event_type(sensor_t sensor, unsigned int event_type, b
  * @param[in] sensor a sensor to check a given event type is supporeted.
  * @return true on success, otherwise false.
  */
-bool sensord_is_wakeup_supported(sensor_t sensor);
+__attribute__ ((visibility("default"))) bool sensord_is_wakeup_supported(sensor_t sensor);
 
 /**
  * @brief Connect a given sensor and get a handle of a given sensor.
@@ -208,7 +208,7 @@ bool sensord_is_wakeup_supported(sensor_t sensor);
  * @param[in] sensor a sensor to connect
  * @return a handle of a given sensor on success, otherwise negative value
  */
-int sensord_connect(sensor_t sensor);
+__attribute__ ((visibility("default"))) int sensord_connect(sensor_t sensor);
 
 /**
  * @brief Disconnect a given sensor.
@@ -216,7 +216,7 @@ int sensord_connect(sensor_t sensor);
  * @param[in] handle a handle to disconnect.
  * @return true on success, otherwise false.
  */
-bool sensord_disconnect(int handle);
+__attribute__ ((visibility("default"))) bool sensord_disconnect(int handle);
 
 /**
  * @brief Register a callback with a connected sensor for a given event_type. This callback will be called when a given event occurs in a connected sensor.
@@ -230,7 +230,7 @@ bool sensord_disconnect(int handle);
  * @param[in] user_data the callback is called with user_data
  * @return true on success, otherwise false.
  */
-bool sensord_register_event(int handle, unsigned int event_type, unsigned int interval, unsigned int max_batch_latency, sensor_cb_t cb, void *user_data);
+__attribute__ ((visibility("default"))) bool sensord_register_event(int handle, unsigned int event_type, unsigned int interval, unsigned int max_batch_latency, sensor_cb_t cb, void *user_data);
 
 /**
  * @brief Register a callback with a connected context sensor for a given event_type. This callback will be called when a given event occurs in a connected context sensor.
@@ -244,7 +244,7 @@ bool sensord_register_event(int handle, unsigned int event_type, unsigned int in
  * @param[in] user_data the callback is called with user_data
  * @return true on success, otherwise false.
  */
-bool sensord_register_hub_event(int handle, unsigned int event_type, unsigned int interval, unsigned int max_batch_latency, sensorhub_cb_t cb, void *user_data);
+__attribute__ ((visibility("default"))) bool sensord_register_hub_event(int handle, unsigned int event_type, unsigned int interval, unsigned int max_batch_latency, sensorhub_cb_t cb, void *user_data);
 
 /**
  * @brief Unregister a event with a connected sensor.  After unregistering, that event will not be sent.
@@ -253,7 +253,7 @@ bool sensord_register_hub_event(int handle, unsigned int event_type, unsigned in
  * @param[in] event_type an event type to unregister.
  * @return true on success, otherwise false.
  */
-bool sensord_unregister_event(int handle, unsigned int event_type);
+__attribute__ ((visibility("default"))) bool sensord_unregister_event(int handle, unsigned int event_type);
 
 /**
  * @brief Register a callback with a connected sensor. This callback will be called when the accuracy of a sensor has changed.
@@ -263,7 +263,7 @@ bool sensord_unregister_event(int handle, unsigned int event_type);
  * @param[in] user_data the callback is called with user_data
  * @return true on success, otherwise false.
  */
-bool sensord_register_accuracy_cb(int handle, sensor_accuracy_changed_cb_t cb, void *user_data);
+__attribute__ ((visibility("default"))) bool sensord_register_accuracy_cb(int handle, sensor_accuracy_changed_cb_t cb, void *user_data);
 
 /**
  * @brief Unregister a callback with a connected sensor.  After unregistering,  sensor_accuray_change_cb will not be called.
@@ -271,7 +271,7 @@ bool sensord_register_accuracy_cb(int handle, sensor_accuracy_changed_cb_t cb, v
  * @param[in] handle a handle represensting a connected sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_unregister_accuracy_cb(int handle);
+__attribute__ ((visibility("default"))) bool sensord_unregister_accuracy_cb(int handle);
 
 /**
  * @brief Start listening events with a connected sensor.
@@ -282,7 +282,7 @@ bool sensord_unregister_accuracy_cb(int handle);
  *                                with SENSOR_OPTION_ALWAYS_ON, it continues to listening events even when LCD is off or in power save mode.
  * @return true on success, otherwise false.
  */
-bool sensord_start(int handle, int option);
+__attribute__ ((visibility("default"))) bool sensord_start(int handle, int option);
 
 /**
  * @brief Stop listening events with a connected sensor.
@@ -290,7 +290,7 @@ bool sensord_start(int handle, int option);
  * @param[in] handle a handle represensting a connected sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_stop(int handle);
+__attribute__ ((visibility("default"))) bool sensord_stop(int handle);
 
 /**
  * @brief Change the interval of a specifed event type in a connected sensor.
@@ -301,7 +301,7 @@ bool sensord_stop(int handle);
  *                                   It can be one of SENSOR_INTERVAL_NORMAL,  SENSOR_INTERVAL_FASTEST or the interval in microseconds.
  * @return true on success, otherwise false.
  */
-bool sensord_change_event_interval(int handle, unsigned int event_type, unsigned int interval);
+__attribute__ ((visibility("default"))) bool sensord_change_event_interval(int handle, unsigned int event_type, unsigned int interval);
 
 /**
  * @brief Change the max batch latency of a specifed event type in a connected sensor.
@@ -311,7 +311,7 @@ bool sensord_change_event_interval(int handle, unsigned int event_type, unsigned
  * @param[in] max_batch_latency an event in the batch can be delayed by at most max_batch_latency microseconds. If this is set to zero, batch mode is disabled.
  * @return true on success, otherwise false.
  */
-bool sensord_change_event_max_batch_latency(int handle, unsigned int event_type, unsigned int max_batch_latency);
+__attribute__ ((visibility("default"))) bool sensord_change_event_max_batch_latency(int handle, unsigned int event_type, unsigned int max_batch_latency);
 
 /**
  * @brief Change the option of a connected sensor.
@@ -322,7 +322,7 @@ bool sensord_change_event_max_batch_latency(int handle, unsigned int event_type,
  *                                with SENSOR_OPTION_ALWAYS_ON, it continues to listening events even when LCD is off or in power save mode.
  * @return true on success, otherwise false.
  */
-bool sensord_set_option(int handle, int option);
+__attribute__ ((visibility("default"))) bool sensord_set_option(int handle, int option);
 
 /*
  * @brief Set the attribute to a connected sensor
@@ -335,7 +335,7 @@ bool sensord_set_option(int handle, int option);
  * @retval -EINVAL Invalid parameter
  * @retval -EPERM Operation not permitted
  */
-int sensord_set_attribute_int(int handle, int attribute, int value);
+__attribute__ ((visibility("default"))) int sensord_set_attribute_int(int handle, int attribute, int value);
 
 /**
  * @brief Set the attribute to a connected sensor
@@ -349,7 +349,7 @@ int sensord_set_attribute_int(int handle, int attribute, int value);
  * @retval -EINVAL Invalid parameter
  * @retval -EPERM Operation not permitted
  */
-int sensord_set_attribute_str(int handle, int attribute, const char *value, int len);
+__attribute__ ((visibility("default"))) int sensord_set_attribute_str(int handle, int attribute, const char *value, int len);
 
 /**
  * @brief Send data to sensorhub
@@ -359,8 +359,8 @@ int sensord_set_attribute_str(int handle, int attribute, const char *value, int
  * @param[in] data_len the length of data
  * @return true on success, otherwise false.
  */
-bool sensord_send_sensorhub_data(int handle, const char *data, int data_len);
-bool sensord_send_command(int handle, const char *command, int command_len);
+__attribute__ ((visibility("default"))) bool sensord_send_sensorhub_data(int handle, const char *data, int data_len);
+__attribute__ ((visibility("default"))) bool sensord_send_command(int handle, const char *command, int command_len);
 
 /**
  * @brief get sensor data from a connected sensor
@@ -370,7 +370,7 @@ bool sensord_send_command(int handle, const char *command, int command_len);
  * @param[out] sensor_data data from connected sensor
  * @return true on success, otherwise false.
  */
-bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* sensor_data);
+__attribute__ ((visibility("default"))) bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* sensor_data);
 
 /**
  * @brief flush sensor data from a connected sensor
@@ -378,15 +378,15 @@ bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* sensor_da
  * @param[in] handle a handle represensting a connected context sensor.
  * @return true on success, otherwise false.
  */
-bool sensord_flush(int handle);
+__attribute__ ((visibility("default"))) bool sensord_flush(int handle);
 
 typedef void (*sensor_external_command_cb_t)(int handle, const char* data, int data_cnt, void *user_data);
 
-int sensord_external_connect(const char *key, sensor_external_command_cb_t cb, void *user_data);
-bool sensord_external_disconnect(int handle);
-bool sensord_external_post(int handle, unsigned long long timestamp, const float* data, int data_cnt);
+__attribute__ ((visibility("default"))) int sensord_external_connect(const char *key, sensor_external_command_cb_t cb, void *user_data);
+__attribute__ ((visibility("default"))) bool sensord_external_disconnect(int handle);
+__attribute__ ((visibility("default"))) bool sensord_external_post(int handle, unsigned long long timestamp, const float* data, int data_cnt);
 
-bool sensord_set_passive_mode(int handle, bool passive);
+__attribute__ ((visibility("default"))) bool sensord_set_passive_mode(int handle, bool passive);
 /**
   * @}
  */
index a2b5b3082f66df8235419b08ca13895e653652a2..9cd53bfa385de4a19cdc6f2320fa49cdc27e82d8 100644 (file)
@@ -63,7 +63,7 @@ typedef struct {
  * @param[in] sensor_type your desired sensor type
  * @return if it succeed, it return handle value( >=0 ), otherwise negative value return
  */
-DEPRECATED int sf_connect(sensor_type_t sensor_type);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_connect(sensor_type_t sensor_type);
 
 /**
  * @fn int sf_disconnect(int handle)
@@ -71,7 +71,7 @@ DEPRECATED int sf_connect(sensor_type_t sensor_type);
  * @param[in] handle received handle value by sf_connect()
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_disconnect(int handle);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_disconnect(int handle);
 
 /**
  * @fn int sf_start(int handle, int option)
@@ -80,7 +80,7 @@ DEPRECATED int sf_disconnect(int handle);
  * @param[in] option With SENSOR_OPTION_DEFAULT, it stops to sense when LCD is off, and with SENSOR_OPTION_ALWAYS_ON, it continues to sense even when LCD is off
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_start(int handle, int option);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_start(int handle, int option);
 
 /**
  * @fn int sf_stop(int handle)
@@ -88,7 +88,7 @@ DEPRECATED int sf_start(int handle, int option);
  * @param[in] handle received handle value by sf_connect()
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_stop(int handle);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_stop(int handle);
 
 /**
  * @fn int sf_register_event(int handle, unsigned int event_type, event_conditon_t *event_condition, sensor_callback_func_t cb, void *user_data)
@@ -100,7 +100,7 @@ DEPRECATED int sf_stop(int handle);
  * @param[in] user_data        your option data that will be send when your define callback function called. if you don't have any option data, just use a NULL value
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_register_event(int handle, unsigned int event_type, event_condition_t *event_condition, sensor_callback_func_t cb, void *user_data);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_register_event(int handle, unsigned int event_type, event_condition_t *event_condition, sensor_callback_func_t cb, void *user_data);
 
 /**
  * @fn int sf_unregister_event(int handle, unsigned int event_type)
@@ -109,7 +109,7 @@ DEPRECATED int sf_register_event(int handle, unsigned int event_type, event_cond
  * @param[in] event_type your desired event_type that you want to unregister event
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_unregister_event(int handle, unsigned int event_type);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_unregister_event(int handle, unsigned int event_type);
 
 /**
  * @fn int sf_get_data(int handle, unsigned int data_id, sensor_data_t* values)
@@ -119,7 +119,7 @@ DEPRECATED int sf_unregister_event(int handle, unsigned int event_type);
  * @param[out] values return values
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_get_data(int handle, unsigned int data_id, sensor_data_t* values);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_get_data(int handle, unsigned int data_id, sensor_data_t* values);
 
 /**
  * @fn int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition)
@@ -129,7 +129,7 @@ DEPRECATED int sf_get_data(int handle, unsigned int data_id, sensor_data_t* valu
  * @param[in] event_condition your desired event condition that you want to change event
  * @return if it succeed, it return zero value, otherwise negative value return
  */
-DEPRECATED int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition);
 
 /**
  * @fn int sf_change_sensor_option(int handle, int option)
@@ -139,7 +139,7 @@ DEPRECATED int sf_change_event_condition(int handle, unsigned int event_type, ev
  * @return if it succeed, it return zero value, otherwise negative value return
  */
 
-DEPRECATED int sf_change_sensor_option(int handle, int option);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_change_sensor_option(int handle, int option);
 
 /**
  * @fn int sf_send_sensorhub_data(int handle, const char* buffer, int data_len)
@@ -149,9 +149,9 @@ DEPRECATED int sf_change_sensor_option(int handle, int option);
  * @param[in] data_len the length of data
  * @return if it succeed, it returns zero, otherwise negative value
  */
-DEPRECATED int sf_send_sensorhub_data(int handle, const char* data, int data_len);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_send_sensorhub_data(int handle, const char* data, int data_len);
 
-DEPRECATED int sf_check_rotation(unsigned long *rotation);
+__attribute__ ((visibility("default"))) DEPRECATED int sf_check_rotation(unsigned long *rotation);
 
 #ifdef __cplusplus
 }
index d90053ce9ebb7f3cf850dc9c057992700ea0bb6e..26790b525df3b7cf93bb307be7d411c4dad15035 100644 (file)
@@ -32,7 +32,7 @@ typedef int (*create_t)(sensor_device_t **devices);
  * Sensor device interface
  * 1 device must be abstracted from 1 device event node
  */
-class sensor_device {
+class __attribute__ ((visibility("default"))) sensor_device {
 public:
        virtual ~sensor_device() {}
 
index ad57562609ea0fffecf24aae2ca3b57c8dc0b7db..ccd175e1d9a12c7e23ac2efeb7acbd060b64f6b4 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <pthread.h>
 
-enum lock_type {
+enum __attribute__ ((visibility("default"))) lock_type {
        LOCK_TYPE_MUTEX,
        LOCK_TYPE_READ,
        LOCK_TYPE_WRITE,
@@ -46,7 +46,7 @@ enum lock_type {
 #define UNLOCK(x)      (x).unlock()
 #endif
 
-class cbase_lock {
+class __attribute__ ((visibility("default"))) cbase_lock {
 public:
        cbase_lock();
        virtual ~cbase_lock();
@@ -71,7 +71,7 @@ private:
        char m_owner_info[OWNER_INFO_LEN];
 };
 
-class Autolock {
+class __attribute__ ((visibility("default"))) Autolock {
 private:
        cbase_lock& m_lock;
 public:
index 94aa2b683a678fc6457014c75a371a926e772523..35c3bf005ed657d5695862109f80a7b0c094d2cd 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "cbase_lock.h"
 
-class cmutex : public cbase_lock {
+class __attribute__ ((visibility("default"))) cmutex : public cbase_lock {
 public:
        cmutex();
        virtual ~cmutex();
index 47c47b1890886a5dd627422de59265dcdada5f9e..a9a617b8842e97cbb473d5b22101a26202f8492f 100644 (file)
@@ -31,7 +31,7 @@
 #define MAX_HANDLE                     256
 #define MAX_HANDLE_REACHED     -2
 
-enum packet_type_t {
+enum __attribute__ ((visibility("default"))) packet_type_t {
        CMD_DONE = -1,
        CMD_NONE = 0,
        CMD_GET_ID,
@@ -52,7 +52,7 @@ enum packet_type_t {
        CMD_CNT,
 };
 
-enum ext_packet_type_t {
+enum __attribute__ ((visibility("default"))) ext_packet_type_t {
        CMD_EXT_DONE = -1,
        CMD_EXT_NONE = 0,
        CMD_EXT_GET_ID,
@@ -176,12 +176,12 @@ typedef struct {
        int client_id;
 } channel_ready_t;
 
-typedef struct external_command_header_t {
+typedef struct __attribute__ ((visibility("default"))) external_command_header_t {
        sensor_id_t sensor_id;
        int command_len;
 } external_command_header_t;
 
-typedef struct external_command_t {
+typedef struct __attribute__ ((visibility("default"))) external_command_t {
        external_command_header_t header;
        std::vector<char> command;
 } external_command_t;
index 64845e88fd967d005f910e918f24018d0dcb5743..eee7c00e5820884d7c4ce0aceb8b32a9d73d52b2 100644 (file)
 
 #include <stddef.h>
 
-typedef struct packet_header {
+typedef struct __attribute__ ((visibility("default"))) packet_header {
        int cmd;
        size_t size;
        char data[];
 } packet_header;
 
-class cpacket {
+class __attribute__ ((visibility("default"))) cpacket {
 public:
        cpacket();
        explicit cpacket(size_t size);
index 1391531a0a2b9b8a21c4cd42fe5ef0ef6201f8a0..d3585c966fe2b06a6a9ecf9247fbaa3e523f4a77 100644 (file)
@@ -28,7 +28,7 @@
 #include <fcntl.h>
 #include <sensor_log.h>
 
-class csocket {
+class __attribute__ ((visibility("default"))) csocket {
 public:
        csocket();
        virtual ~csocket();
index e61408d5d0f6362a5fa1e471b21390d691b7fac2..3f45f6bd6ce75e433a7b2f6dd6795ad376f1bd31 100644 (file)
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include <queue>
 
-class poller {
+class __attribute__ ((visibility("default"))) poller {
 public:
        poller();
        poller(int fd);
index d308549d1ff0cf91e47cc0528ff3000c351433a1..28f9587a9091463b123b3a8caa5ce12845ece02d 100644 (file)
@@ -64,7 +64,7 @@ typedef void *sensor_t;
  *     To prevent naming confliction as using same enums as sensor CAPI use
  */
 #ifndef __SENSOR_H__
-enum sensor_option_t {
+enum __attribute__ ((visibility("default"))) sensor_option_t {
        SENSOR_OPTION_DEFAULT = 0,
        SENSOR_OPTION_ON_IN_SCREEN_OFF = 1,
        SENSOR_OPTION_ON_IN_POWERSAVE_MODE = 2,
@@ -75,17 +75,17 @@ enum sensor_option_t {
 typedef enum sensor_option_t sensor_option_e;
 #endif
 
-enum sensord_attribute_e {
+enum __attribute__ ((visibility("default"))) sensord_attribute_e {
        SENSORD_ATTRIBUTE_AXIS_ORIENTATION = 1,
        SENSORD_ATTRIBUTE_PAUSE_POLICY,
 };
 
-enum sensord_axis_e {
+enum __attribute__ ((visibility("default"))) sensord_axis_e {
        SENSORD_AXIS_DEVICE_ORIENTED = 1,
        SENSORD_AXIS_DISPLAY_ORIENTED,
 };
 
-enum sensord_pause_e {
+enum __attribute__ ((visibility("default"))) sensord_pause_e {
        SENSORD_PAUSE_NONE = 0,
        SENSORD_PAUSE_ON_DISPLAY_OFF = 1,
        SENSORD_PAUSE_ON_POWERSAVE_MODE = 2,
@@ -93,7 +93,7 @@ enum sensord_pause_e {
        SENSORD_PAUSE_END,
 };
 
-enum poll_interval_t {
+enum __attribute__ ((visibility("default"))) poll_interval_t {
        POLL_100HZ_MS   = 10,
        POLL_50HZ_MS    = 20,
        POLL_25HZ_MS    = 40,
@@ -104,7 +104,7 @@ enum poll_interval_t {
        POLL_MAX_HZ_MS  = 255000,
 };
 
-enum sensor_interval_t {
+enum __attribute__ ((visibility("default"))) sensor_interval_t {
        SENSOR_INTERVAL_FASTEST = POLL_100HZ_MS,
        SENSOR_INTERVAL_NORMAL = POLL_5HZ_MS,
 };
@@ -116,7 +116,7 @@ typedef enum {
        CONDITION_LESS_THAN,
 } condition_op_t;
 
-enum sensor_state_t {
+enum __attribute__ ((visibility("default"))) sensor_state_t {
        SENSOR_STATE_UNKNOWN = -1,
        SENSOR_STATE_STOPPED = 0,
        SENSOR_STATE_STARTED = 1,
@@ -128,18 +128,18 @@ typedef enum {
        SENSOR_PRIVILEGE_INTERNAL,
 } sensor_privilege_t;
 
-enum sensor_permission_t {
+enum __attribute__ ((visibility("default"))) sensor_permission_t {
        SENSOR_PERMISSION_NONE = 0,
        SENSOR_PERMISSION_STANDARD = (1 << 0),
        SENSOR_PERMISSION_BIO = (1 << 1)
 };
 
-enum client_type_t {
+enum __attribute__ ((visibility("default"))) client_type_t {
        CLIENT_TYPE_SENSOR_CLIENT       = 1,
        CLIENT_TYPE_EXTERNAL_SOURCE,
 };
 
-typedef struct sensor_event_t {
+typedef struct __attribute__ ((visibility("default"))) sensor_event_t {
        unsigned int event_type;
        sensor_id_t sensor_id;
        unsigned int data_length;
index e2e9e57f79ca7e12b867e3c8b564cf9798cd75a8..c61e22175e6584f492ee238213896375dc1871ce 100644 (file)
@@ -29,7 +29,7 @@
 typedef std::vector<char> raw_data_t;
 typedef raw_data_t::iterator raw_data_iterator;
 
-class sensor_info {
+class __attribute__ ((visibility("default"))) sensor_info {
 public:
        sensor_type_t get_type(void);
        sensor_id_t get_id(void);
index 22d1d7dcad2d12fd1459f3de27cc4bbf4e16af5a..298fa17f4b79f2001d6603b887331674f14b5d47 100644 (file)
@@ -125,8 +125,8 @@ extern "C"
 {
 #endif
 
-const char* get_client_name(void);
-bool get_proc_name(pid_t pid, char *process_name);
+__attribute__ ((visibility("default"))) const char* get_client_name(void);
+__attribute__ ((visibility("default"))) bool get_proc_name(pid_t pid, char *process_name);
 
 #ifdef __cplusplus
 }