summaryrefslogtreecommitdiff
path: root/lib/stack.h
blob: 8d25affe01f3ef26fb847b34d87f6bebf92e72de (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
27
28
29
30
31
32
33
34
35

#pragma once

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

#include "types.h"


#ifdef __cplusplus
extern "C" {
#endif

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);

#ifdef __cplusplus
}
#endif