xine-lib 1.2.11
array.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2017 the xine project
3 *
4 * This file is part of xine, a free video player.
5 *
6 * xine is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * xine is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 *
20 * Array that can grow automatically when you add elements.
21 * Inserting an element in the middle of the array implies memory moves.
22 */
23#ifndef XINE_ARRAY_H
24#define XINE_ARRAY_H
25
26#include <stddef.h> /* size_t */
27#include <xine/attributes.h>
28
29/* Array type */
31
32/* Constructor */
34
35/* Destructor */
37
38/* Returns the number of element stored in the array */
40
41/* Removes all elements from an array */
43
44/* Adds the element at the end of the array */
45void xine_array_add(xine_array_t *array, void *value) XINE_PROTECTED;
46
47/* Inserts an element into an array at the position specified */
48void xine_array_insert(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED;
49
50/* Removes one element from an array at the position specified */
51void xine_array_remove(xine_array_t *array, unsigned int position) XINE_PROTECTED;
52
53/* Get the element at the position specified */
54void *xine_array_get(const xine_array_t *array, unsigned int position) XINE_PROTECTED;
55
56/* Set the element at the position specified */
57void xine_array_set(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED;
58
59#endif
60
void * xine_array_get(const xine_array_t *array, unsigned int position)
Definition: array.c:115
void xine_array_set(xine_array_t *array, unsigned int position, void *value)
Definition: array.c:122
void xine_array_clear(xine_array_t *array)
Definition: array.c:81
void xine_array_remove(xine_array_t *array, unsigned int position)
Definition: array.c:104
void xine_array_add(xine_array_t *array, void *value)
Definition: array.c:85
xine_array_t * xine_array_new(size_t initial_size)
Definition: array.c:50
void xine_array_insert(xine_array_t *array, unsigned int position, void *value)
Definition: array.c:91
void xine_array_delete(xine_array_t *array)
Definition: array.c:72
size_t xine_array_size(const xine_array_t *array)
Definition: array.c:77
#define XINE_MALLOC
Definition: attributes.h:141
#define XINE_PROTECTED
Definition: attributes.h:75
Definition: array.c:33