-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all,
I'm proud to present this patch which enables the use of unique
client ID numbers instead of relative position indices in the
wmii-3.1 file system. Please observe its effects below.
Cheers.
$ wmiir read /view/sel
d-r-x------ sun sun 0 Sat Sep 9 00:31:22 2006 5
- ---w------- sun sun 0 Sat Sep 9 00:31:22 2006 ctl
- --rw------- sun sun 7 Sat Sep 9 00:31:22 2006 mode
d-r-x------ sun sun 0 Sat Sep 9 00:31:22 2006 sel
$ wmiir read /view/sel/0
wmiir: cannot open file '/view/sel/0': file not found
$ wmiir read /view/sel/5/
- --r-------- sun sun 29 Sat Sep 9 00:31:31 2006 class
- ---w------- sun sun 0 Sat Sep 9 00:31:31 2006 ctl
- --rw------- sun sun 14 Sat Sep 9 00:31:31 2006 geom
- --r-------- sun sun 1 Sat Sep 9 00:31:31 2006 index
- --r-------- sun sun 22 Sat Sep 9 00:31:31 2006 name
- --rw------- sun sun 4 Sat Sep 9 00:31:31 2006 tags
$ wmiir read /view/sel/5/index
5
$ wmiir read /view/sel/5/class
Gnome-terminal:gnome-terminal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFFAm6amV9O7RYnKMcRAoRUAKCf9wSZJfjvE+HGgG9CNl1ha2FDBACfUT+J
ZEymPRp9TFa8c0UJ2LSG0L4=
=kD9M
-----END PGP SIGNATURE-----
diff -bur wmii-3.1.orig/cmd/wm/fs.c wmii-3.1/cmd/wm/fs.c
--- wmii-3.1.orig/cmd/wm/fs.c 2006-06-17 04:44:30.000000000 -0700
+++ wmii-3.1/cmd/wm/fs.c 2006-09-09 00:22:58.000000000 -0700
@@ -337,7 +337,7 @@
static Qid *
qid_of_name(Qid wqid[IXP_MAX_WELEM], unsigned short qsel, char *name)
{
- int i1 = -1, i2 = -1, i3 = -1, i;
+ int i1 = -1, i2 = -1, i3 = -1, i, j;
unsigned char dir_type, type;
static Qid new;
@@ -400,7 +400,18 @@
}
else {
i = cext_strtonum(name, 0, 0xffff, &errstr);
- if(errstr || (i >= a->frame.size))
+
+ if (client.size) {
+ for (j = 0; j < a->frame.size; j++) {
+ if (a->frame.data[j]->client == client.data[i]) {
+ i = j;
+ j = -1;
+ break;
+ }
+ }
+ }
+
+ if(errstr || (i >= a->frame.size) || j != -1)
return nil;
new.path = pack_qpath(FsDclient, p->id, a->id, a->frame.data[i]->id);
}
@@ -924,7 +935,7 @@
}
/* offset found, proceeding */
for(; i < view.data[i1]->area.data[i2]->frame.size; i++) {
- snprintf(buf, sizeof(buf), "%u", i);
+ snprintf(buf, sizeof(buf), "%u", idx_of_client_id(view.data[i1]->area.data[i2]->frame.data[i]->client->id));
len = stat_of_name(&stat, buf, m->wqid, m->sel);
if(fcall->count + len > fcall->iounit)
break;
@@ -1097,7 +1108,7 @@
p = ixp_pack_stat(p, &stat);
}
for(i = 0; i < view.data[i1]->area.data[i2]->frame.size; i++) {
- snprintf(buf, sizeof(buf), "%u", i);
+ snprintf(buf, sizeof(buf), "%u", idx_of_client_id(view.data[i1]->area.data[i2]->frame.data[i]->client->id));
len = stat_of_name(&stat, buf, m->wqid, m->sel);
if(fcall->count + len > fcall->iounit)
break;
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii