Changeset ed88c8e in mainline for kernel/generic


Ignore:
Timestamp:
2018-05-29T13:25:07Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fc0b2a8
Parents:
a57fa32
git-author:
Jiri Svoboda <jiri@…> (2018-05-28 17:24:17)
git-committer:
Jiri Svoboda <jiri@…> (2018-05-29 13:25:07)
Message:

fputc, putchar vs. fputwc, putwchar.

Location:
kernel/generic
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/console/console.h

    ra57fa32 red88c8e  
    5757extern outdev_t *stdout;
    5858
    59 extern void early_putchar(wchar_t);
     59extern void early_putwchar(wchar_t);
    6060
    6161extern indev_t *stdin_wire(void);
  • kernel/generic/include/putchar.h

    ra57fa32 red88c8e  
    3636#define KERN_PUTCHAR_H_
    3737
    38 extern void putchar(const wchar_t ch);
     38#include <stddef.h>
     39
     40extern void putwchar(wchar_t);
    3941
    4042#endif
  • kernel/generic/src/console/console.c

    ra57fa32 red88c8e  
    262262                        if (count > 0) {
    263263                                /* Space, backspace, space */
    264                                 putchar('\b');
    265                                 putchar(' ');
    266                                 putchar('\b');
     264                                putwchar('\b');
     265                                putwchar(' ');
     266                                putwchar('\b');
    267267
    268268                                count--;
     
    273273
    274274                if (chr_encode(ch, buf, &offset, buflen - 1) == EOK) {
    275                         putchar(ch);
     275                        putwchar(ch);
    276276                        count++;
    277277                        buf[offset] = 0;
     
    286286{
    287287        wchar_t ch = indev_pop_character(indev);
    288         putchar(ch);
     288        putwchar(ch);
    289289        return ch;
    290290}
     
    356356}
    357357
    358 void putchar(const wchar_t ch)
     358void putwchar(const wchar_t ch)
    359359{
    360360        bool ordy = ((stdout) && (stdout->op->write));
     
    373373                 * for possible future output.
    374374                 *
    375                  * The early_putchar() function is used to output
     375                 * The early_putwchar() function is used to output
    376376                 * the character for low-level debugging purposes.
    377377                 * Note that the early_putc() function might be
    378378                 * a no-op on certain hardware configurations.
    379379                 */
    380                 early_putchar(ch);
     380                early_putwchar(ch);
    381381        }
    382382
  • kernel/generic/src/console/kconsole.c

    ra57fa32 red88c8e  
    160160        size_t i;
    161161        for (i = 0; i < count; i++)
    162                 putchar(ch);
     162                putwchar(ch);
    163163}
    164164
     
    339339                if (ch == '\n') {
    340340                        /* Enter */
    341                         putchar(ch);
     341                        putwchar(ch);
    342342                        break;
    343343                }
     
    350350                        if (wstr_remove(current, position - 1)) {
    351351                                position--;
    352                                 putchar('\b');
     352                                putwchar('\b');
    353353                                printf("%ls ", current + position);
    354354                                print_cc('\b', wstr_length(current) - position + 1);
     
    363363                        for (; (current[position] != 0) && (!isspace(current[position]));
    364364                            position++)
    365                                 putchar(current[position]);
     365                                putwchar(current[position]);
    366366
    367367
     
    459459                        /* Left */
    460460                        if (position > 0) {
    461                                 putchar('\b');
     461                                putwchar('\b');
    462462                                position--;
    463463                        }
     
    468468                        /* Right */
    469469                        if (position < wstr_length(current)) {
    470                                 putchar(current[position]);
     470                                putwchar(current[position]);
    471471                                position++;
    472472                        }
  • kernel/generic/src/printf/vprintf.c

    ra57fa32 red88c8e  
    4747
    4848        while (offset < size) {
    49                 putchar(str_decode(str, &offset, size));
     49                putwchar(str_decode(str, &offset, size));
    5050                chars++;
    5151        }
     
    6060
    6161        while (offset < size) {
    62                 putchar(str[chars]);
     62                putwchar(str[chars]);
    6363                chars++;
    6464                offset += sizeof(wchar_t);
     
    7575
    7676        while ((uc = str_decode(str, &offset, STR_NO_LIMIT)) != 0) {
    77                 putchar(uc);
     77                putwchar(uc);
    7878                chars++;
    7979        }
    8080
    81         putchar('\n');
     81        putwchar('\n');
    8282        return chars;
    8383}
Note: See TracChangeset for help on using the changeset viewer.