Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
regenerate flex generated files with a more recent flex (not mandatory, but cmake...
[simgrid.git] / include / xbt / strbuff.h
1 /* $Id: buff.h 3483 2007-05-07 11:18:56Z mquinson $ */
2
3 /* strbuff -- string buffers                                                */
4
5 /* Copyright (c) 2007 Martin Quinson.                                       */
6 /* All rights reserved.                                                     */
7
8 /* This program is free software; you can redistribute it and/or modify it
9  * under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #ifndef XBT_STRBUFF_H
12 #define XBT_STRBUFF_H
13
14 #include "xbt/sysdep.h"
15 #include "xbt/function_types.h"
16 #include "xbt/log.h"
17 #include "xbt/str.h"
18 #include "xbt/dict.h"
19
20 /**
21  ** Buffer code
22  **/
23 typedef struct {
24   char *data;
25   int used, size;
26 } s_xbt_strbuff_t, *xbt_strbuff_t;
27
28
29 XBT_PUBLIC(void) xbt_strbuff_empty(xbt_strbuff_t b);
30 XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new(void);
31 XBT_INLINE XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new_from(char *s);
32 XBT_PUBLIC(void) xbt_strbuff_free(xbt_strbuff_t b);
33 XBT_INLINE XBT_PUBLIC(void) xbt_strbuff_free_container(xbt_strbuff_t b);
34 XBT_PUBLIC(void) xbt_strbuff_append(xbt_strbuff_t b, const char *toadd);
35 XBT_PUBLIC(void) xbt_strbuff_chomp(xbt_strbuff_t b);
36 XBT_PUBLIC(void) xbt_strbuff_trim(xbt_strbuff_t b);
37 XBT_PUBLIC(void) xbt_strbuff_varsubst(xbt_strbuff_t b, xbt_dict_t patterns);
38
39 #endif