From 2ade60747db41771498ab2b85ce6e3c3389f2c26 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Wed, 13 Oct 2021 09:08:59 -0700 Subject: feat(rc): added unix port of rc with linenoise --- sys/cmd/rc/unix.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sys/cmd/rc/unix.h (limited to 'sys/cmd/rc/unix.h') diff --git a/sys/cmd/rc/unix.h b/sys/cmd/rc/unix.h new file mode 100644 index 0000000..84ff25e --- /dev/null +++ b/sys/cmd/rc/unix.h @@ -0,0 +1,56 @@ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef NSIG +#define NSIG 32 +#endif + +#ifndef ERRMAX +#define ERRMAX 128 +#endif + +/* plan 9 compatibility */ +#define RFPROC 1 +#define RFFDG 1 +#define RFNOTEG 1 + +#define uintptr uintptr_t +#define Rune wchar_t + +#define nil ((void*)0) + +/* in case uchar, etc. are built-in types */ +#define uchar _fmtuchar +#define ushort _fmtushort +#define uint _fmtuint +#define ulong _fmtulong +#define vlong _fmtvlong +#define uvlong _fmtuvlong + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned long long uvlong; + +#define OREAD O_RDONLY +#define OWRITE O_WRONLY +#define ORDWR O_RDWR +#define OCEXEC 0 + +extern char *argv0; +extern int chartorune(wchar_t *, const char *); +extern int rfork(int); +extern void errstr(char *, int); +#define rerrstr errstr + +extern void exechistory(void); + -- cgit v1.2.1