C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
stack.h File Reference

Contains declations of stack types, operations and structure. More...

#include "common.h"
#include "link_list.h"

Go to the source code of this file.

Data Structures

struct  stack
 stack struct defn More...
 

Typedefs

typedef struct stack t_stack
 stack struct defn More...
 

Enumerations

enum  e_stacktype { eLL_STACK , eARRAY_STACK , eARRAY_STACK_DOWN }
 types of supported stacks More...
 

Functions

t_gen create_stack (char *name, int max_size, e_stacktype, t_dparams *)
 
Create an instance of stack More...
 

Detailed Description

Contains declations of stack types, operations and structure.

Definition in file stack.h.

Typedef Documentation

◆ t_stack

typedef struct stack t_stack

stack struct defn

Enumeration Type Documentation

◆ e_stacktype

types of supported stacks

Enumerator
eLL_STACK 

LinkList based Stack.

eARRAY_STACK 

Top Growing Stack.

eARRAY_STACK_DOWN 

Down Growing Stack.

Definition at line 12 of file stack.h.

Function Documentation

◆ create_stack()

t_gen create_stack ( char *  name,
int  max_size,
e_stacktype  stype,
t_dparams prm 
)


Create an instance of stack

Parameters
name- Name of stack instance
max_size- Max size of stack instance
type- Type of stack to be created
prm- Data type specific parameters
Returns
- Pointer to instance of stack

Definition at line 37 of file stack.c.