ASCOT5
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
list.h File Reference

Header file for list.c. More...

#include "offload_acc_omp.h"

Go to the source code of this file.

Data Structures

struct  list_int_node
 Linked list node that stores int data. More...
 

Typedefs

typedef struct list_int_node list_int_node
 Linked list node that stores int data.
 

Functions

DECLARE_TARGET void list_int_create (list_int_node **list)
 Create an empty list.
 
DECLARE_TARGET_END DECLARE_TARGET void list_int_free (list_int_node **list)
 Deallocate this list and all lists it is linked to.
 
DECLARE_TARGET_END DECLARE_TARGET void list_int_add (list_int_node *list, int data)
 Add new node to the end of the chain.
 
DECLARE_TARGET_END DECLARE_TARGET int list_int_get (list_int_node *list, int index)
 Retrieve the data stored in a list node.
 
DECLARE_TARGET_END DECLARE_TARGET int list_int_size (list_int_node *list)
 Get list size.
 

Detailed Description

Header file for list.c.

Definition in file list.h.

Function Documentation

◆ list_int_create()

DECLARE_TARGET void list_int_create ( list_int_node ** list)

Create an empty list.

Parameters
listpointer to the created list

Definition at line 16 of file list.c.

◆ list_int_free()

DECLARE_TARGET_END DECLARE_TARGET void list_int_free ( list_int_node ** list)

Deallocate this list and all lists it is linked to.

Parameters
listpointer to the list to be freed

Definition at line 28 of file list.c.

◆ list_int_add()

DECLARE_TARGET_END DECLARE_TARGET void list_int_add ( list_int_node * list,
int data )

Add new node to the end of the chain.

Parameters
listlist node to which new node is linked
dataint value to be stored in the new node

Definition at line 48 of file list.c.

◆ list_int_get()

DECLARE_TARGET_END DECLARE_TARGET int list_int_get ( list_int_node * list,
int index )

Retrieve the data stored in a list node.

Parameters
listlist node
indexnode index where data is retrieved, zero refers to current node
Returns
the stored data

Definition at line 69 of file list.c.

◆ list_int_size()

DECLARE_TARGET_END DECLARE_TARGET int list_int_size ( list_int_node * list)

Get list size.

Parameters
listlist node
Returns
number of nodes this node is linked to

Definition at line 86 of file list.c.