cfengine  3.15.4
About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.
  Fossies Dox: cfengine-3.15.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Seq Struct Reference

Sequence data-structure. More...

#include <sequence.h>

Data Fields

void ** data
size_t length
size_t capacity
void(* ItemDestroy )(void *item)

Detailed Description

Sequence data-structure.

This is an array-list loosely modeled on GSequence. It is a managed array of void pointers and can be used to store arbitrary data. The array list will auto-expand by a factor of EXPAND_FACTOR (e.g. 2) when necessary, but not contract. Because sequence is content agnostic, it does not support the usual copy semantics found in other CFEngine structures, such as RList. Thus, appending an item to a Sequence may imply a transfer of ownership. Clients that require copy semantics should therefore make sure that elements are copied before they are appended. Some Sequence operations may remove some or all of the elements held. In order to do so safely, it's incumbent upon the client to supply the necessary item destructor to the Sequence constructor. If the item destructor argument is NULL, Sequence will not attempt to free the item memory held.

Definition at line 49 of file sequence.h.

Field Documentation

◆ capacity

size_t Seq::capacity

Definition at line 53 of file sequence.h.

Referenced by ExpandIfNeccessary(), and SeqNew().

◆ data

◆ ItemDestroy

void(* Seq::ItemDestroy) (void *item)

Definition at line 54 of file sequence.h.

Referenced by DestroyRange(), SeqAppendOnce(), SeqGetRange(), SeqNew(), SeqSet(), and SeqSplit().

◆ length

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