rtl433  UNKNOWN
RTL-433 utility
list.c File Reference

Generic list. More...

Functions

void list_ensure_size (list_t *list, size_t min_size)
 Alloc elems if needed and ensure the list has room for at least min_size elements. More...
 
void list_push (list_t *list, void *p)
 Add to the end of elems, allocs or grows the list if needed and ensures the list has a terminating NULL. More...
 
void list_push_all (list_t *list, void **p)
 Adds all elements of a NULL terminated list to the end of elems, allocs or grows the list if needed and ensures the list has a terminating NULL. More...
 
void list_remove (list_t *list, size_t idx, list_elem_free_fn elem_free)
 Remove element from the list, frees element with fn. More...
 
void list_clear (list_t *list, list_elem_free_fn elem_free)
 Clear the list, frees each element with fn, does not free backing or list itself. More...
 
void list_free_elems (list_t *list, list_elem_free_fn elem_free)
 Clear the list, free backing, does not free list itself. More...
 

Detailed Description

Generic list.

Copyright (C) 2018 Christian Zuckschwerdt

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Function Documentation

◆ list_clear()

void list_clear ( list_t list,
list_elem_free_fn  elem_free 
)

Clear the list, frees each element with fn, does not free backing or list itself.

References list::elems, and list::len.

Referenced by list_free_elems(), and parse_conf_option().

◆ list_ensure_size()

void list_ensure_size ( list_t list,
size_t  min_size 
)

Alloc elems if needed and ensure the list has room for at least min_size elements.

References list::elems, list::len, and list::size.

Referenced by create_report_data(), determine_csv_fields(), list_push(), and r_init_cfg().

◆ list_free_elems()

void list_free_elems ( list_t list,
list_elem_free_fn  elem_free 
)

Clear the list, free backing, does not free list itself.

References list::elems, list_clear(), and list::size.

Referenced by create_report_data(), and r_free_cfg().

◆ list_push()

void list_push ( list_t list,
void *  p 
)

Add to the end of elems, allocs or grows the list if needed and ensures the list has a terminating NULL.

References list::elems, list::len, list_ensure_size(), and list::size.

Referenced by add_csv_output(), add_dumper(), add_infile(), add_json_output(), add_kv_output(), add_mqtt_output(), add_null_output(), add_syslog_output(), create_report_data(), list_push_all(), and register_protocol().

◆ list_push_all()

void list_push_all ( list_t list,
void **  p 
)

Adds all elements of a NULL terminated list to the end of elems, allocs or grows the list if needed and ensures the list has a terminating NULL.

References list_push().

Referenced by determine_csv_fields().

◆ list_remove()

void list_remove ( list_t list,
size_t  idx,
list_elem_free_fn  elem_free 
)

Remove element from the list, frees element with fn.

References list::elems, and list::len.

Referenced by unregister_protocol().