summaryrefslogtreecommitdiffhomepage
path: root/docs/cstack_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-01-21 11:25:31 +0100
committerTyge Løvset <[email protected]>2021-01-21 11:25:31 +0100
commitff84705c03e06ad2f44396719253fe0fb8112171 (patch)
tree10e34d73a00a7ddb75dffb0b34b2ba1ab0c720b1 /docs/cstack_api.md
parent396dc5b30de95776a745be18c33ef207f0bb6f49 (diff)
downloadSTC-modified-ff84705c03e06ad2f44396719253fe0fb8112171.tar.gz
STC-modified-ff84705c03e06ad2f44396719253fe0fb8112171.zip
Updated docs.
Diffstat (limited to 'docs/cstack_api.md')
-rw-r--r--docs/cstack_api.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/cstack_api.md b/docs/cstack_api.md
index b32e9dc5..764b258b 100644
--- a/docs/cstack_api.md
+++ b/docs/cstack_api.md
@@ -1,13 +1,14 @@
-# STC Container [cstack](../stc/cstack.h): Stack
+# STC [cstack](../stc/cstack.h): Stack
![Stack](pics/stack.jpg)
-This describes the API of the stack type **cstack**.
+The **cstack** is a container adapter that gives the programmer the functionality of a stack - specifically, a LIFO (last-in, first-out) data structure. The class template acts as a wrapper to the underlying container - only a specific set of functions is provided. The stack pushes and pops the element from the back of the underlying container, known as the top of the stack.
+
See [std::stack](https://en.cppreference.com/w/cpp/container/stack) for a similar c++ class.
## Declaration
```c
-#define using_cstack(X, ctype)
+using_cstack(X, ctype)
```
The macro `using_cstack()` must be instantiated in the global scope. **cstack** uses normally
a **cvec_X** or **cdeq_X** type as underlying implementation, given as `ctype`. `X` is a type tag name and will