5
Last change
on this file since 24d0ee57 was
24d0ee57,
checked in by Chris Johns <chrisj@…>, on 05/20/16 at 08:39:50
|
cpukit, testsuite: Add rtems_printf and rtems_printer support.
This change adds rtems_printf and related functions and wraps the
RTEMS print plugin support into a user API. All references to the
plugin are removed and replaced with the rtems_printer interface.
Printk and related functions are made to return a valid number of
characters formatted and output.
The function attribute to check printf functions has been added
to rtems_printf and printk. No changes to remove warrnings are part
of this patch set.
The testsuite has been moved over to the rtems_printer. The testsuite
has a mix of rtems_printer access and direct print control via the
tmacros.h header file. The support for begink/endk has been removed
as it served no purpose and only confused the code base. The testsuite
has not been refactored to use rtems_printf. This is future work.
|
-
Property mode set to
100644
|
File size:
774 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Plugin Printf |
---|
5 | * @ingroup libcsupport |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * Copyright (c) 2012 embedded brains GmbH. All rights reserved. |
---|
10 | * |
---|
11 | * embedded brains GmbH |
---|
12 | * Obere Lagerstr. 30 |
---|
13 | * 82178 Puchheim |
---|
14 | * Germany |
---|
15 | * <rtems@embedded-brains.de> |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifdef HAVE_CONFIG_H |
---|
23 | #include "config.h" |
---|
24 | #endif |
---|
25 | |
---|
26 | #include <rtems/print.h> |
---|
27 | |
---|
28 | #include <stdio.h> |
---|
29 | |
---|
30 | void rtems_print_printer_printf(rtems_printer *printer) |
---|
31 | { |
---|
32 | printer->context = NULL; |
---|
33 | printer->printer = rtems_printf_plugin; |
---|
34 | } |
---|
35 | |
---|
36 | int rtems_printf_plugin(void *context, const char *format, va_list ap) |
---|
37 | { |
---|
38 | (void) context; |
---|
39 | return vprintf(format, ap); |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.