Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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
51void
53
59void*
60lumiera_tmpbuf_provide (size_t size);
61
68char*
69lumiera_tmpbuf_strndup (const char* src, size_t size);
70
78char*
79lumiera_tmpbuf_snprintf (size_t size, const char* fmt, ...);
80
81
92char*
93lumiera_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
108char*
109lumiera_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_tr(const char *in, const char *from, const char *to, const char *def)
Translates characters in a string, similar to the shell 'tr' utility.
Definition tmpbuf.c:147
char * lumiera_tmpbuf_strndup(const char *src, size_t size)
Duplicate string to a tmpbuf.
Definition tmpbuf.c:102
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
void * lumiera_tmpbuf_provide(size_t size)
Query a thread local tmpbuf.
Definition tmpbuf.c:80