Orcania Potluck with different functions for different purposes that can be shared among C programs

Loading...
Searching...
No Matches
_pointer_list structure

## Data Structures
struct | _pointer_list

## Functions
void | pointer_list_init (struct _pointer_list *pointer_list)
void | pointer_list_clean (struct _pointer_list *pointer_list)
void | pointer_list_clean_free (struct _pointer_list *pointer_list, void(*free_function)(void *elt))
size_t | pointer_list_size (struct _pointer_list *pointer_list)
int | pointer_list_append (struct _pointer_list *pointer_list, void *element)
void * | pointer_list_get_at (struct _pointer_list *pointer_list, size_t index)
int | pointer_list_remove_at (struct _pointer_list *pointer_list, size_t index)
int | pointer_list_remove_at_free (struct _pointer_list *pointer_list, size_t index, void(*free_function)(void *elt))
int | pointer_list_insert_at (struct _pointer_list *pointer_list, void *element, size_t index)
int | pointer_list_remove_pointer (struct _pointer_list *pointer_list, void *element)
int | pointer_list_remove_pointer_free (struct _pointer_list *pointer_list, void *element, void(*free_function)(void *elt))

## Detailed Description

## Function Documentation

## ◆ pointer_list_append()

int pointer_list_append | ( | struct _pointer_list * | pointer_list,
|  | void * | element )

pointer_list_append Appends an element at the end of a pointer list

Parameters

  pointer_list | a pointer list
  element | an element to append

Returns
  1 on success, 0 on error

## ◆ pointer_list_clean()

void pointer_list_clean | ( | struct _pointer_list * | pointer_list | ) |

pointer_list_clean Clean a pointer list structure

Parameters

  pointer_list | a pointer list to clean

## ◆ pointer_list_clean_free()

void pointer_list_clean_free | ( | struct _pointer_list * | pointer_list,
|  | void(* | free_function )(void *elt) )

pointer_list_clean_free Clean a pointer list structure Free all elements using the free_function given in parameters

Parameters

  pointer_list | a pointer list to clean
  free_function | a function to use for freeing values

## ◆ pointer_list_get_at()

void * pointer_list_get_at | ( | struct _pointer_list * | pointer_list,
|  | size_t | index )

pointer_list_get_at

Parameters

  pointer_list | a pointer list
  index | the index of the element in pointer_list

Returns
  an element of a pointer list at the specified index or NULL if non valid index

## ◆ pointer_list_init()

void pointer_list_init | ( | struct _pointer_list * | pointer_list | ) |

pointer_list_init Initialize a pointer list structure

Parameters

  pointer_list | a pointer list to initialize

## ◆ pointer_list_insert_at()

int pointer_list_insert_at | ( | struct _pointer_list * | pointer_list,
|  | void * | element,
|  | size_t | index )

pointer_list_insert_at Inserts an element at the specified index of a pointer list

Parameters

  pointer_list | a pointer list
  element | the element to set at index
  index | the index of the element in pointer_list

Returns
  1 on success, 0 on error or non valid inde

## ◆ pointer_list_remove_at()

int pointer_list_remove_at | ( | struct _pointer_list * | pointer_list,
|  | size_t | index )

pointer_list_remove_at Removes an element of a pointer list at the specified index

Parameters

  pointer_list | a pointer list
  index | the index of the element in pointer_list

Returns
  1 on success, 0 on error or non valid index

## ◆ pointer_list_remove_at_free()

int pointer_list_remove_at_free | ( | struct _pointer_list * | pointer_list,
|  | size_t | index,
|  | void(* | free_function )(void *elt) )

pointer_list_remove_at_free Removes an element of a pointer list at the specified index Free the element using the free_function given in parameters

Parameters

  pointer_list | a pointer list
  index | the index of the element in pointer_list
  free_function | the function to use to free the element

Returns
  1 on success, 0 on error or non valid index

## ◆ pointer_list_remove_pointer()

int pointer_list_remove_pointer | ( | struct _pointer_list * | pointer_list,
|  | void * | element )

pointer_list_remove_pointer Removes an element of a pointer list corresponding to the specified element

Parameters

  pointer_list | a pointer list
  element | the element to set at index

Returns
  1 on success, 0 on error or non valid inde

## ◆ pointer_list_remove_pointer_free()

int pointer_list_remove_pointer_free | ( | struct _pointer_list * | pointer_list,
|  | void * | element,
|  | void(* | free_function )(void *elt) )

pointer_list_remove_pointer_free Removes an element of a pointer list corresponding to the specified element Free the element using the free_function given in parameters

Parameters

  pointer_list | a pointer list
  element | the element to set at index
  free_function | the function to use to free the element

Returns
  1 on success, 0 on error or non valid inde

## ◆ pointer_list_size()

size_t pointer_list_size | ( | struct _pointer_list * | pointer_list | ) |

pointer_list_size

Parameters

  pointer_list | a pointer list

Returns
  the size of a pointer list