summaryrefslogtreecommitdiff
path: root/gate.h
blob: fcc84bb2cb8334869bd82e7d57cc1ed210790847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef GATE_H
#define GATE_H

#include <stddef.h>

#include "logic.h"

struct gate {
	enum BINARY (*operation)(enum BINARY, enum BINARY);
	enum BINARY output;
	struct gate *in1;
	struct gate *in2;
};

void gate_update_output(struct gate *);
int gate_add(struct gate *in1, struct gate *in2);
int tick(void);
void gate_init(void);

#endif