aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-08 23:04:40 +0100
committerMattias Andrée <maandree@kth.se>2023-01-08 23:04:40 +0100
commit930a75074eff7f1d3c91b3a244d47066247d7cd5 (patch)
tree177183a157223ba6d089822d3c7ee0b75e59dbab /common.h
parentm + add tests (diff)
downloadlibfonts-930a75074eff7f1d3c91b3a244d47066247d7cd5.tar.gz
libfonts-930a75074eff7f1d3c91b3a244d47066247d7cd5.tar.bz2
libfonts-930a75074eff7f1d3c91b3a244d47066247d7cd5.tar.xz
Print warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/common.h b/common.h
index fe0d5ad..1047e2f 100644
--- a/common.h
+++ b/common.h
@@ -6,6 +6,7 @@
#include <inttypes.h>
#include <limits.h>
#include <pwd.h>
+#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -124,6 +125,18 @@
static inline void
+warning(struct libfonts_context *ctx, int err, const char *function, const char *fmt, ...)
+{
+ va_list args;
+ if (ctx && ctx->warning) {
+ va_start(args, fmt);
+ ctx->warning(err, function, fmt, args, ctx->user);
+ va_end(args);
+ }
+}
+
+
+static inline void
transform(double *x_out, double *y_out, double x, double y, const struct libfonts_transformation *transformation)
{
double a = transformation->m[0][0], b = transformation->m[0][1], c = transformation->m[0][2];