ZE-Standard-Libraries/stack/stack.h
2018-06-12 19:07:12 +08:00

31 lines
1.2 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <stdlib.h>
#ifndef STACK_H
#define STACK_H
typedef struct stack_node{
unsigned long long id;
int if_malloc;
const char *type;
void *value;
struct stack_node *next;
} SNode;
typedef struct stack{
unsigned long long id;
unsigned long long length;
SNode *top;
} Stack;
Stack *initStack(void);
SNode *initSNode(void);
int initMallocValueForSNode(SNode *p_snode, const char *type, void *value);
SNode *popStack(Stack *p_stack);
int pushStack(Stack *p_stack, SNode *p_snode);
int releaseStack(Stack *p_stack);
int releaseSNode(SNode *p_snode);
#endif /* stack_h */