1 /* ccparray.c - A simple dynamic array for character pointer. 2 * Copyright (C) 2016 g10 Code GmbH 3 * 4 * This file is part of GnuPG. 5 * 6 * This file is free software; you can redistribute it and/or modify 7 * it under the terms of either 8 * 9 * - the GNU Lesser General Public License as published by the Free 10 * Software Foundation; either version 3 of the License, or (at 11 * your option) any later version. 12 * 13 * or 14 * 15 * - the GNU General Public License as published by the Free 16 * Software Foundation; either version 2 of the License, or (at 17 * your option) any later version. 18 * 19 * or both in parallel, as here. 20 * 21 * This file is distributed in the hope that it will be useful, 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 * GNU General Public License for more details. 25 * 26 * You should have received a copy of the GNU General Public License 27 * along with this program; if not, see <https://www.gnu.org/licenses/>. 28 */ 29 30 #ifndef GNUPG_COMMON_CCPARRAY_H 31 #define GNUPG_COMMON_CCPARRAY_H 32 33 /* The definition of the structure is private, we only need it here, 34 * so it can be allocated on the stack. */ 35 struct _ccparray_private_s 36 { 37 unsigned int count; 38 unsigned int size; 39 int out_of_core; 40 const char **array; 41 }; 42 43 typedef struct _ccparray_private_s ccparray_t; 44 45 46 void ccparray_init (ccparray_t *cpa, unsigned int initialsize); 47 void ccparray_put (ccparray_t *cpa, const char *value); 48 const char **ccparray_get (ccparray_t *cpa, size_t *r_nelems); 49 50 51 #endif /*GNUPG_COMMON_CCPARRAY_H*/ 52