RTEMS
print_printf.c
Go to the documentation of this file.
1 
8 /*
9  * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>
10  * All rights reserved.
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include <rtems/printer.h>
22 
24  const rtems_printer *printer,
25  const char *format,
26  va_list ap
27 )
28 {
29  int len = 0;
30  if ( rtems_print_printer_valid( printer ) ) {
31  len = printer->printer( printer->context, format, ap );
32  }
33  return len;
34 }
35 
36 int rtems_printf(
37  const rtems_printer *printer,
38  const char *format,
39  ...
40 )
41 {
42  int len = 0;
43  if ( rtems_print_printer_valid( printer ) ) {
44  va_list ap;
45  va_start( ap, format );
46  len = printer->printer( printer->context, format, ap );
47  va_end( ap );
48  }
49  return len;
50 }
static bool rtems_print_printer_valid(const rtems_printer *printer)
check if the printer is valid.
Definition: printer.h:67
User print interface to the bspIO print plug in.