wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 3229e517358fc7de7968b8c252168743853b61af
parent ff7bfbfc0298421cc0b5a599918ba88b0f96b691
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Sat, 28 Jan 2006 17:41:15 +0200

implemented remove in bar2 :)


Diffstat:
cmd/wmiibar2.c | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/cmd/wmiibar2.c b/cmd/wmiibar2.c @@ -345,6 +345,27 @@ mkstat(Stat *stat, Qid *dir, char *name, unsigned long long length, unsigned int } static int +xremove(IXPServer *s, IXPConn *c) +{ + Map *map = fid_to_map(c->aux, s->fcall.fid); + unsigned short i; + + if(!map) { + s->errstr = "invalid fid"; + return -1; + } + i = qpath_item(map->qid.path); + s->fcall.id = RREMOVE; + if((qpath_type(map->qid.path) == Ditem) && i && (i < nitem)) { + Item *it = item[i]; + detach_item(it); + free(it); + return 0; + } + return -1; +} + +static int xread(IXPServer *s, IXPConn *c) { Stat stat; @@ -595,6 +616,7 @@ static IXPTFunc funcs[] = { {TVERSION, ixp_server_tversion}, {TATTACH, xattach}, {TWALK, xwalk}, + {TREMOVE, xremove}, {TOPEN, xopen}, {TREAD, xread}, {TWRITE, xwrite},