Changeset 1a96db9 in mainline


Ignore:
Timestamp:
2025-10-08T18:09:09Z (3 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
c111da2
Parents:
32ae27bb
Message:

Implement carriage return in console.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/output/include/io/chargrid.h

    r32ae27bb r1a96db9  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Martin Decky
    34 * All rights reserved.
     
    8182extern sysarg_t chargrid_putuchar(chargrid_t *, char32_t, bool);
    8283extern sysarg_t chargrid_newline(chargrid_t *);
     84extern sysarg_t chargrid_cr(chargrid_t *);
    8385extern sysarg_t chargrid_tabstop(chargrid_t *, sysarg_t);
    8486extern sysarg_t chargrid_backspace(chargrid_t *);
  • uspace/lib/output/src/chargrid.c

    r32ae27bb r1a96db9  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2006 Josef Cejka
    34 * All rights reserved.
     
    180181}
    181182
     183/** Return cursor to the beginning of the line.
     184 *
     185 * @param scrbuf Chargrid.
     186 *
     187 * @return Number of rows which have been affected. In usual
     188 *         situations this is 1.
     189 *
     190 */
     191sysarg_t chargrid_cr(chargrid_t *scrbuf)
     192{
     193        assert(scrbuf->col < scrbuf->cols);
     194        assert(scrbuf->row < scrbuf->rows);
     195
     196        scrbuf->col = 0;
     197        return 1;
     198}
     199
    182200/** Jump to a new row in chargrid.
    183201 *
  • uspace/srv/hid/console/console.c

    r32ae27bb r1a96db9  
    490490                break;
    491491        case '\r':
     492                updated = chargrid_cr(cons->frontbuf);
    492493                break;
    493494        case '\t':
Note: See TracChangeset for help on using the changeset viewer.