nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
printf.c
Go to the documentation of this file.
1 #include <sys/types.h>
2 #include <stdio.h>
3 #include <stdarg.h>
4 
5 int fprintf(FILE *stream, const char *format, ...)
6 {
7  va_list ap;
8  int ret;
9 
10  va_start(ap, format);
11  ret = vfprintf(stream, format, ap);
12  va_end(ap);
13 
14  return ret;
15 }
16 
17 int sprintf(char *str, const char *format, ...)
18 {
19  va_list ap;
20  int ret;
21 
22  va_start(ap, format);
23  ret = vsprintf(str, format, ap);
24  va_end(ap);
25 
26  return ret;
27 }
28 
29 int snprintf(char *str, size_t size, const char *format, ...)
30 {
31  va_list ap;
32  int ret;
33 
34  va_start(ap, format);
35  ret = vsnprintf(str, size, format, ap);
36  va_end(ap);
37 
38  return ret;
39 }
40 
41 int printf(const char *format, ...)
42 {
43  va_list ap;
44  int ret;
45 
46  va_start(ap, format);
47  ret = vprintf(format, ap);
48  va_end(ap);
49 
50  return ret;
51 }
52 
53 /* End of a file */