Changeset ff3b3197 in mainline for generic/src/console/console.c


Ignore:
Timestamp:
2005-11-25T22:58:38Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f4338d2
Parents:
78c32b4
Message:

Implement basic kernel console command recognition.
Commands without arguments are now recognized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/console/console.c

    r78c32b4 rff3b3197  
    4545 *
    4646 * @param chardev Character device.
    47  * @param string Buffer where to store string terminated by '\0'.
     47 * @param buf Buffer where to store string terminated by '\0'.
    4848 * @param len Size of the buffer.
     49 *
     50 * @return Number of characters read.
    4951 */
    50 void gets(chardev_t *chardev, __u8 *string, size_t buflen)
     52count_t gets(chardev_t *chardev, char *buf, size_t buflen)
    5153{
    5254        index_t index = 0;
     
    5658                ch = getc(chardev);
    5759                if (ch == '\n') { /* end of string => write 0, return */
    58                         string[index] = '\0';
    59                         return;
     60                        buf[index] = '\0';
     61                        return (count_t) index;
    6062                }
    61                 string[index++] = ch;
     63                buf[index++] = ch;
    6264        }
    63         return;
     65        return (count_t) index;
    6466}
    6567
Note: See TracChangeset for help on using the changeset viewer.