]> granicus.if.org Git - esp-idf/blob - components/esp32/include/xtensa/xtutil.h
Initial public version
[esp-idf] / components / esp32 / include / xtensa / xtutil.h
1
2 /* $Id$ */
3 /*******************************************************************************/
4 /* Copyright (c) 2001-2013 by Tensilica Inc.  ALL RIGHTS RESERVED.             */
5 /* These coded instructions, statements, and computer programs are the         */
6 /* copyrighted works and confidential proprietary information of Tensilica Inc.*/
7 /* They may not be modified, copied, reproduced, distributed, or disclosed to  */
8 /* third parties in any manner, medium, or form, in whole or in part, without  */
9 /* the prior written consent of Tensilica Inc.                                 */
10 /*******************************************************************************/
11
12 #ifndef XTUTIL_H
13 #define XTUTIL_H
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #include <stdarg.h>
20
21 extern int  xt_putchar(int c);
22 extern int  xt_puts(const char * s);
23 extern void xt_putn(unsigned n);
24 extern int  xt_atoi(const char * s);
25 extern int  xt_printf(const char *fmt, ...);
26 extern int  xt_sprintf(char * buf, const char * fmt, ...);
27
28 typedef int xt_output_fn(int *, int, const void *, int);
29 extern xt_output_fn * xt_set_output_fn(xt_output_fn * fn);
30
31 #ifdef XTUTIL_LIB
32
33 // Only defined if building library
34
35 typedef void (xt_outbuf_fn)(void *, char *, int);
36
37 extern int  xt_vprintf(xt_outbuf_fn * out, void * outarg, const char * fmt, va_list ap);
38
39 #else
40
41 // Only defined if building application and overriding
42
43 #ifndef XTUTIL_NO_OVERRIDE
44
45 #define putchar     xt_putchar
46 #define puts        xt_puts
47 #define putn        xt_putn
48 #define atoi        xt_atoi
49 #define printf      xt_printf
50 #define sprintf     xt_sprintf
51
52 #endif // XTUTIL_NO_OVERRIDE
53
54 #endif // XTUTIL_LIB
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif // XTUTIL_H
61