xine-lib: xine-lib-1.2.12/src/xine-utils/sorted_array.c File Reference

xine-lib 1.2.12

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

## Data Structures
struct | xine_sarray_s

## Macros
#define | MIN_CHUNK_SIZE 64

## Functions
static int | _xine_sarray_find_default (xine_sarray_t *sarray, void *key)
static int | _xine_sarray_find_first (xine_sarray_t *sarray, void *key)
static int | _xine_sarray_find_last (xine_sarray_t *sarray, void *key)
int | xine_sarray_binary_search (xine_sarray_t *sarray, void *key)
xine_sarray_t * | xine_sarray_new (size_t initial_size, xine_sarray_comparator_t comparator)
void | xine_sarray_delete (xine_sarray_t *sarray)
size_t | xine_sarray_size (const xine_sarray_t *sarray)
void | xine_sarray_set_mode (xine_sarray_t *sarray, unsigned int mode)
void * | xine_sarray_get (xine_sarray_t *sarray, unsigned int position)
void | xine_sarray_clear (xine_sarray_t *sarray)
void | xine_sarray_move_location (xine_sarray_t *sarray, void *new_ptr, unsigned int position)
void | xine_sarray_remove (xine_sarray_t *sarray, unsigned int position)
int | xine_sarray_remove_ptr (xine_sarray_t *sarray, void *ptr)
static void | _xine_sarray_insert (xine_sarray_t *sarray, unsigned int pos, void *value)
int | xine_sarray_add (xine_sarray_t *sarray, void *value)

## Macro Definition Documentation

## ◆ MIN_CHUNK_SIZE

#define MIN_CHUNK_SIZE 64

## Function Documentation

## ◆ _xine_sarray_find_default()

static int _xine_sarray_find_default | ( | xine_sarray_t * | sarray,
|  | void * | key
| ) |  |
| static

References xine_sarray_s::chunk, xine_sarray_s::comparator, xine_sarray_s::first_test, key, and xine_sarray_s::size.

Referenced by xine_sarray_new(), and xine_sarray_set_mode().

## ◆ _xine_sarray_find_first()

static int _xine_sarray_find_first | ( | xine_sarray_t * | sarray,
|  | void * | key
| ) |  |
| static

References xine_sarray_s::chunk, xine_sarray_s::comparator, xine_sarray_s::first_test, key, and xine_sarray_s::size.

Referenced by xine_sarray_set_mode().

## ◆ _xine_sarray_find_last()

static int _xine_sarray_find_last | ( | xine_sarray_t * | sarray,
|  | void * | key
| ) |  |
| static

References xine_sarray_s::chunk, xine_sarray_s::comparator, xine_sarray_s::first_test, key, and xine_sarray_s::size.

Referenced by xine_sarray_set_mode().

## ◆ _xine_sarray_insert()

static void _xine_sarray_insert | ( | xine_sarray_t * | sarray,
|  | unsigned int | pos,
|  | void * | value
| ) |  |
| static

References xine_sarray_s::chunk, xine_sarray_s::chunk_size, xine_sarray_s::default_chunk, xine_sarray_s::last_add, MIN_CHUNK_SIZE, xine_sarray_s::same_dir, and xine_sarray_s::size.

Referenced by xine_sarray_add().

## ◆ xine_sarray_add()

int xine_sarray_add | ( | xine_sarray_t * | sarray,
|  | void * | value
| ) |  |

References _xine_sarray_insert(), xine_sarray_s::find, xine_sarray_s::first_test, xine_sarray_s::last_add, xine_sarray_s::mode, xine_sarray_s::same_dir, xine_sarray_s::size, and XINE_SARRAY_MODE_UNIQUE.

Referenced by _build_list_typed_plugins(), _decoder_priority_cb(), _insert_node(), config_insert(), config_validate(), load_plugin_list(), xine_event_select(), and xine_gl_extensions_load().

## ◆ xine_sarray_binary_search()

int xine_sarray_binary_search | ( | xine_sarray_t * | sarray,
|  | void * | key
| ) |  |

References xine_sarray_s::find, xine_sarray_s::first_test, key, and xine_sarray_s::size.

Referenced by collect_plugins(), config_insert(), xine_event_send(), and xine_gl_extensions_test().

## ◆ xine_sarray_clear()

void xine_sarray_clear | ( | xine_sarray_t * | sarray | ) |

References xine_sarray_s::last_add, xine_sarray_s::same_dir, and xine_sarray_s::size.

Referenced by xine_event_select().

## ◆ xine_sarray_delete()

void xine_sarray_delete | ( | xine_sarray_t * | sarray | ) |

