fix typos and tested writing to ctl from uxn. it works!
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmDecxwACgkQO3+8IhRO Y5gR6A/9FpFpAc3OgCtg1fz5B7LmawXlmtK4/TDEJJ6I8Vw7wLijRuZL12erIVi1 Npdr05CRxv37TgbNQPkVD772uLQrUnbjbNSatrjH9HTn6zJBAZxMLndguI8YDz88 zl1c6GRIduKUbWl9gdA2eS0utnyffRTKguIGqBk4LWJ52jZId546FWEbawpLJ85l WMoNgBVPP9AebbztETHdqRjFl1mU2gqvRycACwkiNEP3LM3U8Wosgm2lVCLqeyaJ WCdFhThWrPAjpHS8K/NkUlcNJaPnEvDPxzhdCbznzgKKp7Ivj0CFFMWDaWwO6kzM E4uuSD6O0e9wIb+892r5HoeWYuOYcOjKlLMS8oiaq/36wvPyijGJFDbkFVTFOODB YtmuFyucJDGWyKPGXtB0WAj1cLk2EHShfe53TeSAO/p/eBcGr+Usz4YLwv0svwAi fNjHTjDEwA7yZeSlgL/zN6um1WvGSCSQGfZvvC7azcjZ2uBVXkTNIBo00BAuBGYj OyIM3LvhBn9WpJArMtXFcm92+TZHas8kr8W4dmcivpdQIIq5brnfVLYevHD538EU cQJtY66g7D1OtEDhnAEgJG+TDRXTKiN5CNuwxyo92NwZiwpL7NjvjVyqffeZAXSE XmSW8WD6WqwQxphD7pBpInDjTaqWEDdX4Sq7Jt6j1+LwXUgfyTk= =9NN2 -----END PGP SIGNATURE-----
1 files changed,
14 insertions(+),
7 deletions(-)
jump to
M
xrxs.c
→
xrxs.c
@@ -34,6 +34,8 @@ static char Ebad[] = "something bad happened";
static char Enomem[] = "no memory"; static char Euname[] = "username is already taken"; +static Tree* tree; + typedef enum { CTL = 1, USERS, CARTS, SLOT, DATA, REALMS, UNIVERSE } FileType; typedef struct Aux Aux;@@ -61,6 +63,11 @@
static UserInfo users_table[64]; void xrxs_attach(Req* r) { + /* As it is, once the user detaches, they will stay in the table + * until the server restarts. We have to figure out some way + * to detect a detach to remove them... You can't delay respond() + * or the attach will never complete. + */ static ushort id = 1; int i = 0; int l = 0;@@ -73,9 +80,10 @@ usr++;
} for (i = 0; i < 64; i++) { usr = users_table[i].name; - if (scmp(usr, username)) + if (scmp(usr, username)){ respond(r, Euname); return; + } if (*usr == 0) { scpy(username, usr, l+1); users_table[i].id = id++;@@ -149,16 +157,17 @@ char cmd[16];
char* c = r->ifcall.data; int i; - for (i = 0; i < r->ifcall.count; i++) { + /*for (i = 0; i < r->ifcall.count; i++) { ccat(cmd, *c++); } unsigned long long const cmd_hashv = hash(cmd); switch (cmd_hashv) { - default: - break; - } + default:*/ + createfile(tree->root, "success", nil, 0777, nil); + /*break; + }*/ r->ofcall.count = r->ifcall.count; r->fid->file->dir.length = r->ifcall.count; respond(r, nil);@@ -268,13 +277,11 @@ .attach = xrxs_attach,
.open = fsopen, .read = xrxs_read, .write = xrxs_write, - .create = fsopen, .wstat = wstat}; int threadmaybackground(void) { return 1; } void threadmain(int argc, char* argv[]) { - Tree* tree; char* mtpt = nil; char* usocket = nil; int i;