Add memtest support.
[syslinux-debian/hramrach.git] / gpxe / src / include / stdio.h
blob84181f0a1820ba7df445f816b5c244c6bea98a68
1 #ifndef _STDIO_H
2 #define _STDIO_H
4 FILE_LICENCE ( GPL2_OR_LATER );
6 #include <stdint.h>
7 #include <stdarg.h>
9 extern int __attribute__ (( format ( printf, 1, 2 ) ))
10 printf ( const char *fmt, ... );
12 extern int __attribute__ (( format ( printf, 3, 4 ) ))
13 snprintf ( char *buf, size_t size, const char *fmt, ... );
15 extern int __attribute__ (( format ( printf, 2, 3 ) ))
16 asprintf ( char **strp, const char *fmt, ... );
18 extern int vprintf ( const char *fmt, va_list args );
20 extern int vsnprintf ( char *buf, size_t size, const char *fmt, va_list args );
22 extern int vasprintf ( char **strp, const char *fmt, va_list args );
24 /**
25 * Write a formatted string to a buffer
27 * @v buf Buffer into which to write the string
28 * @v fmt Format string
29 * @v ... Arguments corresponding to the format string
30 * @ret len Length of formatted string
32 #define sprintf( buf, fmt, ... ) \
33 snprintf ( (buf), ~( ( size_t ) 0 ), (fmt), ## __VA_ARGS__ )
35 /**
36 * Write a formatted string to a buffer
38 * @v buf Buffer into which to write the string
39 * @v fmt Format string
40 * @v args Arguments corresponding to the format string
41 * @ret len Length of formatted string
43 static inline int vsprintf ( char *buf, const char *fmt, va_list args ) {
44 return vsnprintf ( buf, ~( ( size_t ) 0 ), fmt, args );
47 #endif /* _STDIO_H */