summaryrefslogtreecommitdiff
path: root/kern/log.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2019-05-22 21:59:19 +0200
committerRichard Braun <rbraun@sceen.net>2019-05-22 21:59:19 +0200
commit5bc2263b54a89e28dd5092c807a86cd3c078e4d3 (patch)
treead399e98a6d46bad25543a4f8680335f3abb1bf8 /kern/log.h
parentc45d94a590d778c26dc78386c41231fed9df1b14 (diff)
Add a log print function type for information reporting
This type allows the use of either printf-based or log-based functions when reporting information.
Diffstat (limited to 'kern/log.h')
-rw-r--r--kern/log.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/kern/log.h b/kern/log.h
index 554dbb27..af5e009f 100644
--- a/kern/log.h
+++ b/kern/log.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 Richard Braun.
+ * Copyright (c) 2017-2019 Richard Braun.
*
* 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
@@ -38,6 +38,15 @@ enum {
};
/*
+ * Type for function pointers that may be used as either a log function
+ * or printf.
+ *
+ * One call to a log print function produces a single log line, with a
+ * newline character.
+ */
+typedef int (*log_print_fn_t)(const char *format, ...);
+
+/*
* Generate a message and send it to the log thread.
*
* The arguments and return value are similar to printf(), with