From 8135dd6a753d5f63b41c2bb908ac3f58603e044c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 30 Jul 2018 13:48:35 +0200 Subject: Initial commit. --- log.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 log.h (limited to 'log.h') diff --git a/log.h b/log.h new file mode 100644 index 0000000..99fa9d1 --- /dev/null +++ b/log.h @@ -0,0 +1,33 @@ +/* + * Logging infrastructure + * Copyright 2017 Anton Khirnov + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef MG2D_LOG_H +#define MG2D_LOG_H + +#include + +typedef struct MG2DLogger { + void *opaque; + void (*log)(struct MG2DLogger *log, int level, const char *fmt, va_list vl); +} MG2DLogger; + +void mg2di_log(MG2DLogger *log, int level, const char *fmt, ...); +void mg2di_log_default_callback(MG2DLogger *log, int level, + const char *fmt, va_list vl); + +#endif // MG2D_LOG_H -- cgit v1.2.3