Skip to content

ValidateIter

Description

Validate whether a given Iter object is valid. Not foolproof but will work most of the time. Aborts if provided Iter is not valid.

Parameters

Name Direction Description
i in Pointer to Iter object to validate.

Success

Continue execution, meaning given Iter object is most probably a valid Iter.

Failure

abort

Usage example (Cross-references)

Usage examples (Cross-references)
    /// TAGS: StrIter, Validate, API
    ///
    #define ValidateStrIter(si) ValidateIter(si)
    
    ///
        const u8 buf[2] = {1, 2};
        BufIter  it     = {.data = buf, .length = 2, .pos = 0, .alignment = 1, .dir = 0};
        ValidateIter(&it);
        return true;
    }
        const u8 buf[2] = {1, 2};
        BufIter  it     = {.data = buf, .length = 2, .pos = 0, .alignment = 0, .dir = 1};
        ValidateIter(&it);
        return true;
    }
        const u8 buf[2] = {1, 2};
        BufIter  it     = BufIterFromMemory(buf, 2);
        ValidateIter(&it);
        return true;
    }
        const u8 buf[2] = {1, 2};
        BufIter  it     = from_rev(buf, 2);
        ValidateIter(&it);
        return true;
    }
Last updated on