Changeset 63ed840 in mainline


Ignore:
Timestamp:
2023-10-27T19:45:12Z (14 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
1170cfc7
Parents:
34120f10
Message:

Remove unused functions gets() and getc() from kernel

Location:
kernel/generic
Files:
2 edited

Legend:

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

    r34120f10 r63ed840  
    6969SPINLOCK_EXTERN(kio_lock);
    7070
    71 extern char32_t getc(indev_t *indev);
    72 extern size_t gets(indev_t *indev, char *buf, size_t buflen);
    7371extern sys_errno_t sys_kio(int cmd, uspace_addr_t buf, size_t size);
    7472
  • kernel/generic/src/console/console.c

    r34120f10 r63ed840  
    243243}
    244244
    245 /** Get string from input character device.
    246  *
    247  * Read characters from input character device until first occurrence
    248  * of newline character.
    249  *
    250  * @param indev  Input character device.
    251  * @param buf    Buffer where to store string terminated by NULL.
    252  * @param buflen Size of the buffer.
    253  *
    254  * @return Number of characters read.
    255  *
    256  */
    257 size_t gets(indev_t *indev, char *buf, size_t buflen)
    258 {
    259         size_t offset = 0;
    260         size_t count = 0;
    261         buf[offset] = 0;
    262 
    263         char32_t ch;
    264         while ((ch = indev_pop_character(indev)) != '\n') {
    265                 if (ch == '\b') {
    266                         if (count > 0) {
    267                                 /* Space, backspace, space */
    268                                 putuchar('\b');
    269                                 putuchar(' ');
    270                                 putuchar('\b');
    271 
    272                                 count--;
    273                                 offset = str_lsize(buf, count);
    274                                 buf[offset] = 0;
    275                         }
    276                 }
    277 
    278                 if (chr_encode(ch, buf, &offset, buflen - 1) == EOK) {
    279                         putuchar(ch);
    280                         count++;
    281                         buf[offset] = 0;
    282                 }
    283         }
    284 
    285         return count;
    286 }
    287 
    288 /** Get character from input device & echo it to screen */
    289 char32_t getc(indev_t *indev)
    290 {
    291         char32_t ch = indev_pop_character(indev);
    292         putuchar(ch);
    293         return ch;
    294 }
    295 
    296245void kio_update(void *event)
    297246{
Note: See TracChangeset for help on using the changeset viewer.