PIPS
newgen_string_buffer.h
Go to the documentation of this file.
1 /*
2 
3  $Id: newgen_string_buffer.h 1357 2016-03-02 08:18:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of NewGen.
8 
9  NewGen is free software: you can redistribute it and/or modify it under the
10  terms of the GNU General Public License as published by the Free Software
11  Foundation, either version 3 of the License, or any later version.
12 
13  NewGen is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16  License for more details.
17 
18  You should have received a copy of the GNU General Public License along with
19  NewGen. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 /* minimal a la java StringBuffer... */
23 
24 #ifndef STRING_BUFFER_INCLUDED
25 #define STRING_BUFFER_INCLUDED
26 
28 
29 // CONSTRUCTOR
31 // DESTRUCTORS
34 // TEST
35 size_t string_buffer_size(const string_buffer);
37 // OPERATIONS
39 void string_buffer_append(string_buffer, const string);
40 void string_buffer_cat(string_buffer, const string, ...);
43 void string_buffer_printf_alist(string_buffer, const string, va_list *);
44 void string_buffer_printf(string_buffer, const string, ...);
45 // CONVERSIONS
48 void string_buffer_to_file(const string_buffer, FILE *);
50 void string_buffer_append_xml_text(string_buffer, const string, bool);
51 
52 #endif /* STRING_BUFFER_INCLUDED */
void string_buffer_free_all(string_buffer *)
free string buffer structure and force string freeing
Definition: string_buffer.c:94
void string_buffer_append_c_string_buffer(const string_buffer, string_buffer, int)
put string buffer as a C-string definition of the string buffer, including external double-quotes.
void string_buffer_append_sb(string_buffer, const string_buffer)
append the string buffer sb2 to string buffer sb.
void string_buffer_append(string_buffer, const string)
append string s (if non empty) to string buffer sb, the duplication is done if needed according to th...
size_t string_buffer_size(const string_buffer)
return the size of the string in string_buffer sb
void string_buffer_printf(string_buffer, const string,...)
append a formatted string to sb
string string_buffer_to_string(const string_buffer)
return malloc'ed string from string buffer sb
void string_buffer_to_file(const string_buffer, FILE *)
put string buffer into file.
void string_buffer_free(string_buffer *)
free string buffer structure, also free string contents according to the dup field
Definition: string_buffer.c:82
void string_buffer_printf_alist(string_buffer, const string, va_list *)
formatted alist version
void string_buffer_reset(string_buffer)
remove stack contents
Definition: string_buffer.c:70
struct __string_buffer_head * string_buffer
minimal a la java StringBuffer...
string_buffer string_buffer_make(bool dup)
allocate a new string buffer
Definition: string_buffer.c:58
void string_buffer_append_list(string_buffer, const list)
append a list of string to a string buffer.
bool string_buffer_empty_p(const string_buffer)
return whether string_buffer sb is empty.
string string_buffer_to_string_reverse(const string_buffer)
return malloc'ed string from string buffer sb going from bottom to top
void string_buffer_cat(string_buffer, const string,...)
append a NULL terminated list of string to sb.
void string_buffer_append_xml_text(string_buffer, const string, bool)
append a string with XML escapes
internally defined structure.
Definition: string_buffer.c:47
The structure used to build lists in NewGen.
Definition: newgen_list.h:41