graph

unidirected graph implementation using adjacency list
Index Commits Files Refs README LICENSE
stack.h (488B)
   1 #ifndef STACK_H_
   2 #define STACK_H_
   3 
   4 #include <stdlib.h>
   5 #include <stdbool.h>
   6 
   7 #define    STACK_INITIAL_ALLOC    10
   8 #define    STACK_GROWTH_FACTOR     2
   9 
  10 typedef struct Stack Stack;
  11 
  12 struct Stack {
  13     void **vector;
  14     size_t len, mem_alloc, mem_width;
  15 };
  16 
  17 void stack_new(Stack **S, size_t mem_width);
  18 void stack_push(Stack *S, const void *elem);
  19 void stack_peek(const Stack *S, void *data);
  20 void stack_pop(Stack *S, void *data);
  21 void stack_destroy(Stack *S);
  22 bool stack_is_empty(const Stack *S);
  23 
  24 
  25 #endif