|
libsheepy
|
staticArray type definition More...
#include <libsheepy.h>
Data Fields | |
| i64 | last |
| i64 | head |
| i64 | maxCount |
| bool | isEmpty |
staticArray type definition
this type of array has a static maximum element count (fixed) staticArray has head and last indexes, this allows dequeuing from head elements fast it is used as a circular buffer, queue, fifo... a ring is a pointer to a staticArray
no sanity checks are done
Usage:
to declare an array:
typedef struct { int a; char *key; } element;
staticArrayT(typeName, element, 10);
typeName array; staticArrayInit(array);
staticArrayPush(array); staticArrayLast(array).a = fork();
val = staticArrayLast(array).a; staticArrayPop(array);
Array variables: array.list: elements array.maxCount: maximum element count allowed
Note: some functions are macros to be able to have structs as element and access the struct members directly, for example: staticArrayLast(chan).a = 0; base type for all staticArrays and rings
Definition at line 6107 of file libsheepy.h.
| i64 staticArrayBase::last |
Definition at line 6108 of file libsheepy.h.
| i64 staticArrayBase::head |
Definition at line 6109 of file libsheepy.h.
| i64 staticArrayBase::maxCount |
Definition at line 6110 of file libsheepy.h.
| bool staticArrayBase::isEmpty |
Definition at line 6111 of file libsheepy.h.
1.8.13