apfl/src/format.h

31 lines
499 B
C
Raw Normal View History

#ifndef APFL_FORMAT_H
#define APFL_FORMAT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include "apfl.h"
#define FMT_TRY(x) do { if (!(x)) return false; } while (0)
2023-01-24 20:22:22 +00:00
struct format_spec {
const char *name;
bool (*callback)(void *, struct apfl_io_writer, struct apfl_string_view arg);
2023-01-24 20:22:22 +00:00
};
bool apfl_abstract_format(
void *opaque,
const struct format_spec *specs,
struct apfl_io_writer w,
2023-01-24 20:22:22 +00:00
struct apfl_string_view fmt
);
#ifdef __cplusplus
}
#endif
#endif