GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
ilist.c File Reference
#include <stdlib.h>
#include <grass/gis.h>
Include dependency graph for ilist.c:

Go to the source code of this file.

Functions

void G_free_ilist (struct ilist *list)
 Free allocated memory of an integer list. More...
 
struct ilistG_new_ilist ()
 Return a new integer list. More...
 
void G_init_ilist (struct ilist *list)
 Init an integer list and free allocated memory. More...
 
void G_ilist_add (struct ilist *list, int val)
 Add item to ilist. More...
 

Function Documentation

◆ G_free_ilist()

void G_free_ilist ( struct ilist list)

Free allocated memory of an integer list.

Parameters
listThe pointer to an integer list

Definition at line 27 of file ilist.c.

References G_free(), and ilist::value.

Referenced by Rast_close_vrt().

◆ G_ilist_add()

void G_ilist_add ( struct ilist list,
int  val 
)

Add item to ilist.

This function adds an integer to the list but does not check for duplicates. In case reallocation fails, G_fatal_error() will be invoked by the allocation function.

Parameters
listThe ilist pointer
valThe value to attach

Definition at line 77 of file ilist.c.

References ilist::alloc_values, G_realloc, ilist::n_values, and ilist::value.

Referenced by Rast_get_vrt().

◆ G_init_ilist()

void G_init_ilist ( struct ilist list)

Init an integer list and free allocated memory.

Parameters
listThe pointer to an integer list

Definition at line 57 of file ilist.c.

References ilist::alloc_values, G_free(), ilist::n_values, NULL, and ilist::value.

Referenced by G_new_ilist(), and RTreeSearch2().

◆ G_new_ilist()

struct ilist* G_new_ilist ( )

Return a new integer list.

G_fatal_error() will be invoked by the allocation function.

Returns
list The pointer to a new allocated integer list

Definition at line 43 of file ilist.c.

References G_init_ilist(), G_malloc, l, NULL, and ilist::value.

Referenced by Rast_get_vrt().