aboutsummaryrefslogtreecommitdiffstats
path: root/lib/4a-hal-utilities/4a-hal-utilities-data.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.h')
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h
index c051373..8ac4c25 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.h
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h
@@ -20,6 +20,8 @@
#include <stdio.h>
+#include <urcu/list.h>
+
#include <wrap-json.h>
#include <afb/afb-binding.h>
@@ -32,6 +34,11 @@
#define HAL_STREAM_UPDATES_EVENT_NAME "stream-updates"
+// Enum for linked list type
+enum LinkedListType {
+ LINKED_LIST_FOR_DEPENDENCIES_DATA = 0
+};
+
// Enum for hal status
enum HalStatus {
HAL_STATUS_UNAVAILABLE = 0,
@@ -83,7 +90,7 @@ struct InternalHalProbedDevice {
struct InternalHalDeviceData *deviceData;
- struct InternalHalProbedDevice *next;
+ struct cds_list_head node;
};
// Structure to store stream data
@@ -102,7 +109,7 @@ struct InternalHalData {
char *prefix;
json_object *halMixerJ;
- struct InternalHalProbedDevice *probedDevicesList;
+ struct cds_list_head probedDevicesListHead;
struct InternalHalMixerData *streamsData;
afb_event_t streamUpdates;
@@ -146,26 +153,26 @@ struct HalMgrData {
// Internal Hal - Probed devices structure handling functions
enum ProbedDeviceClasses HalUtlGetProbedDeviceClassFromString(char *probedDeviceString);
char *HalUtlGetProbedDeviceClassString(enum ProbedDeviceClasses deviceClass);
-struct InternalHalProbedDevice *HalUtlAddProbedDeviceToProbedDeviceList(struct InternalHalProbedDevice **probedDevicesList);
-int HalUtlRemoveSelectedProbedDeviceFromList(struct InternalHalProbedDevice **probedDevicesList,
+struct InternalHalProbedDevice *HalUtlAddProbedDeviceToProbedDeviceList(struct cds_list_head *probedDevicesListHead);
+int HalUtlRemoveSelectedProbedDeviceFromList(struct cds_list_head *probedDevicesListHead,
struct InternalHalProbedDevice *probedDeviceToRemove);
-int HalUtlRemoveAllProbedDevicesFromList(struct InternalHalProbedDevice **probedDevicesList);
-int HalUtlGetNumberOfProbedDevicesInList(struct InternalHalProbedDevice **probedDevicesList);
-struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct InternalHalProbedDevice **probedDevicesList,
+int HalUtlRemoveAllProbedDevicesFromList(struct cds_list_head *probedDevicesListHead);
+int HalUtlGetNumberOfProbedDevicesInList(struct cds_list_head *probedDevicesListHead);
+struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct cds_list_head *probedDevicesListHead,
char *uid);
struct InternalHalDeviceData *HalUtlAllocateAndFillProbedDeviceDataUsingInfoGetResponse(json_object *responseJ);
json_object *HalUtlGetJsonForSpecificDependencies(afb_api_t apiHandle,
struct InternalHalProbedDevice *requestedProbedDevice,
enum DependencyInfoJsonFormat jsonFormat);
json_object *HalUtlGetJsonForSpecificDependenciesUsingUid(afb_api_t apiHandle,
- struct InternalHalProbedDevice **probedDevicesList,
+ struct cds_list_head *probedDevicesListHead,
char *uid,
enum DependencyInfoJsonFormat jsonFormat);
json_object *HalUtlGetJsonArrayForAvailableDependencies(afb_api_t apiHandle,
- struct InternalHalProbedDevice **probedDevicesList,
+ struct cds_list_head *probedDevicesListHead,
enum DependencyInfoJsonFormat jsonFormat);
json_object *HalUtlGetJsonArrayForAllDependencies(afb_api_t apiHandle,
- struct InternalHalProbedDevice **probedDevicesList,
+ struct cds_list_head *probedDevicesListHead,
enum DependencyInfoJsonFormat jsonFormat);
// Internal Hal - Streams data handling functions