commit 60b3b48f33726104a467881219cdf901e6ff2904
parent f27511b0ae31e929be3267825cf331948be74ce5
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Sat, 29 Apr 2006 18:51:45 +0200
9P bugfix #1, though I'll push a minor refactored version later (which is more error-prone with 9p2000.ko as well)
Diffstat:
6 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/TODO.wmii-4 b/TODO.wmii-4
@@ -1,3 +1,6 @@
+- add Qid-array with WELEM entries to IXPMap and other places in fs.c, to keep track of all qids of the last walk
+of current fid (maybe do this before wmii-3, because only this will really fix all issues)
+
- idea for column mode:
*: is the current default mode with fallback (shows arbitrary clients)
0: is the current max mode, shows only one client at the time (same bahvior as current)
@@ -15,6 +18,8 @@
associated ctl devices of clients.
- add wmiir ls (read should have same semantic as in 9p),
output without details, add -l for details like in ls of Plan 9
+- liblitz: window abstraction (creation, events), can be reused in menu and bar
+ and frames
ad new column mode:
diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c
@@ -308,15 +308,19 @@ name2type(char *name, unsigned char dir_type)
goto dyndir;
i = (unsigned short) cext_strtonum(name, 0, 0xffff, &err);
if(err)
- return -1;
+ return FsLast;
dyndir:
switch(dir_type) {
case FsDbars: return FsDbar; break;
case FsDview: return FsDarea; break;
case FsDclients: return FsDGclient; break;
case FsDarea: return FsDclient; break;
+ /* HACK: needs to be fixed */
+ case FsDbar:
+ case FsDclient:
+ case FsDGclient: return dir_type; break;
}
- return -1;
+ return FsLast;
}
static int
@@ -487,7 +491,7 @@ type2stat(Stat *stat, char *wname, Qid *dir)
decode_qpath(dir, &dir_type, &dir_i1, &dir_i2, &dir_i3);
if((dir_i1 == -1) || (dir_i2 == -1) || (dir_i3 == -1))
- return -1;
+ return 0;
type = name2type(wname, dir_type);
switch (type) {
diff --git a/cmd/wm/rule.c b/cmd/wm/rule.c
@@ -163,11 +163,11 @@ match(Client *c, PropVector prop)
void
apply_rules(Client *c)
{
+ PropVector prop = {0};
+
if(!def.rules)
goto Fallback;
- PropVector prop = {0};
-
cext_vattach(vector_of_props(&prop), c->classinst);
cext_vattach(vector_of_props(&prop), c->name);
diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c
@@ -272,6 +272,7 @@ main(int argc, char *argv[])
/* IXP server */
ixp_server_open_conn(&srv, i, new_ixp_conn, ixp_server_close_conn);
+ root_qid.dir_type = FsDroot;
root_qid.type = IXP_QTDIR;
root_qid.version = 0;
root_qid.path = mkqpath(FsDroot, 0, 0, 0);
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -62,7 +62,8 @@ enum {
FsFmode,
FsFtags,
FsFindex,
- FsFcolw
+ FsFcolw,
+ FsLast
};
enum { MIN_COLWIDTH = 64 };
diff --git a/libixp/ixp.h b/libixp/ixp.h
@@ -98,7 +98,7 @@ struct Qid {
unsigned char dir_type;
};
-/*stat structure */
+/* stat structure */
typedef struct {
unsigned short type;
unsigned int dev;
@@ -117,29 +117,29 @@ typedef struct {
unsigned char id;
unsigned short tag;
unsigned int fid;
- unsigned int maxmsg; /*Tversion, Rversion */
- char version[IXP_MAX_VERSION]; /*Tversion, Rversion */
- unsigned short oldtag; /*Tflush */
- char errstr[IXP_MAX_ERROR]; /*Rerror */
- Qid qid; /*Rattach, Ropen, Rcreate */
- unsigned int iounit; /*Ropen, Rcreate */
- Qid aqid; /*Rauth */
- unsigned int afid; /*Tauth, Tattach */
- char uname[IXP_MAX_ULEN]; /*Tauth, Tattach */
- char aname[IXP_MAX_FLEN]; /*Tauth, Tattach */
- unsigned int perm; /*Tcreate */
- char name[IXP_MAX_FLEN]; /*Tcreate */
- unsigned char mode; /*Tcreate, Topen */
- unsigned int newfid; /*Twalk */
- unsigned short nwname; /*Twalk */
- char wname[IXP_MAX_WELEM][IXP_MAX_FLEN]; /*Twalk */
- unsigned short nwqid; /*Rwalk */
- Qid wqid[IXP_MAX_WELEM]; /*Rwalk */
- unsigned long long offset; /*Tread, Twrite */
- unsigned int count; /*Tread, Twrite, Rread */
- Stat stat; /*Rstat */
- unsigned short nstat; /*Twstat, Rstat */
- unsigned char data[IXP_MAX_MSG]; /*Twrite, Rread, Twstat, *Rstat */
+ unsigned int maxmsg; /* Tversion, Rversion */
+ char version[IXP_MAX_VERSION]; /* Tversion, Rversion */
+ unsigned short oldtag; /* Tflush */
+ char errstr[IXP_MAX_ERROR]; /* Rerror */
+ Qid qid; /* Rattach, Ropen, Rcreate */
+ unsigned int iounit; /* Ropen, Rcreate */
+ Qid aqid; /* Rauth */
+ unsigned int afid; /* Tauth, Tattach */
+ char uname[IXP_MAX_ULEN]; /* Tauth, Tattach */
+ char aname[IXP_MAX_FLEN]; /* Tauth, Tattach */
+ unsigned int perm; /* Tcreate */
+ char name[IXP_MAX_FLEN]; /* Tcreate */
+ unsigned char mode; /* Tcreate, Topen */
+ unsigned int newfid; /* Twalk */
+ unsigned short nwname; /* Twalk */
+ char wname[IXP_MAX_WELEM][IXP_MAX_FLEN];/* Twalk */
+ unsigned short nwqid; /* Rwalk */
+ Qid wqid[IXP_MAX_WELEM]; /* Rwalk */
+ unsigned long long offset; /* Tread, Twrite */
+ unsigned int count; /* Tread, Twrite, Rread */
+ Stat stat; /* Rstat */
+ unsigned short nstat; /* Twstat, Rstat */
+ unsigned char data[IXP_MAX_MSG]; /* Twrite, Rread, Twstat, Rstat */
} Fcall;
typedef struct IXPServer IXPServer;
@@ -148,7 +148,7 @@ typedef struct IXPMap IXPMap;
struct IXPMap {
unsigned int fid;
- Qid qid;
+ Qid qid;
};