Changeset c8bf88d in mainline for kernel/generic/src/lib/string.c


Ignore:
Timestamp:
2009-04-03T15:52:14Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a7b1071
Parents:
2398ee9
Message:

represent special keystrokes (cursor arrows, page up/down, delete, etc.) as appropriate Unicode characters
do not parse ANSI control sequences in kconsole, but in serial line driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/string.c

    r2398ee9 rc8bf88d  
    110110#include <align.h>
    111111
    112 char invalch = '?';
    113 
    114112/** Byte mask consisting of lowest @n bits (out of 8) */
    115113#define LO_MASK_8(n)  ((uint8_t) ((1 << (n)) - 1))
     
    135133 * @param size   Size of the string (in bytes).
    136134 *
    137  * @return Value of decoded character, invalch on decoding error or
     135 * @return Value of decoded character, U_SPECIAL on decoding error or
    138136 *         NULL if attempt to decode beyond @a size.
    139137 *
     
    170168        } else {
    171169                /* 10xxxxxx -- unexpected continuation byte */
    172                 return invalch;
     170                return U_SPECIAL;
    173171        }
    174172       
    175173        if (*offset + cbytes > size)
    176                 return invalch;
     174                return U_SPECIAL;
    177175       
    178176        wchar_t ch = b0 & LO_MASK_8(b0_bits);
     
    184182                /* Must be 10xxxxxx */
    185183                if ((b & 0xc0) != 0x80)
    186                         return invalch;
     184                        return U_SPECIAL;
    187185               
    188186                /* Shift data bits to ch */
Note: See TracChangeset for help on using the changeset viewer.