xine-lib: xine-lib-1.2.13/src/xine-utils/array.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Functions
array.c File Reference
`#include <stdlib.h>`
`#include <string.h>`
`#include <xine/attributes.h>`
`#include <xine/xineutils.h>`
`#include <xine/array.h>`

## Data Structures
struct | xine_array_s

## Macros
#define | MIN_CHUNK_SIZE 32

## Functions
static void | xine_array_ensure_chunk_size (xine_array_t *array, size_t size)
xine_array_t * | xine_array_new (size_t initial_size)
void | xine_array_delete (xine_array_t *array)
size_t | xine_array_size (const xine_array_t *array)
void | xine_array_clear (xine_array_t *array)
void | xine_array_add (xine_array_t *array, void *value)
void | xine_array_insert (xine_array_t *array, unsigned int position, void *value)
void | xine_array_remove (xine_array_t *array, unsigned int position)
void * | xine_array_get (const xine_array_t *array, unsigned int position)
void | xine_array_set (xine_array_t *array, unsigned int position, void *value)

## Macro Definition Documentation

## ◆ MIN_CHUNK_SIZE

#define MIN_CHUNK_SIZE 32

Referenced by xine_array_new().

## Function Documentation

## ◆ xine_array_add()

void xine_array_add | ( | xine_array_t * | array,
|  | void * | value )

References xine_array_s::chunk, xine_array_s::size, and xine_array_ensure_chunk_size().

Referenced by xine_array_insert(), xine_pool_get(), xine_pool_new(), and xine_pool_put().

## ◆ xine_array_clear()

void xine_array_clear | ( | xine_array_t * | array | ) |

References xine_array_s::size.

## ◆ xine_array_delete()

void xine_array_delete | ( | xine_array_t * | array | ) |

References _x_freep(), and xine_array_s::chunk.

## ◆ xine_array_ensure_chunk_size()

static void xine_array_ensure_chunk_size | ( | xine_array_t * | array,
|  | size_t | size )
| static

References xine_array_s::chunk, and xine_array_s::chunk_size.

Referenced by xine_array_add(), and xine_array_insert().

## ◆ xine_array_get()

void * xine_array_get | ( | const xine_array_t * | array,
|  | unsigned int | position )

References xine_array_s::chunk, and NULL.

Referenced by xine_pool_delete(), and xine_pool_get().

## ◆ xine_array_insert()

void xine_array_insert | ( | xine_array_t * | array,
|  | unsigned int | position,
|  | void * | value )

References xine_array_s::chunk, xine_array_s::size, xine_array_add(), and xine_array_ensure_chunk_size().

## ◆ xine_array_new()

xine_array_t * xine_array_new | ( | size_t | initial_size | ) |

References xine_array_s::chunk, xine_array_s::chunk_size, MIN_CHUNK_SIZE, NULL, and xine_array_s::size.

Referenced by xine_pool_new().

## ◆ xine_array_remove()

void xine_array_remove | ( | xine_array_t * | array,
|  | unsigned int | position )

References xine_array_s::chunk, and xine_array_s::size.

Referenced by xine_pool_get().

## ◆ xine_array_set()

void xine_array_set | ( | xine_array_t * | array,
|  | unsigned int | position,
|  | void * | value )

References xine_array_s::chunk.

## ◆ xine_array_size()

size_t xine_array_size | ( | const xine_array_t * | array | ) |

References xine_array_s::size.

Referenced by xine_pool_delete(), and xine_pool_get().