Changeset 7f9df7b9 in mainline for uspace/lib/posix/src/stdio/scanf.c


Ignore:
Timestamp:
2018-01-22T22:42:57Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7a08c70
Parents:
e0f47f5
Message:

Remove unnecessary symbol renaming from libposix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/stdio/scanf.c

    re0f47f5 r7f9df7b9  
    3333 */
    3434
    35 #define LIBPOSIX_INTERNAL
    36 #define __POSIX_DEF__(x) posix_##x
    37 
    3835#include <assert.h>
    3936
     
    119116        /* Initialize internal structures. */
    120117        self->consumed = 0;
    121         ssize_t fetched = posix_getline(
     118        ssize_t fetched = getline(
    122119            &self->window, &self->window_size, self->source.stream);
    123120        if (fetched != -1) {
     
    140137        /* Initialize internal structures. */
    141138        self->consumed = 0;
    142         self->fetched = posix_strlen(self->source.string);
     139        self->fetched = strlen(self->source.string);
    143140        self->window = (char *) self->source.string;
    144141        self->window_size = self->fetched + 1;
     
    158155                /* Do we need to fetch a new line from the source? */
    159156                if (*self->cursor == '\0') {
    160                         ssize_t fetched = posix_getline(&self->window,
     157                        ssize_t fetched = getline(&self->window,
    161158                            &self->window_size, self->source.stream);
    162159                        if (fetched != -1) {
     
    208205                 * containing newline, while at the same time newline is the character
    209206                 * that breaks the matching process. */
    210                 int rc = posix_fseek(
    211                     self->source.stream, -1, SEEK_CUR);
     207                int rc = fseek(self->source.stream, -1, SEEK_CUR);
    212208                if (rc == -1) {
    213209                        /* Seek failed.  */
    214210                        return 0;
    215211                }
    216                 ssize_t fetched = posix_getline(&self->window,
     212                ssize_t fetched = getline(&self->window,
    217213                    &self->window_size, self->source.stream);
    218214                if (fetched != -1) {
     
    266262        if (*self->cursor == '\0') {
    267263                /* Window was completely consumed, fetch new data. */
    268                 ssize_t fetched = posix_getline(&self->window,
     264                ssize_t fetched = getline(&self->window,
    269265                    &self->window_size, self->source.stream);
    270266                if (fetched != -1) {
     
    298294        /* Try to correct the difference between the stream position and what was
    299295         * actually consumed. If it is not possible, continue anyway. */
    300         posix_fseek(self->source.stream, self->consumed - self->fetched, SEEK_CUR);
     296        fseek(self->source.stream, self->consumed - self->fetched, SEEK_CUR);
    301297
    302298        /* Destruct internal structures. */
     
    638634                                 * than allowed by width. */
    639635                                if (width != -1) {
    640                                         cur_duplicated = posix_strndup(cur_borrowed, width);
     636                                        cur_duplicated = strndup(cur_borrowed, width);
    641637                                        cur_limited = cur_duplicated;
    642638                                } else {
     
    812808                                 * than allowed by width. */
    813809                                if (width != -1) {
    814                                         cur_duplicated = posix_strndup(cur_borrowed, width);
     810                                        cur_duplicated = strndup(cur_borrowed, width);
    815811                                        cur_limited = cur_duplicated;
    816812                                } else {
     
    826822                                switch (length_mod) {
    827823                                case LMOD_NONE:
    828                                         fres = posix_strtof(cur_limited, (char **) &cur_updated);
     824                                        fres = strtof(cur_limited, (char **) &cur_updated);
    829825                                        break;
    830826                                case LMOD_l:
    831                                         dres = posix_strtod(cur_limited, (char **) &cur_updated);
     827                                        dres = strtod(cur_limited, (char **) &cur_updated);
    832828                                        break;
    833829                                case LMOD_L:
    834                                         ldres = posix_strtold(cur_limited, (char **) &cur_updated);
     830                                        ldres = strtold(cur_limited, (char **) &cur_updated);
    835831                                        break;
    836832                                default:
     
    11941190 * @return The number of converted output items or EOF on failure.
    11951191 */
    1196 int posix_vfscanf(
     1192int vfscanf(
    11971193    FILE *restrict stream, const char *restrict format, va_list arg)
    11981194{
     
    12141210 * @return The number of converted output items or EOF on failure.
    12151211 */
    1216 int posix_vsscanf(
     1212int vsscanf(
    12171213    const char *restrict s, const char *restrict format, va_list arg)
    12181214{
Note: See TracChangeset for help on using the changeset viewer.