function lfds700_list_aos_query
Jump to navigation
Jump to search
Source Files
└───liblfds700 ├───inc │ └───liblfds700 │ lfds700_list_addonly_ordered_singlylinked.h └───src └───llfds700_list_addonly_ordered_singlylinked lfds700_list_addonly_ordered_singlylinked_query.c
Enums
enum lfds700_list_aos_query { LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE };
Opaque Structures
struct lfds700_list_aos_state;
Prototype
void lfds700_list_aos_query( struct lfds700_list_aos_state *laoss, enum lfds700_list_aos_query query_type, void *query_input, void *query_output );
Parameters
struct lfds700_list_aos_state *laoss
- A pointer to an initialized struct lfds700_list_aos_state.
enum lfds700_list_aos_query query_type
- Indicates which query to perform.
void *query_input
- A pointer to input data for the query, where the data varies by query;
- LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT
- query_input is NULL.
- LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE
- This argument can be NULL, or can be a pointer to a struct lfds700_liblfds_validation_info, which specifies an expected min/max count, in which case validation also counts the number of elements and check they fall within the specified range. The walk is thread-safe, the count is not. See Notes.
- LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT
void *query_output
- A pointer to output store for the query, where the output varies by query;
- LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT
- Points to a lfds700_pal_uint_t, which is set to the number of elements in the list.
- LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE
- Points to an enum lfds700_misc_validity, which is set to indicate the result of the validation operation.
- LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT
Notes
All SINGLETHREADED queries can only be safely performed if no insert operations occur while the operation runs. If insert operations do occur during the execution of a SINGLETHREADED query, it is theoretically possible for the query to enter an infinite loop or to access random memory. Do not do this.
The LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT query is non-atomic and iterates over the list, counting elements; if new element are added during the iteration, they may not be seen. As such, the count is potentially inaccurate.
Example
Coming soon. No, really! (Written 29th Dec 2015).