Contiki 2.6

strformat.h

00001 #ifndef __STRFORMAT_H__
00002 #define __STRFORMAT_H__
00003 
00004 #include <stdarg.h>
00005 
00006 #define STRFORMAT_OK 0
00007 #define STRFORMAT_FAILED 1
00008 typedef unsigned int StrFormatResult;
00009 
00010 /* The data argument may only be considered valid during the function call */
00011 typedef StrFormatResult (*StrFormatWrite)(void *user_data, const char *data, unsigned int len);
00012 
00013 typedef struct _StrFormatContext
00014 {
00015   StrFormatWrite write_str;
00016   void *user_data;
00017 } StrFormatContext;
00018 
00019 int format_str(const StrFormatContext *ctxt, const char *format, ...)
00020      __attribute__ ((__format__ (__printf__, 2,3)));
00021      
00022 int
00023 format_str_v(const StrFormatContext *ctxt, const char *format, va_list ap);
00024 
00025 #endif /* __STRFORMAT_H__ */