summaryrefslogtreecommitdiff
path: root/lib/stack.h
blob: a354ab5b9a15077434b32e569aee886a3349daaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#pragma once

#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

#include "types.h"

typedef struct ll_tag {
  v_t x;
  struct ll_tag *next;
} ll_t;

typedef struct dll_tag {
  double x;
  struct dll_tag *next;
} dll_t;

void stack_push(ll_t **q, v_t x);
void stack_push_d(dll_t **q, double x);

v_t stack_pop(ll_t **q);
double stack_pop_d(dll_t **q);