From 7e136e1032cdaac9a27805b0e8b4fa00e1c5f4b1 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 16 Mar 2026 11:12:44 +0100 Subject: [PATCH] Mon 16 Mar 11:09:06 CET 2026 --- src/unix.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/unix.h diff --git a/src/unix.h b/src/unix.h new file mode 100644 index 0000000..0cc61a6 --- /dev/null +++ b/src/unix.h @@ -0,0 +1,46 @@ +#ifndef _UNIX_H +#define _UNIX_H + +#include "config.h" + +#ifndef NUMLINKS +#define NUMLINKS 4 +#endif + +extern int availbyte(int fd); +extern char inbyte(int fd); +extern int outbyte(int fd,char x); +/* + Under UNIX we use named FS FIFOs for node-node communication. + The FIFOs are connected to links. + All port fifo file deescriptors + + + [N0} P0 --- P0 [N1] + P1 + | + | + P2 + [N2] +*/ +extern char *portfilerd[NUMPORTS]; +extern char *portfilewr[NUMPORTS]; + + +int ioinit(); +int iowait(context_t *C, int nonblock); + +char* readFile(char *path); + +// FIFO communication +int port_open(); +void port_close(); + +// Timer support +int timer_init(); +int timer_start(int index, int millis); +int timer_stop(int index); + +void vLog(const char* fmtStr, ...); + +#endif