Salad  1.0.15
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Typedefs | Functions
Sld_list

Data Structures

struct  sld_node
 
struct  sld_list
 

Typedefs

typedef struct sld_node sld_node
 
typedef struct sld_list sld_list
 

Functions

SLD_SSINT sld_list_init (struct sld_list *list)
 Initializes a sld_list. More...
 
SLD_UINT sld_list_size (struct sld_list *list)
 Returns the size of a sld_list. More...
 
SLD_SSINT sld_list_add (struct sld_list *list, void *object)
 Adds an object to a sld_list. More...
 
void sld_list_delete (struct sld_list *list, SLD_UINT index)
 Removes an object from a sld_list at the specified index. More...
 
void * sld_list_get (struct sld_list *list, SLD_UINT index)
 Returns an object from an sld_list at index. More...
 
void * sld_list_pop (struct sld_list *list)
 Returns and removes the last object in a sld_list. More...
 
void sld_list_free (struct sld_list *list)
 Frees any memory allocated for an initialized sld_list. More...
 

Detailed Description

This module contains functions and structures related to sld_list objects.

Typedef Documentation

typedef struct sld_list sld_list

A sld_list contains sld_node structures

typedef struct sld_node sld_node

A sld_node contained within a list

Function Documentation

SLD_SSINT sld_list_add ( struct sld_list list,
void *  object 
)
related

Adds an object to a sld_list.

Parameters
listan initialized sld_list
objectan arbitrary object
Returns
Success or failure
sld_list_add(&list, "foo");
sld_list_add(&list, "bar");
Examples:
list.c.
void sld_list_delete ( struct sld_list list,
SLD_UINT  index 
)
related

Removes an object from a sld_list at the specified index.

Parameters
listan initialized sld_list
indexan index where an object resides within the sld_list
sld_list_delete(&list, 7);
void sld_list_free ( struct sld_list list)
related

Frees any memory allocated for an initialized sld_list.

Parameters
listan initialized sld_list
Examples:
list.c.
void * sld_list_get ( struct sld_list list,
SLD_UINT  index 
)
related

Returns an object from an sld_list at index.

Parameters
listan initialized sld_list
indexan index where an object resides within the sld_list
Returns
The object residing at the specified index
puts((char *)sld_list_get(&list, 3));
Examples:
list.c.
SLD_SSINT sld_list_init ( struct sld_list list)
related

Initializes a sld_list.

Parameters
listan uninitialized sld_list
Returns
Success or failure
sld_list list;
sld_list_init(&list);
Examples:
list.c.
void * sld_list_pop ( struct sld_list list)
related

Returns and removes the last object in a sld_list.

Parameters
listan initialized sld_list
Returns
The last object in the passed sld_list
puts((char *)sld_list_pop(&list));
Examples:
list.c.
SLD_UINT sld_list_size ( struct sld_list list)
related

Returns the size of a sld_list.

Parameters
listan initialized sld_list
Returns
The size of the passed sld_list
for(i = 0; i < sld_list_size(&list); i++)
...
Examples:
list.c.