jvs/jvs-bus.c: Add JVS bus definitions

This commit is contained in:
Tau
2018-11-08 14:17:59 -05:00
parent f5f553bd57
commit e8537f4b52
3 changed files with 56 additions and 0 deletions

24
jvs/jvs-bus.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include "hook/iobuf.h"
struct jvs_node {
struct jvs_node *next;
void (*transact)(
struct jvs_node *node,
const void *bytes,
size_t nbytes,
struct iobuf *resp);
bool (*sense)(struct jvs_node *node);
};
void jvs_bus_transact(
struct jvs_node *head,
const void *bytes,
size_t nbytes,
struct iobuf *resp);
bool jvs_node_sense(struct jvs_node *node);