summaryrefslogtreecommitdiffstats
path: root/cpukit/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-21 13:30:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-22 07:29:26 +0200
commit506bfc8580c365c48f2200772ddd0985e661ae34 (patch)
tree66f6c17573377ee1e14556d102df974db66e2a23 /cpukit/include
parentMake rtems/print.h independent of rtems/bspIo.h (diff)
downloadrtems-506bfc8580c365c48f2200772ddd0985e661ae34.tar.bz2
Move printer initialization to separate header
The RTEMS print user need to know nothing about a particular printer implementation. In particular get rid of the <stdio.h> include which would be visible via <rtems.h>.
Diffstat (limited to 'cpukit/include')
-rw-r--r--cpukit/include/rtems/print.h83
-rw-r--r--cpukit/include/rtems/printer.h119
2 files changed, 124 insertions, 78 deletions
diff --git a/cpukit/include/rtems/print.h b/cpukit/include/rtems/print.h
index 07e50d0948..2fd744e44c 100644
--- a/cpukit/include/rtems/print.h
+++ b/cpukit/include/rtems/print.h
@@ -21,53 +21,21 @@
#include <rtems/score/basedefs.h>
#include <stdarg.h>
-#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
+typedef struct rtems_printer rtems_printer;
+
/**
- * @defgroup RTEMS Print Support
+ * @defgroup RTEMSPrintSupport RTEMS Print Support
*
* This module contains all methods and support related to providing the user
* with an interface to the kernel level print support.
*/
/**
- * Type definition for function which can be plugged in to certain reporting
- * routines to redirect the output.
- *
- * Use the RTEMS Print interface to call these functions. Do not directly use
- * them.
- *
- * If the user provides their own printer, then they may redirect those reports
- * as they see fit.
- */
-typedef int (*rtems_print_printer)(void *, const char *format, va_list ap);
-
-/**
- * Type definition for the printer structure used to access the kernel print
- * support.
- */
-typedef struct rtems_printer {
- void *context;
- rtems_print_printer printer;
-} rtems_printer;
-
-/**
- * @brief check if the printer is valid.
- *
- * @param[in] printer Pointer to the printer structure.
- *
- * @return true The printer is valid else false is returned.
- */
-static inline bool rtems_print_printer_valid(const rtems_printer *printer)
-{
- return printer != NULL && printer->printer != NULL;
-}
-
-/**
* @brief Print to the kernel plugin handler. This has to be a macro because
* there is no vprint version of the plug in handlers.
*
@@ -95,51 +63,10 @@ extern int rtems_vprintf(const rtems_printer *printer,
const char *format,
va_list ap);
-/**
- * @brief Intiialise the rtems_printer struct to empty.
- *
- * An empty printer prints nothing. You can use this to implement an enable and
- * disable type print implementation.
- *
- * @param[in] printer Pointer to the printer structure.
- */
-static inline void rtems_print_printer_empty(rtems_printer *printer)
-{
- printer->context = NULL;
- printer->printer = NULL;
-}
-
-/**
- * @brief Intiialise the rtems_printer struct to printk
- *
- * The printer will output to the kernel printk support.
- *
- * @param[in] printer Pointer to the printer structure.
- */
-void rtems_print_printer_printk(rtems_printer *printer);
-
-/**
- * @brief Intiialise the rtems_printer struct to printf
- *
- * The printer will output to the libc printf support.
- *
- * @param[in] printer Pointer to the printer structure.
- */
-extern void rtems_print_printer_printf(rtems_printer *printer);
-
-/**
- * @brief Intiialise the rtems_printer struct to a fprintf device.
- *
- * The printer will output to the libc fprintf file provided.
- *
- * @param[in] printer Pointer to the printer structure.
- */
-extern void rtems_print_printer_fprintf(rtems_printer *printer, FILE *file);
-
-/**@}*/
+/** @} */
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _RTEMS_PRINT_H */
diff --git a/cpukit/include/rtems/printer.h b/cpukit/include/rtems/printer.h
new file mode 100644
index 0000000000..2ed6b6ac3f
--- /dev/null
+++ b/cpukit/include/rtems/printer.h
@@ -0,0 +1,119 @@
+/**
+ * @file rtems/print.h
+ *
+ * @brief User print interface to the bspIO print plug in.
+ *
+ * This include file defines the user interface to kernel print methods.
+ */
+
+/*
+ * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>
+ * All rights reserved.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RTEMS_PRINTER_H
+#define _RTEMS_PRINTER_H
+
+#include <rtems/print.h>
+
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup XXX
+ *
+ * @{
+ */
+
+/**
+ * @defgroup RTEMSPrintSupport
+ */
+
+/**
+ * Type definition for function which can be plugged in to certain reporting
+ * routines to redirect the output.
+ *
+ * Use the RTEMS Print interface to call these functions. Do not directly use
+ * them.
+ *
+ * If the user provides their own printer, then they may redirect those reports
+ * as they see fit.
+ */
+typedef int (*rtems_print_printer)(void *, const char *format, va_list ap);
+
+/**
+ * Type definition for the printer structure used to access the kernel print
+ * support.
+ */
+struct rtems_printer {
+ void *context;
+ rtems_print_printer printer;
+};
+
+/**
+ * @brief check if the printer is valid.
+ *
+ * @param[in] printer Pointer to the printer structure.
+ *
+ * @return true The printer is valid else false is returned.
+ */
+static inline bool rtems_print_printer_valid(const rtems_printer *printer)
+{
+ return printer != NULL && printer->printer != NULL;
+}
+
+/**
+ * @brief Initializes the rtems_printer struct to empty.
+ *
+ * An empty printer prints nothing. You can use this to implement an enable and
+ * disable type print implementation.
+ *
+ * @param[in] printer Pointer to the printer structure.
+ */
+static inline void rtems_print_printer_empty(rtems_printer *printer)
+{
+ printer->context = NULL;
+ printer->printer = NULL;
+}
+
+/**
+ * @brief Initializes the rtems_printer struct to printk
+ *
+ * The printer will output to the kernel printk support.
+ *
+ * @param[in] printer Pointer to the printer structure.
+ */
+void rtems_print_printer_printk(rtems_printer *printer);
+
+/**
+ * @brief Initializes the rtems_printer struct to printf
+ *
+ * The printer will output to the libc printf support.
+ *
+ * @param[in] printer Pointer to the printer structure.
+ */
+extern void rtems_print_printer_printf(rtems_printer *printer);
+
+/**
+ * @brief Initializes the rtems_printer struct to a fprintf device.
+ *
+ * The printer will output to the libc fprintf file provided.
+ *
+ * @param[in] printer Pointer to the printer structure.
+ */
+extern void rtems_print_printer_fprintf(rtems_printer *printer, FILE *file);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_PRINTER_H */