Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
sol-list.h File Reference

These are routines that Soletta provides for its list implementation. More...

#include <stdlib.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  sol_list
 Structure to add list support to a type. More...
 

Macros

#define SOL_LIST_FOREACH(list, itr)   for (itr = (list)->next; itr != (list); itr = itr->next)
 Macro to iterate over a list easily. More...
 
#define SOL_LIST_FOREACH_SAFE(list, itr, itr_next)   for (itr = (list)->next, itr_next = itr->next; itr != (list); itr = itr_next, itr_next = itr_next->next)
 Macro to iterate over a list with support for node deletion. More...
 
#define SOL_LIST_GET_CONTAINER(list, type, member)   (type *)((char *)(list) - offsetof(type, member))
 Helper macro to retrieve a pointer to the struct containing this list node. More...
 
#define SOL_LIST_INIT(name)   { &(name), &(name) }
 Helper macro to initialize a sol_list structure. More...
 

Typedefs

typedef struct sol_list sol_list
 Structure to add list support to a type. More...
 

Functions

static void sol_list_append (struct sol_list *list, struct sol_list *new_l)
 Append an new node to the end of the list. More...
 
static void sol_list_init (struct sol_list *list)
 Initializes a sol_list struct. More...
 
static bool sol_list_is_empty (struct sol_list *list)
 Convenience function to check if the list is empty. More...
 
static void sol_list_prepend (struct sol_list *list, struct sol_list *new_l)
 Attach an new node to the beginning of the list. More...
 
static void sol_list_remove (struct sol_list *list)
 Remove the node pointed by list from the list. More...
 
static void sol_list_steal (struct sol_list *list, struct sol_list *new_head)
 Steals the list nodes from a list. More...
 

Detailed Description

These are routines that Soletta provides for its list implementation.