Skip to content

IS_PRINTABLE

Description

Checks whether a given character ‘c’ is printable ascii or not.

Only characters in range 0x20 to 0x7e and whitespace characters are considered printable.

Parameters

Name Direction Description
c in Character to check.

Success

Returns true or false based on whether given character is printable or not

Failure

Cannot fail, always return boolean result

Usage example (Cross-references)

Usage examples (Cross-references)
            u8 byte = (value >> ((num_bytes - 1 - i) * 8)) & 0xFF;
    
            if (IS_PRINTABLE(byte)) {
                // 'a'/'A' set force_case (caller wants the case folded);
                // 'c' leaves it clear so source bytes pass through untouched.
    
        while (len--) {
            if (IS_PRINTABLE(*vs)) {
                // See `write_int_as_chars` for the force_case / 'c' split.
                if (force_case) {
                } else {
                    StrForeachInRange(s, c, 0, len) {
                        if (IS_PRINTABLE(c)) {
                            if (!StrPushBackR(o, c)) {
                                return false;
                } else {
                    for (size i = 0; i < len; i++) {
                        if (IS_PRINTABLE(xs[i])) {
                            if (!StrPushBackR(o, xs[i])) {
                                return false;
Last updated on