diff options
| author | 2019-05-19 00:20:51 +0200 | |
|---|---|---|
| committer | 2019-05-19 00:20:51 +0200 | |
| commit | 08c6143b870167ad29f9c20a298e0f75c986d0ea (patch) | |
| tree | 079c595bf106a0f93add63a77730a2c8dde2ab7a /src/ptrarray.h | |
| parent | 7e9ecf2f3f902f3e688e68b1d272f9a4b35540c7 (diff) | |
| download | libplist-08c6143b870167ad29f9c20a298e0f75c986d0ea.tar.gz libplist-08c6143b870167ad29f9c20a298e0f75c986d0ea.tar.bz2 | |
Add index lookup table for large PLIST_ARRAY nodes
Diffstat (limited to 'src/ptrarray.h')
| -rw-r--r-- | src/ptrarray.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ptrarray.h b/src/ptrarray.h index e8a3c88..2c6136a 100644 --- a/src/ptrarray.h +++ b/src/ptrarray.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * ptrarray.h | 2 | * ptrarray.h |
| 3 | * header file for simple pointer array implementation | 3 | * header file for simple pointer array implementation |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2011 Nikias Bassen, All Rights Reserved. | 5 | * Copyright (c) 2011-2019 Nikias Bassen, All Rights Reserved. |
| 6 | * | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or | 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public | 8 | * modify it under the terms of the GNU Lesser General Public |
| @@ -24,13 +24,16 @@ | |||
| 24 | 24 | ||
| 25 | typedef struct ptrarray_t { | 25 | typedef struct ptrarray_t { |
| 26 | void **pdata; | 26 | void **pdata; |
| 27 | size_t len; | 27 | long len; |
| 28 | size_t capacity; | 28 | long capacity; |
| 29 | size_t capacity_step; | 29 | long capacity_step; |
| 30 | } ptrarray_t; | 30 | } ptrarray_t; |
| 31 | 31 | ||
| 32 | ptrarray_t *ptr_array_new(int capacity); | 32 | ptrarray_t *ptr_array_new(int capacity); |
| 33 | void ptr_array_free(ptrarray_t *pa); | 33 | void ptr_array_free(ptrarray_t *pa); |
| 34 | void ptr_array_add(ptrarray_t *pa, void *data); | 34 | void ptr_array_add(ptrarray_t *pa, void *data); |
| 35 | void* ptr_array_index(ptrarray_t *pa, size_t index); | 35 | void ptr_array_insert(ptrarray_t *pa, void *data, long index); |
| 36 | void ptr_array_remove(ptrarray_t *pa, long index); | ||
| 37 | void ptr_array_set(ptrarray_t *pa, void *data, long index); | ||
| 38 | void* ptr_array_index(ptrarray_t *pa, long index); | ||
| 36 | #endif | 39 | #endif |
