/builddir/build/BUILD/gru-0.1.0/src/collection/gru_node.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include "common/gru_portable.h"

Go to the source code of this file.

Data Structures

struct  gru_node_t_

Defines

#define gru_node_get_data_ptr(type, node)   (type *) node->data
#define gru_node_get_data(type, node)   (*(gru_node_get_data_ptr(type, node)))

Typedefs

typedef struct gru_node_t_ gru_node_t

Functions

gru_export gru_node_tgru_node_new (const void *ptr)
 Creates a new node.
gru_export void gru_node_destroy (gru_node_t **node)
 Destroys a node and sets is address to NULL.
gru_export void gru_node_set_previous (gru_node_t *gru_restrict node, gru_node_t *gru_restrict previous)
 Sets the previous node for a given node.
gru_export void gru_node_set_next (gru_node_t *gru_restrict node, gru_node_t *gru_restrict next)
 Sets the next node for a given node.
gru_export void gru_node_reset (gru_node_t *gru_restrict node)
 Reset the pointers for the node and unassign the next and previous pointers.
gru_export void gru_node_unlink (gru_node_t *gru_restrict node)
 Unlink a node from it's previous and next node and resets it.

Define Documentation

#define gru_node_get_data ( type,
node   )     (*(gru_node_get_data_ptr(type, node)))
#define gru_node_get_data_ptr ( type,
node   )     (type *) node->data

Typedef Documentation

typedef struct gru_node_t_ gru_node_t

Function Documentation

gru_export void gru_node_destroy ( gru_node_t **  node  ) 

Destroys a node and sets is address to NULL.

Parameters:
node a pointer to the node pointer to destroy
gru_export gru_node_t* gru_node_new ( const void *  ptr  ) 

Creates a new node.

Parameters:
ptr data pointer
Returns:
a new node
gru_export void gru_node_reset ( gru_node_t *gru_restrict  node  ) 

Reset the pointers for the node and unassign the next and previous pointers.

Parameters:
node the node to reset
gru_export void gru_node_set_next ( gru_node_t *gru_restrict  node,
gru_node_t *gru_restrict  next 
)

Sets the next node for a given node.

Parameters:
node the node to set
next the node to be set as the next to the node
gru_export void gru_node_set_previous ( gru_node_t *gru_restrict  node,
gru_node_t *gru_restrict  previous 
)

Sets the previous node for a given node.

Parameters:
node the node to set
previous the node to be set as a previous to the node
gru_export void gru_node_unlink ( gru_node_t *gru_restrict  node  ) 

Unlink a node from it's previous and next node and resets it.

Parameters:
node the node to unlink
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 10 Feb 2018 for GRU - Generic Reusable Utilities by  doxygen 1.6.1