X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=src%2FStack.h;fp=src%2FStack.h;h=c314c28a7ca174f1b61c2b6eae25ad566e13d920;hb=10b9967a8486514da0d3c534d9403c42d05527f0;hp=d2461077aee742d5346511ce3c847f0ab0dfe4dd;hpb=2e0d7d71a67c31324349f6e65a01cec6456b423f;p=cgds.git diff --git a/src/Stack.h b/src/Stack.h index d246107..c314c28 100644 --- a/src/Stack.h +++ b/src/Stack.h @@ -9,22 +9,14 @@ #include #include "cgds/types.h" #include "cgds/safe_alloc.h" - -/** - * @brief Generic internal stack cell. - */ -typedef struct StackCell { - void* data; ///< Generic data contained in the cell. - struct StackCell* previous; ///< Previous cell in the internal single-linked list. -} StackCell; +#include "cgds/Vector.h" /** * @brief Stack containing generic data. */ typedef struct Stack { - UInt size; ///< Count elements in the stack. size_t dataSize; ///< Size in bytes of a stack element. - StackCell* top; ///< Last added element, on top of the stack. + Vector* array; ///< Internal data structure: resizeable array. } Stack; /**