1 /* Stack - a template stack class (plus some handy methods)
3 * Copyright 2001-2005, Axel Dörfler, axeld@pinc-software.de.
4 * This file may be used under the terms of the MIT License.
10 #include "fssh_defs.h"
11 #include "fssh_errors.h"
17 template<class T
> class Stack
{
39 // could also free the memory
43 fssh_status_t
Push(T value
)
47 T
*newArray
= (T
*)realloc(fArray
, fMax
* sizeof(T
));
49 return FSSH_B_NO_MEMORY
;
53 fArray
[fUsed
++] = value
;
62 *value
= fArray
[--fUsed
];
71 int32_t CountItems() const
82 } // namespace FSShell
87 #endif /* _FSSH_STACK_H */