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 JAM_STRINGS_DWA20011024_H 9 #define JAM_STRINGS_DWA20011024_H 10 11 #include "config.h" 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 * ); 35 void string_rtrim( string * ); 36 void string_unit_test(); 37 38 #endif 39