PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
stringlist.h
Go to the documentation of this file.
1/**********************************************************************
2 *
3 * PostGIS - Spatial Types for PostgreSQL
4 * http://postgis.net
5 *
6 * PostGIS 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 * PostGIS 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 PostGIS. If not, see <http://www.gnu.org/licenses/>.
18 *
19 **********************************************************************
20 *
21 * Copyright 2021 Paul Ramsey <pramsey@cleverelephant.ca>
22 *
23 **********************************************************************/
24
25
26#ifndef _STRINGLIST_H
27#define _STRINGLIST_H 1
28
29#include "liblwgeom_internal.h"
30
31
32#include <stdlib.h>
33#include <stdarg.h>
34#include <string.h>
35#include <stdio.h>
36
37#define STRINGLIST_STARTSIZE 8
38
39typedef struct
40{
41 size_t capacity;
42 size_t length;
43 char **data;
44}
46
47
48extern stringlist_t * stringlist_create_with_size(size_t size);
49extern stringlist_t * stringlist_create(void);
51
52extern void stringlist_init(stringlist_t *s);
54
55extern void stringlist_add_string(stringlist_t *s, const char* string);
56extern void stringlist_add_string_nosort(stringlist_t *s, const char* string);
57extern void stringlist_sort(stringlist_t *s);
58extern const char * stringlist_find(stringlist_t *s, const char *key);
59extern size_t stringlist_length(stringlist_t *s);
60extern const char * stringlist_get(stringlist_t *s, size_t i);
61
62
63#endif
64
char * s
Definition cu_in_wkt.c:23
stringlist_t * stringlist_create(void)
Definition stringlist.c:71
void stringlist_init(stringlist_t *s)
Definition stringlist.c:44
size_t stringlist_length(stringlist_t *s)
Definition stringlist.c:137
void stringlist_release(stringlist_t *s)
Definition stringlist.c:50
void stringlist_add_string_nosort(stringlist_t *s, const char *string)
Definition stringlist.c:117
void stringlist_add_string(stringlist_t *s, const char *string)
Definition stringlist.c:111
void stringlist_sort(stringlist_t *s)
Definition stringlist.c:123
stringlist_t * stringlist_create_with_size(size_t size)
Definition stringlist.c:62
const char * stringlist_find(stringlist_t *s, const char *key)
Definition stringlist.c:129
void stringlist_destroy(stringlist_t *s)
Definition stringlist.c:77
const char * stringlist_get(stringlist_t *s, size_t i)
Definition stringlist.c:143
char ** data
Definition stringlist.h:43
size_t length
Definition stringlist.h:42
size_t capacity
Definition stringlist.h:41