|
My library
Library for common tasks
|
Functions for working with Stack type. More...
#include "types.h"

Go to the source code of this file.
Functions | |
| Stack | newStack (const spec_t spec) |
| Allocate a new Stack of specified type. More... | |
| void | push (Stack stack,...) |
| Push an item into a Stack. More... | |
| void | printStack (const spec_t spec, const Stack stack) |
| Print contents from a Stack. More... | |
| void | pop (Stack stack, void *dest) |
| Pop an item from a Stack. More... | |
| void | deleteHeadFromStack (Stack stack) |
| Delete current Stack head. More... | |
| byte | isStackEmpty (Stack stack) |
| Check if Stack is empty. More... | |
| void | deleteStack (Stack stack) |
| Delete a Stack. More... | |
| void | peekStack (Stack stack, void *dest) |
| Get the item at the head of a Stack without popping it. More... | |
| byte | isInStack (Stack stack,...) |
| Detect if an item is inside a Stack. More... | |
| Stack | chooseNewStackFromArray (const spec_t spec, const void *arr, unsigned int size) |
| Create a Stack from an array. More... | |
| void | pushFromPtr (Stack stack, const void *element) |
| Push an item into a Stack. More... | |
| unsigned int | getStackLength (const Stack stack) |
| Get the size of a Stack. More... | |
| Stack | newStackFromCharArray (const char arr[], unsigned int size) |
| Create a Stack from an array of chars. More... | |
| Stack | newStackFromIntArray (const int arr[], unsigned int size) |
| Create a Stack from an array of integers. More... | |
| Stack | newStackFromFloatArray (const float arr[], unsigned int size) |
| Create a Stack from an array of floats. More... | |
| Stack | newStackFromDoubleArray (const double arr[], unsigned int size) |
| Create a Stack from an array of doubles. More... | |
| Stack | newStackFromPtrArray (const void *arr, unsigned int size) |
| Create a Stack from an array of pointers. More... | |
| byte | areStacksEqual (const Stack stack1, const Stack stack2) |
| Compare two Stack. More... | |
Functions for working with Stack type.
| void deleteHeadFromStack | ( | Stack | stack | ) |
| unsigned int getStackLength | ( | const Stack | stack | ) |
Detect if an item is inside a Stack.
| stack | The Stack you want search in |
| ... | The element you want to search |
| TRUE | Given element is contained in stack |
| FALSE | Given element is not contained in stack |
| Stack newStackFromCharArray | ( | const char | arr[], |
| unsigned int | size | ||
| ) |
Create a Stack from an array of chars.
Equivalent to chooseNewStackFromArray("%c", arr, size). Refer to chooseNewStackFromArray()
| Stack newStackFromDoubleArray | ( | const double | arr[], |
| unsigned int | size | ||
| ) |
Create a Stack from an array of doubles.
Equivalent to chooseNewStackFromArray("%lf", arr, size). Refer to chooseNewStackFromArray()
| Stack newStackFromFloatArray | ( | const float | arr[], |
| unsigned int | size | ||
| ) |
Create a Stack from an array of floats.
Equivalent to chooseNewStackFromArray("%f", arr, size). Refer to chooseNewStackFromArray()
| Stack newStackFromIntArray | ( | const int | arr[], |
| unsigned int | size | ||
| ) |
Create a Stack from an array of integers.
Equivalent to chooseNewStackFromArray("%i", arr, size). Refer to chooseNewStackFromArray()
| Stack newStackFromPtrArray | ( | const void * | arr, |
| unsigned int | size | ||
| ) |
Create a Stack from an array of pointers.
Equivalent to chooseNewStackFromArray("%p", arr, size). Refer to chooseNewStackFromArray()
| void peekStack | ( | Stack | stack, |
| void * | dest | ||
| ) |
| void pop | ( | Stack | stack, |
| void * | dest | ||
| ) |
| void push | ( | Stack | stack, |
| ... | |||
| ) |
Push an item into a Stack.
| stack | The Stack you want to push into |
| ... | The item you want to push into stack |
stack. If you don't specify any item to be pushed, still no errors occur but the content of your Stack can be messed up