Skip to content

IS_SPACE

IS_SPACE

Description

Checks if the given character c is a whitespace character.

Parameters

Name Direction Description
c in The character to check.

Success

Returns true for space, tab, newline, carriage return, vertical tab, form feed.

Failure

Function cannot fail - always returns boolean result.

Usage example (Cross-references)

Usage examples (Cross-references)
        bool        is_caps    = fmt_info && (fmt_info->flags & FMT_FLAG_CAPS) != 0;
    
        while (bytes_read < buffer_size && *current && !IS_SPACE(*current)) {
            u8 char_to_store;
            } else {
                // Unquoted string mode - read until whitespace
                if (is_string && IS_SPACE(*i)) {
                    return i; // Successfully read unquoted string
                }
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
            // For special values, use the original approach
            const char *start = i;
            while (*i && !IS_SPACE(*i))
                i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
    
        // Skip leading whitespace
        while (IS_SPACE(*i))
            i++;
        ValidateInt(value);
    
        while (IS_SPACE(*i)) {
            i++;
        }
        ValidateFloat(value);
    
        while (IS_SPACE(*i)) {
            i++;
        }
    
        // Skip whitespace
        while (IS_SPACE(*i))
            i++;
            // For special values, use the original approach
            const char *start = i;
            while (*i && !IS_SPACE(*i))
                i++;
        // Skip whitespace
        size_t pos = 0;
        while (pos < str->length && IS_SPACE(str->data[pos]))
            pos++;
            u8 digit;
            if (!char_to_digit(str->data[pos], &digit, base)) {
                if (IS_SPACE(str->data[pos]))
                    break;
                LOG_ERROR("Invalid digit for base {}: {c}", base, str->data[pos]);
    
        // Skip trailing whitespace
        while (pos < str->length && IS_SPACE(str->data[pos]))
            pos++;
        // Skip whitespace
        size_t pos = 0;
        while (pos < str->length && IS_SPACE(str->data[pos]))
            pos++;
        // Skip whitespace
        size_t pos = 0;
        while (pos < str->length && IS_SPACE(str->data[pos]))
            pos++;
    
            if (c1 == 'n' && c2 == 'a' && c3 == 'n') {
                if (str->length - pos == 3 || IS_SPACE(str->data[pos + 3])) {
                    *value = NAN;
                    return true;
            }
            if (c1 == 'i' && c2 == 'n' && c3 == 'f') {
                if (str->length - pos == 3 || IS_SPACE(str->data[pos + 3])) {
                    *value = INFINITY;
                    return true;
    
                if (c1 == 'i' && c2 == 'n' && c3 == 'f') {
                    if (str->length - pos == 3 || IS_SPACE(str->data[pos + 3])) {
                        *value = -INFINITY;
                        return true;
    
        // Skip trailing whitespace
        while (pos < str->length && IS_SPACE(str->data[pos]))
            pos++;
    ///
    /// TAGS: Character, ASCII, Printable
    #define IS_PRINTABLE(c) (IN_RANGE(c, 0x20, 0x7e) || IS_SPACE(c))
    
    ///
Last updated on