ESO Recipe Execution Tool 3.13.10
Classes | Functions
Array of Strings

Classes

struct  er_stringarray_t
 

Functions

er_stringarray_ter_stringarray_new (void)
 Creates a new er_stringarray.
 
void er_stringarray_resize (er_stringarray_t *csa, int size)
 Resizes a er_stringarray.
 
void er_stringarray_delete (er_stringarray_t *csa)
 Deletes a er_stringarray.
 
char * er_stringarray_get (er_stringarray_t *csa, int indx)
 Get a reference to the string at position index.
 
void er_stringarray_set (er_stringarray_t *csa, const char *instring, int indx)
 Sets position index in stringarray to a copy of the string given.
 
void er_stringarray_append (er_stringarray_t *csa, const char *instring)
 Adds a copy to given string at end of stringarray.
 
void er_stringarray_remove (er_stringarray_t *csa, int indx)
 Removes a string at position index.
 
int er_stringarray_present (er_stringarray_t *csa, int indx)
 Checks whether there is a string present at position index.
 
int er_stringarray_size (er_stringarray_t *csa)
 Returns current size aka capacity of stringarray.
 
void er_stringarray_print (er_stringarray_t *csa)
 Prints a stringarray to standardformat.
 

Detailed Description

This module provides a collection of functions that create, manipulate and destroy arrays of character strings.

Function Documentation

◆ er_stringarray_append()

void er_stringarray_append ( er_stringarray_t * csa,
const char * instring )

Adds a copy to given string at end of stringarray.

Parameters
csaStringarray to operate on
instringString to store

Stores a copy to instring at the last position in csa.

◆ er_stringarray_delete()

void er_stringarray_delete ( er_stringarray_t * csa)

Deletes a er_stringarray.

Parameters
csaStringarray to delete

Deletes all information stored in a er_stringarray. All strings contained in it are deleted. All memory associated with csa is properly deallocated.

◆ er_stringarray_get()

char * er_stringarray_get ( er_stringarray_t * csa,
int indx )

Get a reference to the string at position index.

Parameters
csaStringarray to operate on
indxPosition in Stringarray

Returns A reference to the string stored at position indx in csa.

◆ er_stringarray_new()

er_stringarray_t * er_stringarray_new ( void )

Creates a new er_stringarray.

Returns
A newly allocated er_stringarray

◆ er_stringarray_present()

int er_stringarray_present ( er_stringarray_t * csa,
int indx )

Checks whether there is a string present at position index.

Parameters
csaStringarray to operate on
indxPosition in stringarray
Returns
1 if there is, 0 if there is not.

◆ er_stringarray_print()

void er_stringarray_print ( er_stringarray_t * csa)

Prints a stringarray to standardformat.

Parameters
csaStringarray to operate on

The format is "index : stringcontents".

◆ er_stringarray_remove()

void er_stringarray_remove ( er_stringarray_t * csa,
int indx )

Removes a string at position index.

Parameters
csaStringarray to operate on
indxPosition in stringarray

Removes a string at position indx. Effectively creates a 'hole' in the stringarray.

◆ er_stringarray_resize()

void er_stringarray_resize ( er_stringarray_t * csa,
int size )

Resizes a er_stringarray.

Parameters
csaStringarray to resize
sizeNew size of string array

Resizes the stringarray so it can can contain size strings. If the new size is equal to the old size nothing happens. If the new size is less, all strings at the far side of the new size are properly deleted and the er_stringarray is shrunk to the new size. If the new size is larger than old size the array is grown to the new size, all string present are kept.

◆ er_stringarray_set()

void er_stringarray_set ( er_stringarray_t * csa,
const char * instring,
int indx )

Sets position index in stringarray to a copy of the string given.

Parameters
csaStringarray to operate on
instringString to store
indxPosition in Stringarray

Stores a copy of instring at position indx in csa.

◆ er_stringarray_size()

int er_stringarray_size ( er_stringarray_t * csa)

Returns current size aka capacity of stringarray.

Parameters
csaStringarray to operate on
Returns
Maximum number of strings the array can store