Contiki 2.5
strformat.h
1 #ifndef __STRFORMAT_H__
2 #define __STRFORMAT_H__
3 
4 #include <stdarg.h>
5 
6 #define STRFORMAT_OK 0
7 #define STRFORMAT_FAILED 1
8 typedef unsigned int StrFormatResult;
9 
10 /* The data argument may only be considered valid during the function call */
11 typedef StrFormatResult (*StrFormatWrite)(void *user_data, const char *data, unsigned int len);
12 
13 typedef struct _StrFormatContext
14 {
15  StrFormatWrite write_str;
16  void *user_data;
17 } StrFormatContext;
18 
19 int format_str(const StrFormatContext *ctxt, const char *format, ...)
20  __attribute__ ((__format__ (__printf__, 2,3)));
21 
22 int
23 format_str_v(const StrFormatContext *ctxt, const char *format, va_list ap);
24 
25 #endif /* __STRFORMAT_H__ */