libcproject
C static library easier to use than libc (C standard library).
stack.h File Reference
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
Include dependency graph for stack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stack
 Stack structure => LIFO (Last In First Out). More...
 
struct  stack_node
 Stack node structure. More...
 

Functions

struct stackstack_initialization ()
 Stack initialization. More...
 
void stack_push (struct stack *stack, void *data)
 Push data to stack. More...
 
void * stack_pop (struct stack *stack)
 Pop data from stack. More...
 
void stack_free (struct stack *stack)
 Frees the stack. More...
 

Data Structure Documentation

◆ stack

struct stack

Stack structure => LIFO (Last In First Out).

Since
v1.0.0

Definition at line 14 of file stack.h.

Collaboration diagram for stack:
Data Fields
struct stack_node * first
size_t length

◆ stack_node

struct stack_node

Stack node structure.

Since
v1.0.0

Definition at line 23 of file stack.h.

Collaboration diagram for stack_node:
Data Fields
void * data
struct stack_node * next

Function Documentation

◆ stack_initialization()

struct stack* stack_initialization ( )

Stack initialization.

Returns
struct stack*
Since
v1.0.0

◆ stack_push()

void stack_push ( struct stack stack,
void *  data 
)

Push data to stack.

Parameters
stack
data
Since
v1.0.0

◆ stack_pop()

void* stack_pop ( struct stack stack)

Pop data from stack.

Parameters
stack
Returns
void*
Since
v1.0.0

◆ stack_free()

void stack_free ( struct stack stack)

Frees the stack.

Parameters
stack
Since
v3.0.0