dpkg 1.21.11
Data Structures | Macros | Functions
varbuf.h File Reference

(b630e2495)

#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <dpkg/macros.h>
Include dependency graph for varbuf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  varbuf
 varbuf_init must be called exactly once before the use of each varbuf (including before any call to varbuf_destroy), or the variable must be initialized with VARBUF_INIT. More...
 
struct  varbuf_state
 

Macros

#define VARBUF_INIT   { 0, 0, NULL }
 
#define VARBUF_OBJECT   (struct varbuf)VARBUF_INIT
 
#define varbuf_add_str(v, s)   varbuf_add_buf(v, s, strlen(s))
 

Functions

struct varbufvarbuf_new (size_t size)
 
void varbuf_init (struct varbuf *v, size_t size)
 
void varbuf_grow (struct varbuf *v, size_t need_size)
 
void varbuf_trunc (struct varbuf *v, size_t used_size)
 
char * varbuf_detach (struct varbuf *v)
 
void varbuf_reset (struct varbuf *v)
 
void varbuf_destroy (struct varbuf *v)
 
void varbuf_free (struct varbuf *v)
 
void varbuf_add_char (struct varbuf *v, int c)
 
void varbuf_dup_char (struct varbuf *v, int c, size_t n)
 
void varbuf_map_char (struct varbuf *v, int c_src, int c_dst)
 
void varbuf_add_dir (struct varbuf *v, const char *dirname)
 
void varbuf_add_buf (struct varbuf *v, const void *s, size_t size)
 
void varbuf_end_str (struct varbuf *v)
 
const char * varbuf_get_str (struct varbuf *v)
 
int varbuf_printf (struct varbuf *v, const char *fmt,...) DPKG_ATTR_PRINTF(2)
 
int varbuf_vprintf (struct varbuf *v, const char *fmt, va_list va) DPKG_ATTR_VPRINTF(2)
 
void varbuf_snapshot (struct varbuf *v, struct varbuf_state *vs)
 
void varbuf_rollback (struct varbuf_state *vs)
 
size_t varbuf_rollback_len (struct varbuf_state *vs)
 
const char * varbuf_rollback_start (struct varbuf_state *vs)