From 255a49ba5a41b3854dbdfebdec75fb6229450507 Mon Sep 17 00:00:00 2001 From: Galin Simeonov Date: Mon, 31 May 2021 22:02:10 +0300 Subject: added cmake file --- stack.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 stack.c (limited to 'stack.c') diff --git a/stack.c b/stack.c deleted file mode 100644 index 272732f..0000000 --- a/stack.c +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GSTACK_C -#define GSTACK_C GSTACK_C -#include "stack.h" - - - -void Stack_Init(Stack *stack) -{ - stack->size=0; - stack->first=NULL; -} -void Stack_Push(Stack *stack,void* data) -{ - struct Stack_Node *temp_node=malloc(sizeof(struct Stack_Node)); - temp_node->data=data; - temp_node->next=stack->first; - stack->first=temp_node; - ++stack->size; -} -void* Stack_Pop(Stack *stack) -{ - void* return_value=NULL; - if(stack->first!=NULL) - { - struct Stack_Node *temp_first=stack->first; - return_value=stack->first->data; - - --stack->size; - stack->first=stack->first->next; - free(temp_first); - } - - return return_value; -} - -#endif//#ifndef GSTACK_C - -- cgit v1.2.3