ref: 515a0d5fafddf8abecfd01e130619841584ef28b
parent: 032ce29f51d0b117f4b7cc8f636b94d5b44dcf1d
author: halfwit <michaelmisch1985@gmail.com>
date: Sat Oct 10 07:18:11 PDT 2020
Make sure we assign C9aux
--- a/keyboard.c
+++ b/keyboard.c
@@ -57,7 +57,7 @@
{
wchar_t rune;
- if (c9read(x9di.ctx, &x9di.keybd->tag, x9di.keybd.fid, x9di.keybd->wroff, 1) != 1)
+ if (c9read(x9di.ctx, &x9di.keybd->tag, x9di.keybd->fid, x9di.keybd->wroff, 1) != 1)
return 0;
rune = x9di.keybd->rdbuf[0];
--- a/mouse.c
+++ b/mouse.c
@@ -53,7 +53,7 @@
int n;
/* Magic numbers here are the size of a message from /dev/mouse and its offsets */
- if((n = c9read(x9di.ctx, &x9di.mouse->tag, x9di.mouse.fid, x9di.mouse->wroff, 1 + 4 * 12)) <= 0)
+ if((n = c9read(x9di.ctx, &x9di.mouse->tag, x9di.mouse.f, x9di.mouse->wroff, 1 + 4 * 12)) <= 0)
return 0;
if (n != 1 + 4 * 12)
--- a/x9dev.c
+++ b/x9dev.c
@@ -159,7 +159,7 @@
x9devInfoInit(void)
{
C9tag *cons;
- C9fid c;
+ C9fid cfd;
char *path;
x9di.ctx = calloc(1, sizeof(x9di.ctx));
@@ -182,17 +182,17 @@
x9di.fb = malloc(x9di.bpl * x9di.height);
sprintf(path, "%s/mouse", _display->devdir);
- c9walk(x9di.ctx, &x9di.mouse->tag, 1, x9di.mouse.fid, &path);
- c9open(x9di.ctx, &x9di.mouse->tag, x9di.mouse.fid, O_RDWR|O_NONBLOCK);
+ c9walk(x9di.ctx, &x9di.mouse->tag, 1, x9di.mouse.f, &path);
+ c9open(x9di.ctx, &x9di.mouse->tag, x9di.mouse.f, O_RDWR|O_NONBLOCK);
sprintf(path, "%s/cons", _display->devdir);
- c9walk(x9di.ctx, &x9di.mouse->tag, 1, x9di.keybd.fid, &path);
- c9open(x9di.ctx, &x9di.keybd->tag, x9di.keybd.fid, O_RDONLY|O_NONBLOCK);
+ c9walk(x9di.ctx, &x9di.mouse->tag, 1, x9di.keybd.f, &path);
+ c9open(x9di.ctx, &x9di.keybd->tag, x9di.keybd.f, O_RDONLY|O_NONBLOCK);
sprintf(path, "%s/consctl", _display->devdir);
- c9walk(x9di.ctx, &cons, 1, c, &path);
- c9open(x9di.ctx, &cons, c, O_WRONLY);
- c9write(x9di.ctx, &cons, c, 0, "rawon", 5);
+ c9walk(x9di.ctx, &cons, 1, cfd, &path);
+ c9open(x9di.ctx, &cons, cfd, O_WRONLY);
+ c9write(x9di.ctx, &cons, cfd, 0, "rawon", 5);
}
void
--- a/x9dev.h
+++ b/x9dev.h
@@ -66,13 +66,15 @@
#define x9devRecolorCursor (void *) NoopDDA
#define x9devSetCursorPosition (void *) NoopDDA
+typedef struct C9aux C9aux;
-typedef struct x9file x9file;
-struct x9file {
- C9fid fid;
- C9tag tag;
- uint8_t rdbuf[Msize];
- uint8_t wrbuf[Msize];
+struct C9aux {
+ C9ctx *ctx;
+ C9tag *tag;
+ int f;
+ int flags;
+ uint8_t rdbuf[Msize];
+ uint8_t wrbuf[Msize];
uint32_t wroff;
};
@@ -86,8 +88,8 @@
int dpi;
int bpl;
C9ctx *ctx;
- x9file *mouse;
- x9file *keybd;
+ C9aux *mouse;
+ C9aux *keybd;
};
int debug = 0;