References xine_sarray_s::chunk, and xine_sarray_s::default_chunk.

Referenced by _build_list_typed_plugins(), _new_catalog(), config_dispose(), dispose_plugin_list(), xine_event_queue_unref_unlock(), xine_event_select(), and xine_gl_extensions_unload().

## ◆ xine_sarray_get()

void * xine_sarray_get | ( | xine_sarray_t * | sarray,
|  | unsigned int | position
| ) |  |

References xine_sarray_s::chunk, and NULL.

Referenced by _build_list_typed_plugins(), _get_demux_strings(), _get_input_class(), _load_required_plugins(), _unload_unref_plugins(), _x_find_demux_plugin(), _x_find_demux_plugin_by_name(), _x_find_demux_plugin_last_probe(), _x_find_input_plugin(), _x_find_module(), _x_load_audio_output_plugin(), _x_load_video_output_plugin(), collect_plugins(), config_insert(), config_validate(), dispose_plugin_list(), load_plugin_list(), map_decoder_list(), save_plugin_list(), xine_get_autoplay_input_plugin_ids(), xine_get_browsable_input_plugin_ids(), xine_get_demux_for_mime_type(), xine_list_post_plugins_typed(), xine_new_framegrab_video_port(), xine_open_audio_driver(), and xine_post_init().

## ◆ xine_sarray_move_location()

void xine_sarray_move_location | ( | xine_sarray_t * | sarray,
|  | void * | new_ptr,
|  | unsigned int | position
| ) |  |

References xine_sarray_s::chunk, xine_sarray_s::last_add, xine_sarray_s::same_dir, and xine_sarray_s::size.

Referenced by config_insert().

## ◆ xine_sarray_new()

xine_sarray_t * xine_sarray_new | ( | size_t | initial_size,
|  | xine_sarray_comparator_t | comparator
| ) |  |

References _xine_sarray_find_default(), xine_sarray_s::chunk, xine_sarray_s::chunk_size, xine_sarray_s::comparator, xine_sarray_s::default_chunk, xine_sarray_s::find, xine_sarray_s::last_add, MIN_CHUNK_SIZE, xine_sarray_s::mode, NULL, xine_sarray_s::same_dir, xine_sarray_s::size, and XINE_SARRAY_MODE_DEFAULT.

Referenced by _build_list_typed_plugins(), _new_catalog(), _x_config_init(), xine_event_select(), and xine_gl_extensions_load().

## ◆ xine_sarray_remove()

void xine_sarray_remove | ( | xine_sarray_t * | sarray,
|  | unsigned int | position
| ) |  |

References xine_sarray_s::chunk, xine_sarray_s::last_add, xine_sarray_s::same_dir, and xine_sarray_s::size.

Referenced by _load_required_plugins(), and collect_plugins().

## ◆ xine_sarray_remove_ptr()

int xine_sarray_remove_ptr | ( | xine_sarray_t * | sarray,
|  | void * | ptr
| ) |  |

References xine_sarray_s::chunk, xine_sarray_s::last_add, xine_sarray_s::same_dir, and xine_sarray_s::size.

Referenced by _decoder_priority_cb().

## ◆ xine_sarray_set_mode()

void xine_sarray_set_mode | ( | xine_sarray_t * | sarray,
|  | unsigned int | mode
| ) |  |

References _xine_sarray_find_default(), _xine_sarray_find_first(), _xine_sarray_find_last(), xine_sarray_s::find, mode(), xine_sarray_s::mode, XINE_SARRAY_MODE_FIRST, and XINE_SARRAY_MODE_LAST.

Referenced by _build_list_typed_plugins(), _new_catalog(), _x_config_init(), and xine_event_select().

## ◆ xine_sarray_size()

size_t xine_sarray_size | ( | const xine_sarray_t * | sarray | ) |

References xine_sarray_s::size.

Referenced by _build_list_typed_plugins(), _get_demux_strings(), _get_input_class(), _load_required_plugins(), _unload_unref_plugins(), _x_find_demux_plugin(), _x_find_demux_plugin_by_name(), _x_find_demux_plugin_last_probe(), _x_find_input_plugin(), _x_find_module(), _x_load_audio_output_plugin(), _x_load_video_output_plugin(), config_insert(), config_validate(), dispose_plugin_list(), map_decoder_list(), save_plugin_list(), xine_get_autoplay_input_plugin_ids(), xine_get_browsable_input_plugin_ids(), xine_get_demux_for_mime_type(), xine_list_post_plugins_typed(), xine_new_framegrab_video_port(), xine_open_audio_driver(), and xine_post_init().