Use appconfig.h instead of cfg/config.h.
[bertos.git] / mware / formatwr.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See devlib/README for information.
6  * -->
7  *
8  * \version $Id$
9  *
10  * \brief Basic "printf", "sprintf" and "fprintf" formatter.
11  */
12
13 /*#*
14  *#* $Log$
15  *#* Revision 1.9  2005/07/19 07:25:46  bernie
16  *#* Use appconfig.h instead of cfg/config.h.
17  *#*
18  *#* Revision 1.8  2005/04/11 19:10:28  bernie
19  *#* Include top-level headers from cfg/ subdir.
20  *#*
21  *#* Revision 1.7  2005/02/16 20:28:03  bernie
22  *#* Add %S formatter.
23  *#*
24  *#* Revision 1.6  2005/01/08 08:50:06  bernie
25  *#* Make more portable.
26  *#*
27  *#* Revision 1.5  2004/08/25 14:12:09  rasky
28  *#* Aggiornato il comment block dei log RCS
29  *#*
30  *#* Revision 1.4  2004/08/04 15:53:47  rasky
31  *#* Nuove opzioni di configurazione per formatted_write e ridotto maggiormente l'utilizzo dellos tack
32  *#*
33  *#* Revision 1.3  2004/07/29 22:57:09  bernie
34  *#* Add values for new-style CONFIG_PRINTF option.
35  *#*
36  *#* Revision 1.2  2004/06/03 11:27:09  bernie
37  *#* Add dual-license information.
38  *#*
39  *#* Revision 1.1  2004/05/23 15:43:16  bernie
40  *#* Import mware modules.
41  *#*
42  *#*/
43 #ifndef MWARE_FORMATWR_H
44 #define MWARE_FORMATWR_H
45
46 #include <stdarg.h> /* va_list */
47 #include <appconfig.h>
48 #include <cfg/cpu.h>    /* CPU_HARVARD */
49
50 /*!
51  * \name _formatted_write() configuration
52  * \{
53  */
54 #define PRINTF_DISABLED    0
55 #define PRINTF_NOMODIFIERS 1
56 #define PRINTF_REDUCED     2
57 #define PRINTF_NOFLOAT     3
58 #define PRINTF_FULL        4
59 /* \} */
60
61 #ifndef CONFIG_PRINTF_RETURN_COUNT
62         /*! Enable/disable _formatted_write return value */
63         #define CONFIG_PRINTF_RETURN_COUNT 1
64 #endif
65
66 int
67 _formatted_write(
68         const char *format,
69         void put_char_func(char c, void *user_data),
70         void *user_data,
71         va_list ap);
72
73 #if CPU_HARVARD
74         #include <mware/pgm.h>
75         int _formatted_write_P(
76                 const char * PROGMEM format,
77                 void put_char_func(char c, void *user_data),
78                 void *user_data,
79                 va_list ap);
80 #endif /* CPU_HARVARD */
81
82 #endif /* MWARE_FORMATWR_H */
83