librnr  1.14.5
RoadNarrows Robotics Common Library 1
color.c
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: RoadNarrows Robotics Common Library 1
4 //
5 // Library: librnr
6 //
7 // File: color.c
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2013-10-03 10:33:30 -0600 (Thu, 03 Oct 2013) $
12  * $Rev: 3344 $
13  *
14  * \brief Non-GUI color systems.
15  *
16  * \author Robin Knight (robin.knight@roadnarrows.com)
17  *
18  * \pkgcopyright{2013-2018,RoadNarrows LLC.,http://www.roadnarrows.com}
19  *
20  * \EulaBegin
21  * See the README and EULA files for any copyright and licensing information.
22  * \EulaEnd
23  */
24 ////////////////////////////////////////////////////////////////////////////////
25 
26 #include <stdio.h>
27 #include <stdarg.h>
28 
29 #include "rnr/rnrconfig.h"
30 #include "rnr/color.h"
31 
32 int colorprintf(const char *sFgColor, const char *sFmt, ...)
33 {
34  va_list ap;
35  int n;
36 
37  set_color(sFgColor);
38  va_start(ap, sFmt);
39  n = vfprintf(stdout, sFmt, ap);
40  va_end(ap);
41  reset_colors();
42  return n;
43 }
int colorprintf(const char *sFgColor, const char *sFmt,...)
Print output in the specified foreground color.
Definition: color.c:32
INLINE_IN_H void set_color(const char *sColor)
Set foreground or background color.
Definition: color.h:219
INLINE_IN_H void reset_colors()
Reset foreground and background colors to defaults.
Definition: color.h:227
RoadNarrows Robotics common configuration file.
Non-GUI color systems.