37 lines
550 B
C
37 lines
550 B
C
#ifndef NODES_H
|
|
#define NODES_H
|
|
|
|
#include "aliases.h"
|
|
#include "ui.h"
|
|
|
|
#define MAX_NODES 1024
|
|
#define IO_INPUT_COUNT 0
|
|
#define OP_INPUT_COUNT 2
|
|
|
|
typedef i32 (*node_func)(i32 a, i32 b);
|
|
typedef enum node_type node_type;
|
|
typedef union node_data node_data;
|
|
typedef struct node node;
|
|
|
|
enum node_type {
|
|
NODE_TYPE_IO,
|
|
NODE_TYPE_OP,
|
|
|
|
COUNT_NODE_TYPES,
|
|
};
|
|
|
|
union node_data {
|
|
const char *path;
|
|
node_func func;
|
|
};
|
|
|
|
struct node {
|
|
ui_node_elem node;
|
|
ui_elem_colours colours;
|
|
node_type type;
|
|
node_data data;
|
|
u64 inputs;
|
|
};
|
|
|
|
#endif // !NODES_H
|