]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | * Copyright 2004. David Abrahams | |
3 | * Distributed under the Boost Software License, Version 1.0. | |
4 | * (See accompanying file LICENSE_1_0.txt or copy at | |
5 | * http://www.boost.org/LICENSE_1_0.txt) | |
6 | */ | |
7 | ||
8 | #ifndef STRINGS_DWA20011024_H | |
9 | #define STRINGS_DWA20011024_H | |
10 | ||
92f5a8d4 | 11 | #include "config.h" |
7c673cae FG |
12 | #include <stddef.h> |
13 | ||
14 | typedef struct string | |
15 | { | |
16 | char * value; | |
17 | unsigned long size; | |
18 | unsigned long capacity; | |
19 | char opt[ 32 ]; | |
20 | #ifndef NDEBUG | |
21 | char magic[ 4 ]; | |
22 | #endif | |
23 | } string; | |
24 | ||
25 | void string_new( string * ); | |
26 | void string_copy( string *, char const * ); | |
27 | void string_free( string * ); | |
28 | void string_append( string *, char const * ); | |
29 | void string_append_range( string *, char const *, char const * ); | |
30 | void string_push_back( string * s, char x ); | |
31 | void string_reserve( string *, size_t ); | |
32 | void string_truncate( string *, size_t ); | |
33 | void string_pop_back( string * ); | |
34 | char string_back( string * ); | |
b32b8144 | 35 | void string_rtrim( string * ); |
7c673cae FG |
36 | void string_unit_test(); |
37 | ||
38 | #endif |