xref: /aosp_15_r20/external/libconfig/lib/strbuf.h (revision 2e9d491483b805f09ea864149eadd5680efcc72a)
1*2e9d4914SAndroid Build Coastguard Worker /* ----------------------------------------------------------------------------
2*2e9d4914SAndroid Build Coastguard Worker    libconfig - A library for processing structured configuration files
3*2e9d4914SAndroid Build Coastguard Worker    Copyright (C) 2005-2020  Mark A Lindner
4*2e9d4914SAndroid Build Coastguard Worker 
5*2e9d4914SAndroid Build Coastguard Worker    This file is part of libconfig.
6*2e9d4914SAndroid Build Coastguard Worker 
7*2e9d4914SAndroid Build Coastguard Worker    This library is free software; you can redistribute it and/or
8*2e9d4914SAndroid Build Coastguard Worker    modify it under the terms of the GNU Lesser General Public License
9*2e9d4914SAndroid Build Coastguard Worker    as published by the Free Software Foundation; either version 2.1 of
10*2e9d4914SAndroid Build Coastguard Worker    the License, or (at your option) any later version.
11*2e9d4914SAndroid Build Coastguard Worker 
12*2e9d4914SAndroid Build Coastguard Worker    This library is distributed in the hope that it will be useful, but
13*2e9d4914SAndroid Build Coastguard Worker    WITHOUT ANY WARRANTY; without even the implied warranty of
14*2e9d4914SAndroid Build Coastguard Worker    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15*2e9d4914SAndroid Build Coastguard Worker    Lesser General Public License for more details.
16*2e9d4914SAndroid Build Coastguard Worker 
17*2e9d4914SAndroid Build Coastguard Worker    You should have received a copy of the GNU Library General Public
18*2e9d4914SAndroid Build Coastguard Worker    License along with this library; if not, see
19*2e9d4914SAndroid Build Coastguard Worker    <http://www.gnu.org/licenses/>.
20*2e9d4914SAndroid Build Coastguard Worker    ----------------------------------------------------------------------------
21*2e9d4914SAndroid Build Coastguard Worker */
22*2e9d4914SAndroid Build Coastguard Worker 
23*2e9d4914SAndroid Build Coastguard Worker #ifndef __libconfig_strbuf_h
24*2e9d4914SAndroid Build Coastguard Worker #define __libconfig_strbuf_h
25*2e9d4914SAndroid Build Coastguard Worker 
26*2e9d4914SAndroid Build Coastguard Worker #include <string.h>
27*2e9d4914SAndroid Build Coastguard Worker #include <sys/types.h>
28*2e9d4914SAndroid Build Coastguard Worker 
29*2e9d4914SAndroid Build Coastguard Worker typedef struct
30*2e9d4914SAndroid Build Coastguard Worker {
31*2e9d4914SAndroid Build Coastguard Worker   char *string;
32*2e9d4914SAndroid Build Coastguard Worker   size_t length;
33*2e9d4914SAndroid Build Coastguard Worker   size_t capacity;
34*2e9d4914SAndroid Build Coastguard Worker } strbuf_t;
35*2e9d4914SAndroid Build Coastguard Worker 
36*2e9d4914SAndroid Build Coastguard Worker void libconfig_strbuf_append_string(strbuf_t *buf, const char *s);
37*2e9d4914SAndroid Build Coastguard Worker 
38*2e9d4914SAndroid Build Coastguard Worker void libconfig_strbuf_append_char(strbuf_t *buf, char c);
39*2e9d4914SAndroid Build Coastguard Worker 
40*2e9d4914SAndroid Build Coastguard Worker char *libconfig_strbuf_release(strbuf_t *buf);
41*2e9d4914SAndroid Build Coastguard Worker 
42*2e9d4914SAndroid Build Coastguard Worker #endif /* __libconfig_strbuf_h */
43