libfossil
fsl_list Struct Reference

Generic list container type. More...

#include "util.h"

Collaboration diagram for fsl_list:

Data Fields

fsl_size_t capacity
 Number of slots allocated in this->list.
void ** list
 Array of entries.
fsl_size_t used
 Number of "used" entries in the list.

Detailed Description

Generic list container type.

This is used heavily by the Fossil API for storing arrays of dynamically-allocated objects. It is not useful as a non-pointer-array replacement.

It is up to the APIs using this type to manage the entry count member and use fsl_list_reserve() to manage the "capacity" member.

See also
fsl_list_reserve()
fsl_list_append()
fsl_list_visit()

Definition at line 156 of file util.h.

Field Documentation

◆ capacity

fsl_size_t fsl_list::capacity

Number of slots allocated in this->list.

Use fsl_list_reserve() to modify this. Doing so might move the this->list pointer but the values it points to will stay stable.

Definition at line 171 of file util.h.

◆ list

void** fsl_list::list

Array of entries.

It contains this->capacity entries, this->count of which are "valid" (in use).

Definition at line 161 of file util.h.

◆ used

fsl_size_t fsl_list::used

Number of "used" entries in the list.

Definition at line 165 of file util.h.


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