Asterisk - The Open Source Telephony Project
21.4.1
|
Common, private definitions for astobj2 containers. More...
#include "asterisk/astobj2.h"
Go to the source code of this file.
Data Structures | |
struct | ao2_container |
Generic container type. More... | |
struct | ao2_container_methods |
struct | ao2_container_node |
Generic container node. More... | |
Macros | |
#define | __container_unlink_node(node, flags) __container_unlink_node_debug(node, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | AO2_TRAVERSAL_STATE_SIZE 100 |
Typedefs | |
typedef struct ao2_container *(* | ao2_container_alloc_empty_clone_fn) (struct ao2_container *self, const char *tag, const char *file, int line, const char *func) |
Create an empty copy of this container. More... | |
typedef void(* | ao2_container_destroy_fn) (struct ao2_container *self) |
Destroy this container. More... | |
typedef void(* | ao2_container_display) (struct ao2_container *self, void *where, ao2_prnt_fn *prnt, ao2_prnt_obj_fn *prnt_obj) |
Display contents of the specified container. More... | |
typedef void(* | ao2_container_find_cleanup_fn) (void *v_state) |
Cleanup the container traversal state. More... | |
typedef struct ao2_container_node *(* | ao2_container_find_first_fn) (struct ao2_container *self, enum search_flags flags, void *arg, void *v_state) |
Find the first container node in a traversal. More... | |
typedef struct ao2_container_node *(* | ao2_container_find_next_fn) (struct ao2_container *self, void *v_state, struct ao2_container_node *prev) |
Find the next container node in a traversal. More... | |
typedef enum ao2_container_insert(* | ao2_container_insert_fn) (struct ao2_container *self, struct ao2_container_node *node) |
Insert a node into this container. More... | |
typedef int(* | ao2_container_integrity) (struct ao2_container *self) |
Perform an integrity check on the specified container. More... | |
typedef struct ao2_container_node *(* | ao2_container_new_node_fn) (struct ao2_container *self, void *obj_new, const char *tag, const char *file, int line, const char *func) |
Create a new container node. More... | |
typedef void(* | ao2_container_statistics) (struct ao2_container *self, void *where, ao2_prnt_fn *prnt) |
Display statistics of the specified container. More... | |
typedef struct ao2_container_node *(* | ao2_iterator_next_fn) (struct ao2_container *self, struct ao2_container_node *prev, enum ao2_iterator_flags flags) |
Find the next non-empty iteration node in the container. More... | |
typedef void(* | ao2_link_node_stat_fn) (struct ao2_container *container, struct ao2_container_node *node) |
typedef void(* | ao2_unlink_node_stat_fn) (struct ao2_container *container, struct ao2_container_node *node) |
Enumerations | |
enum | ao2_callback_type { AO2_CALLBACK_DEFAULT, AO2_CALLBACK_WITH_DATA } |
enum | ao2_container_insert { AO2_CONTAINER_INSERT_NODE_INSERTED, AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED, AO2_CONTAINER_INSERT_NODE_REJECTED } |
enum | ao2_unlink_node_flags { AO2_UNLINK_NODE_UNLINK_OBJECT = (1 << 0), AO2_UNLINK_NODE_NOUNREF_OBJECT = (1 << 1), AO2_UNLINK_NODE_UNREF_NODE = (1 << 2), AO2_UNLINK_NODE_DEC_COUNT = (1 << 3) } |
Functions | |
int | __container_unlink_node_debug (struct ao2_container_node *node, uint32_t flags, const char *tag, const char *file, int line, const char *func) |
void | container_destruct (void *_c) |
int | container_init (void) |
Common, private definitions for astobj2 containers.
Definition in file astobj2_container_private.h.
#define AO2_TRAVERSAL_STATE_SIZE 100 |
Allow enough room for container specific traversal state structs
Definition at line 60 of file astobj2_container_private.h.
typedef struct ao2_container*(* ao2_container_alloc_empty_clone_fn) (struct ao2_container *self, const char *tag, const char *file, int line, const char *func) |
Create an empty copy of this container.
self | Container to operate upon. |
tag | used for debugging. |
file | Debug file name invoked from |
line | Debug line invoked from |
func | Debug function name invoked from |
NULL | on error. |
Definition at line 96 of file astobj2_container_private.h.
typedef void(* ao2_container_destroy_fn) (struct ao2_container *self) |
Destroy this container.
self | Container to operate upon. |
Definition at line 82 of file astobj2_container_private.h.
typedef void(* ao2_container_display) (struct ao2_container *self, void *where, ao2_prnt_fn *prnt, ao2_prnt_obj_fn *prnt_obj) |
Display contents of the specified container.
self | Container to dump. |
where | User data needed by prnt to determine where to put output. |
prnt | Print output callback function to use. |
prnt_obj | Callback function to print the given object's key. (NULL if not available) |
Definition at line 179 of file astobj2_container_private.h.
typedef void(* ao2_container_find_cleanup_fn) (void *v_state) |
Cleanup the container traversal state.
v_state | Traversal state to cleanup. |
Definition at line 154 of file astobj2_container_private.h.
typedef struct ao2_container_node*(* ao2_container_find_first_fn) (struct ao2_container *self, enum search_flags flags, void *arg, void *v_state) |
Find the first container node in a traversal.
self | Container to operate upon. |
flags | search_flags to control traversing the container |
arg | Comparison callback arg parameter. |
v_state | Traversal state to restart container traversal. |
NULL | when no node found. |
Definition at line 134 of file astobj2_container_private.h.
typedef struct ao2_container_node*(* ao2_container_find_next_fn) (struct ao2_container *self, void *v_state, struct ao2_container_node *prev) |
Find the next container node in a traversal.
self | Container to operate upon. |
v_state | Traversal state to restart container traversal. |
prev | Previous node returned by the traversal search functions. The ref ownership is passed back to this function. |
NULL | when no node found. |
Definition at line 147 of file astobj2_container_private.h.
typedef enum ao2_container_insert(* ao2_container_insert_fn) (struct ao2_container *self, struct ao2_container_node *node) |
Insert a node into this container.
self | Container to operate upon. |
node | Container node to insert into the container. |
Definition at line 121 of file astobj2_container_private.h.
typedef int(* ao2_container_integrity) (struct ao2_container *self) |
Perform an integrity check on the specified container.
self | Container to check integrity. |
0 | on success. |
-1 | on error. |
Definition at line 202 of file astobj2_container_private.h.
typedef struct ao2_container_node*(* ao2_container_new_node_fn) (struct ao2_container *self, void *obj_new, const char *tag, const char *file, int line, const char *func) |
Create a new container node.
self | Container to operate upon. |
obj_new | Object to put into the node. |
tag | used for debugging. |
file | Debug file name invoked from |
line | Debug line invoked from |
func | Debug function name invoked from |
NULL | on error. |
Definition at line 111 of file astobj2_container_private.h.
typedef void(* ao2_container_statistics) (struct ao2_container *self, void *where, ao2_prnt_fn *prnt) |
Display statistics of the specified container.
self | Container to display statistics. |
where | User data needed by prnt to determine where to put output. |
prnt | Print output callback function to use. |
Definition at line 190 of file astobj2_container_private.h.
typedef struct ao2_container_node*(* ao2_iterator_next_fn) (struct ao2_container *self, struct ao2_container_node *prev, enum ao2_iterator_flags flags) |
Find the next non-empty iteration node in the container.
self | Container to operate upon. |
prev | Previous node returned by the iterator. |
flags | search_flags to control iterating the container. Only AO2_ITERATOR_DESCENDING is useful by the method. |
NULL | on error or no more nodes in the container. |
Definition at line 169 of file astobj2_container_private.h.
enum ao2_container_insert |
Definition at line 50 of file astobj2_container_private.h.
Definition at line 33 of file astobj2_container_private.h.