]> git.zerfleddert.de Git - proxmark3-svn/blame - client/jansson/strbuffer.h
Update README.md
[proxmark3-svn] / client / jansson / strbuffer.h
CommitLineData
556826b5
OM
1/*
2 * Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
3 *
4 * Jansson is free software; you can redistribute it and/or modify
5 * it under the terms of the MIT license. See LICENSE for details.
6 */
7
8#ifndef STRBUFFER_H
9#define STRBUFFER_H
10
11#include <stdlib.h>
12
13typedef struct {
14 char *value;
15 size_t length; /* bytes used */
16 size_t size; /* bytes allocated */
17} strbuffer_t;
18
6a2bd857 19int strbuffer_init(strbuffer_t *strbuff) JANSSON_ATTRS(warn_unused_result);
556826b5
OM
20void strbuffer_close(strbuffer_t *strbuff);
21
22void strbuffer_clear(strbuffer_t *strbuff);
23
24const char *strbuffer_value(const strbuffer_t *strbuff);
25
26/* Steal the value and close the strbuffer */
27char *strbuffer_steal_value(strbuffer_t *strbuff);
28
29int strbuffer_append_byte(strbuffer_t *strbuff, char byte);
30int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size);
31
32char strbuffer_pop(strbuffer_t *strbuff);
33
34#endif
Impressum, Datenschutz