C Container Collection (CCC)
Loading...
Searching...
No Matches
CCC_Count Struct Reference

A type for returning an unsigned integer from a container for counting. Intended to count sizes, capacities, and 0-based indices. More...

#include <types.h>

Detailed Description

A type for returning an unsigned integer from a container for counting. Intended to count sizes, capacities, and 0-based indices.

Access the fields of this struct directly to check for errors and then use the returned index. If an error has occurred, the index is invalid. An error will be indicated by any non-zero value in the error field.

if (res.error)
{
// handle errors...
}
(void)CCC_bitset_set(&my_bitset, res.count, CCC_TRUE);
CCC_Count CCC_bitset_first_trailing_one(CCC_Bitset const *bitset)
Return the index of the first trailing bit set to 1 in the set.
CCC_Tribool CCC_bitset_set(CCC_Bitset *bitset, size_t index, CCC_Tribool bit)
Set the bit at valid index index to value bit (true or false).
A type for returning an unsigned integer from a container for counting. Intended to count sizes,...
Definition: types.h:202
size_t count
Definition: types.h:206
CCC_Result error
Definition: types.h:204
@ CCC_TRUE
Definition: types.h:139

Full string explanations of the exact CCC_Result error types can be provided via the CCC_result_message function if the enum itself does not provide sufficient explanation.

Data Fields

CCC_Result error
 
size_t count
 

Field Documentation

◆ count

size_t CCC_Count::count

The count returned by the operation.

◆ error

CCC_Result CCC_Count::error

The error that occurred indicated by a status. 0 (falsey) means OK.


The documentation for this struct was generated from the following file: