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)
5  2008, 2010 Christian Thaeter <ct@pipapo.org>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
29 #ifndef LUMIERA_TMPBUF_H
30 #define LUMIERA_TMPBUF_H
31 
32 #include <stdlib.h>
33 
34 
35 
43 #define LUMIERA_TMPBUF_NUM 16
44 
45 
46 
51 void
53 
59 void*
60 lumiera_tmpbuf_provide (size_t size);
61 
68 char*
69 lumiera_tmpbuf_strndup (const char* src, size_t size);
70 
78 char*
79 lumiera_tmpbuf_snprintf (size_t size, const char* fmt, ...);
80 
81 
92 char*
93 lumiera_tmpbuf_strcat3 (const char* str1, size_t str1_len,
94  const char* str2, size_t str2_len,
95  const char* str3, size_t str3_len);
96 
108 char*
109 lumiera_tmpbuf_tr (const char* in, const char* from, const char* to, const char* def);
110 
111 
112 #endif
113 /*
114 // Local Variables:
115 // mode: C
116 // c-file-style: "gnu"
117 // indent-tabs-mode: nil
118 // End:
119 */
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:135
char * lumiera_tmpbuf_snprintf(size_t size, const char *fmt,...)
Construct a string in a tmpbuf.
Definition: tmpbuf.c:116
void lumiera_tmpbuf_freeall(void)
free all buffers associated with this thread.
Definition: tmpbuf.c:64
char * lumiera_tmpbuf_strndup(const char *src, size_t size)
Duplicate string to a tmpbuf.
Definition: tmpbuf.c:102
void * lumiera_tmpbuf_provide(size_t size)
Query a thread local tmpbuf.
Definition: tmpbuf.c:80
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:147