Changeset 296890f3 in mainline
- Timestamp:
- 2018-06-21T13:01:34Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a8b0c5d
- Parents:
- 777832e
- git-author:
- Jiri Svoboda <jiri@…> (2018-06-21 20:00:45)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-06-21 13:01:34)
- Location:
- uspace/lib
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/snprintf.c
r777832e r296890f3 35 35 #include <stdarg.h> 36 36 #include <stdio.h> 37 #include <io/printf_core.h>38 37 39 38 /** Print formatted to the given buffer with limited size. -
uspace/lib/c/include/stdio.h
r777832e r296890f3 84 84 extern int fgetc(FILE *); 85 85 extern char *fgets(char *, int, FILE *); 86 extern char *gets(char *, size_t) __attribute__((deprecated)); 86 87 87 88 extern int getchar(void); … … 114 115 extern int vasprintf(char **, const char *, va_list); 115 116 extern int asprintf(char **, const char *, ...) 116 #endif117 117 _HELENOS_PRINTF_ATTRIBUTE(2, 3); 118 #endif 118 119 extern int vsnprintf(char *, size_t, const char *, va_list); 120 121 extern int sprintf(char *, const char *, ...) 122 __attribute__((deprecated)) _HELENOS_PRINTF_ATTRIBUTE(2, 3); 123 extern int vsprintf(char *, const char *, va_list) __attribute__((deprecated)); 119 124 120 125 /* Formatted input */ … … 159 164 #define _IOLBF 1 160 165 #define _IOFBF 2 161 162 extern char *gets(char *, size_t);163 166 164 167 #endif -
uspace/lib/posix/include/posix/stdio.h
r777832e r296890f3 66 66 _HELENOS_PRINTF_ATTRIBUTE(2, 3); 67 67 extern int vdprintf(int fildes, const char *__restrict__ format, va_list ap); 68 extern int sprintf(char *__restrict__ s, const char *__restrict__ format, ...)69 _HELENOS_PRINTF_ATTRIBUTE(2, 3);70 extern int vsprintf(char *__restrict__ s, const char *__restrict__ format, va_list ap);71 68 72 69 /* File Locking */ -
uspace/lib/posix/src/stdio.c
r777832e r296890f3 278 278 279 279 /** 280 * Print formatted output to the string.281 *282 * @param s Output string.283 * @param format Format description.284 * @return Either the number of printed characters (excluding null byte) or285 * negative value on error.286 */287 int sprintf(char *s, const char *restrict format, ...)288 {289 va_list list;290 va_start(list, format);291 int result = vsprintf(s, format, list);292 va_end(list);293 return result;294 }295 296 /**297 * Print formatted output to the string.298 *299 * @param s Output string.300 * @param format Format description.301 * @param ap Print arguments.302 * @return Either the number of printed characters (excluding null byte) or303 * negative value on error.304 */305 int vsprintf(char *s, const char *restrict format, va_list ap)306 {307 return vsnprintf(s, INT_MAX, format, ap);308 }309 310 /**311 280 * Acquire file stream for the thread. 312 281 *
Note:
See TracChangeset
for help on using the changeset viewer.