Lumiera  0.pre.03
»edit your freedom«
tmpbuf.h
Go to the documentation of this file.
1 /*
2  TMPBUF.h - Round Robin Temporary buffers
3 
4  Copyright (C) Lumiera.org
5  2008, 2010 Christian Thaeter <ct@pipapo.org>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
38 #ifndef LUMIERA_TMPBUF_H
39 #define LUMIERA_TMPBUF_H
40 
41 #include <stdlib.h>
42 
43 
44 
52 #define LUMIERA_TMPBUF_NUM 16
53 
54 
55 
60 void
62 
68 void*
69 lumiera_tmpbuf_provide (size_t size);
70 
77 char*
78 lumiera_tmpbuf_strndup (const char* src, size_t size);
79 
87 char*
88 lumiera_tmpbuf_snprintf (size_t size, const char* fmt, ...);
89 
90 
101 char*
102 lumiera_tmpbuf_strcat3 (const char* str1, size_t str1_len,
103  const char* str2, size_t str2_len,
104  const char* str3, size_t str3_len);
105 
117 char*
118 lumiera_tmpbuf_tr (const char* in, const char* from, const char* to, const char* def);
119 
120 
121 #endif
122 /*
123 // Local Variables:
124 // mode: C
125 // c-file-style: "gnu"
126 // indent-tabs-mode: nil
127 // End:
128 */
char * lumiera_tmpbuf_strcat3(const char *str1, size_t str1_len, const char *str2, size_t str2_len, const char *str3, size_t str3_len)
Concat up to 3 strings in a tmpbuf.
Definition: tmpbuf.c:144
char * lumiera_tmpbuf_snprintf(size_t size, const char *fmt,...)
Construct a string in a tmpbuf.
Definition: tmpbuf.c:125
void lumiera_tmpbuf_freeall(void)
free all buffers associated with this thread.
Definition: tmpbuf.c:73
char * lumiera_tmpbuf_strndup(const char *src, size_t size)
Duplicate string to a tmpbuf.
Definition: tmpbuf.c:111
void * lumiera_tmpbuf_provide(size_t size)
Query a thread local tmpbuf.
Definition: tmpbuf.c:89
char * lumiera_tmpbuf_tr(const char *in, const char *from, const char *to, const char *def)
Translates characters in a string, similar to the shell &#39;tr&#39; utility.
Definition: tmpbuf.c:156