mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-28 09:33:54 +02:00
98b6bac4b9
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@70 182aca00-e38e-11de-a668-6fd11605f5ce
36 lines
1.3 KiB
C
36 lines
1.3 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* parray.h: pointer array collection.
|
|
*
|
|
* Copyright (c) 2009-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
|
|
#ifndef PARRAY_H
|
|
#define PARRAY_H
|
|
|
|
/*
|
|
* "parray" hold pointers to objects in a linear memory area.
|
|
* Client use "parray *" to access parray object.
|
|
*/
|
|
typedef struct parray parray;
|
|
|
|
extern parray *parray_new(void);
|
|
extern void parray_expand(parray *array, size_t newnum);
|
|
extern void parray_free(parray *array);
|
|
extern void parray_append(parray *array, void *val);
|
|
extern void parray_insert(parray *array, size_t index, void *val);
|
|
extern parray *parray_concat(parray *head, const parray *tail);
|
|
extern void parray_set(parray *array, size_t index, void *val);
|
|
extern void *parray_get(const parray *array, size_t index);
|
|
extern void *parray_remove(parray *array, size_t index);
|
|
extern bool parray_rm(parray *array, const void *key, int(*compare)(const void *, const void *));
|
|
extern size_t parray_num(const parray *array);
|
|
extern void parray_qsort(parray *array, int(*compare)(const void *, const void *));
|
|
extern void *parray_bsearch(parray *array, const void *key, int(*compare)(const void *, const void *));
|
|
extern void parray_walk(parray *array, void (*action)(void *));
|
|
|
|
#endif /* PARRAY_H */
|
|
|