9void Format::enlarge () {
11 buffer =
new char[size = size ? 2 * size : 1];
12 memcpy (buffer, old, count);
16inline void Format::push_char (
char ch) {
22void Format::push_string (
const char *s) {
28void Format::push_int (
int d) {
30 snprintf (tmp,
sizeof tmp,
"%d", d);
34void Format::push_uint64 (uint64_t u) {
36 snprintf (tmp,
sizeof tmp,
"%" PRIu64, u);
40static bool match_format (
const char *&str,
const char *pattern) {
43 const char *q = pattern;
51const char *Format::add (
const char *fmt, va_list &ap) {
58 push_char (va_arg (ap,
int)),
p++;
60 push_int (va_arg (ap,
int)),
p++;
62 push_string (va_arg (ap,
const char *)),
p++;
63 else if (match_format (
p, PRIu64))
64 push_uint64 (va_arg (ap, uint64_t));
80 const char *res = add (fmt, ap);
88 const char *res = add (fmt, ap);
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)