Verilog Parser

Data Structures

struct  ast_list
 Container struct for the linked list data structure. More...
 
struct  ast_list_element
 Storage container for a single element in the linked list. More...
 

Functions

void ast_list_append (ast_list *list, void *data)
 Adds a new item to the end of a linked list.
 
ast_listast_list_concat (ast_list *head, ast_list *tail)
 concatenates the two supplied lists into one. More...
 
int ast_list_contains (ast_list *list, void *data)
 Searches the list, returning true or false if the data item supplied is contained within it. More...
 
void ast_list_free (ast_list *list)
 Frees the memory of the supplied linked list. More...
 
void * ast_list_get (ast_list *list, unsigned int item)
 Finds and returns the i'th item in the linked list. More...
 
ast_listast_list_new ()
 Creates and returns a pointer to a new linked list.
 
void ast_list_preappend (ast_list *list, void *data)
 Adds a new item to the front of a linked list.
 
void ast_list_remove_at (ast_list *list, unsigned int i)
 Removes the i'th item from a linked list.
 

Detailed Description

Function Documentation

ast_list* ast_list_concat ( ast_list head,
ast_list tail 
)

concatenates the two supplied lists into one.

Parameters
head- This will form the "front" of the new list.
tail- This will form the "end" of the new list.

This function takes all the elements in tail and appends them to those in head. The tail argument is then released from memory, and the original head pointer is returned, with all data items still in tact.

int ast_list_contains ( ast_list list,
void *  data 
)

Searches the list, returning true or false if the data item supplied is contained within it.

Performs a pointer comparison. That is, if the internal list pointer has the same address as the supplied data pointer, the item is considered to be found.

void ast_list_free ( ast_list list)

Frees the memory of the supplied linked list.

Note
Does not free the memory of the data elements in the list, only the list construct itself.
void* ast_list_get ( ast_list list,
unsigned int  item 
)

Finds and returns the i'th item in the linked list.

Returns a void* pointer. The programmer must be sure to cast this as the correct type.