#ifndef GATE_H #define GATE_H #include #include "logic.h" enum NODE_TYPE { NODE_INPUT, NODE_OUTPUT }; struct gate { char *name; enum BINARY (*operation)(enum BINARY, enum BINARY); enum BINARY output; struct gate *in1; struct gate *in2; }; void gate_update_output(struct gate *); int gate_input_add(char *name); struct gate* gate_get_input_by_name(char *name); int gate_add(char *name, enum BINARY (*operation)(enum BINARY, enum BINARY), struct gate *in1, struct gate *in2); int tick(void); void gate_init(void); void gate_dump(void); int gate_set_input(char *name, enum BINARY value); #endif