Changeset 296890f3 in mainline


Ignore:
Timestamp:
2018-06-21T13:01:34Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
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)
Message:

sprintf, vsprintf belong in libc (as deprecated).

Location:
uspace/lib
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/snprintf.c

    r777832e r296890f3  
    3535#include <stdarg.h>
    3636#include <stdio.h>
    37 #include <io/printf_core.h>
    3837
    3938/** Print formatted to the given buffer with limited size.
  • uspace/lib/c/include/stdio.h

    r777832e r296890f3  
    8484extern int fgetc(FILE *);
    8585extern char *fgets(char *, int, FILE *);
     86extern char *gets(char *, size_t) __attribute__((deprecated));
    8687
    8788extern int getchar(void);
     
    114115extern int vasprintf(char **, const char *, va_list);
    115116extern int asprintf(char **, const char *, ...)
    116 #endif
    117117    _HELENOS_PRINTF_ATTRIBUTE(2, 3);
     118#endif
    118119extern int vsnprintf(char *, size_t, const char *, va_list);
     120
     121extern int sprintf(char *, const char *, ...)
     122    __attribute__((deprecated)) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
     123extern int vsprintf(char *, const char *, va_list) __attribute__((deprecated));
    119124
    120125/* Formatted input */
     
    159164#define _IOLBF 1
    160165#define _IOFBF 2
    161 
    162 extern char *gets(char *, size_t);
    163166
    164167#endif
  • uspace/lib/posix/include/posix/stdio.h

    r777832e r296890f3  
    6666    _HELENOS_PRINTF_ATTRIBUTE(2, 3);
    6767extern 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);
    7168
    7269/* File Locking */
  • uspace/lib/posix/src/stdio.c

    r777832e r296890f3  
    278278
    279279/**
    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) or
    285  *     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) or
    303  *     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 /**
    311280 * Acquire file stream for the thread.
    312281 *
Note: See TracChangeset for help on using the changeset viewer.