libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
format.c
1#include <clod/stream.h>
2
3int clod_stream_format(clod_stream *dst, struct clod_string fmt, ...) {
4 va_list args;
5 va_start(args, fmt);
6 const int res = clod_stream_vformat(dst, fmt, args);
7 va_end(args);
8 return res;
9}
10
11int clod_stream_vformat(clod_stream *dst, struct clod_string fmt, va_list args) {
12 struct clod_string buff = CLOD_STRING_NEW(256);
13 clod_string_vformat(&buff, fmt, args);
14 return dst->write(dst, &buff);
15}
#define CLOD_STRING_NEW(size)
Create a new empty string with the given capacity on the stack.
Definition string.h:46
int(* write)(clod_stream *self, struct clod_string *src)
Definition stream.h:88