commit 5549d217e8287b5d01215ce6169e55d93f50195a
parent b248569f4d0ab95eaf8ee4caaa4dc66f5720eb63
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Thu, 23 Mar 2006 10:46:35 +0100
renamed ctag occurences to tag, now the code should be much more readable
Diffstat:
5 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c
@@ -545,8 +545,8 @@ type2stat(Stat *stat, char *wname, Qid *dir)
default:
{
unsigned int i, len = 0;
- for(i = 0; i < nctag; i++)
- len += strlen(ctag[i]) + 1;
+ for(i = 0; i < ntag; i++)
+ len += strlen(tag[i]) + 1;
return mkstat(stat, dir, wname, len, DMREAD);
}
break;
@@ -882,17 +882,17 @@ xread(IXPConn *c, Fcall *fcall)
if(m->qid.dir_type == FsDroot) {
len = 0;
/* jump to offset */
- for(i = 0; i < nctag; i++) {
- len += strlen(ctag[i]) + 1;
+ for(i = 0; i < ntag; i++) {
+ len += strlen(tag[i]) + 1;
if(len <= fcall->offset)
continue;
}
/* offset found, proceeding */
- for(; i < nctag; i++) {
- len = strlen(ctag[i]) + 1;
+ for(; i < ntag; i++) {
+ len = strlen(tag[i]) + 1;
if(fcall->count + len > fcall->iounit)
break;
- memcpy(p + fcall->count, ctag[i], len - 1);
+ memcpy(p + fcall->count, tag[i], len - 1);
memcpy(p + fcall->count + len - 1, "\n", 1);
fcall->count += len;
}
@@ -913,7 +913,7 @@ xread(IXPConn *c, Fcall *fcall)
p = ixp_enc_stat(p, &stat);
fcall->count += type2stat(&stat, "bar", &m->qid);
p = ixp_enc_stat(p, &stat);
- if(nctag) {
+ if(ntag) {
fcall->count += type2stat(&stat, "tags", &m->qid);
p = ixp_enc_stat(p, &stat);
}
@@ -1090,11 +1090,11 @@ xread(IXPConn *c, Fcall *fcall)
memcpy(p, buf, fcall->count);
break;
default:
- for(i = 0; i < nctag; i++) {
- len = strlen(ctag[i]) + 1;
+ for(i = 0; i < ntag; i++) {
+ len = strlen(tag[i]) + 1;
if(fcall->count + len > fcall->iounit)
break;
- memcpy(p + fcall->count, ctag[i], len - 1);
+ memcpy(p + fcall->count, tag[i], len - 1);
memcpy(p + fcall->count + len - 1, "\n", 1);
fcall->count += len;
}
diff --git a/cmd/wm/tag.c b/cmd/wm/tag.c
@@ -51,17 +51,17 @@ update_tags()
{
unsigned int i, j;
char buf[256];
- char **newctag = nil;
- unsigned int newctagsz = 0, nnewctag = 0;
+ char **newtag = nil;
+ unsigned int newtagsz = 0, nnewtag = 0;
for(i = 0; i < nclient; i++) {
for(j = 0; j < client[i]->ntag; j++) {
if(!strncmp(client[i]->tag[j], "~", 2)) /* magic floating tag */
continue;
- if(!istag(newctag, nnewctag, client[i]->tag[j])) {
- newctag = (char **)cext_array_attach((void **)newctag, strdup(client[i]->tag[j]),
- sizeof(char *), &newctagsz);
- nnewctag++;
+ if(!istag(newtag, nnewtag, client[i]->tag[j])) {
+ newtag = (char **)cext_array_attach((void **)newtag, strdup(client[i]->tag[j]),
+ sizeof(char *), &newtagsz);
+ nnewtag++;
}
}
}
@@ -69,31 +69,31 @@ update_tags()
for(i = 0; i < nview; i++)
if(hasclient(view[i])) {
tags2str(buf, sizeof(buf), view[i]->tag, view[i]->ntag);
- if(!istag(newctag, nnewctag, buf)) {
- newctag = (char **)cext_array_attach((void **)newctag, strdup(buf),
- sizeof(char *), &newctagsz);
- nnewctag++;
+ if(!istag(newtag, nnewtag, buf)) {
+ newtag = (char **)cext_array_attach((void **)newtag, strdup(buf),
+ sizeof(char *), &newtagsz);
+ nnewtag++;
}
}
/* propagate tagging events */
- for(i = 0; i < nnewctag; i++)
- if(!istag(ctag, nctag, newctag[i])) {
- snprintf(buf, sizeof(buf), "NewTag %s\n", newctag[i]);
+ for(i = 0; i < nnewtag; i++)
+ if(!istag(tag, ntag, newtag[i])) {
+ snprintf(buf, sizeof(buf), "NewTag %s\n", newtag[i]);
write_event(buf, True);
}
- for(i = 0; i < nctag; i++) {
- if(!istag(newctag, nnewctag, ctag[i])) {
- snprintf(buf, sizeof(buf), "RemoveTag %s\n", ctag[i]);
+ for(i = 0; i < ntag; i++) {
+ if(!istag(newtag, nnewtag, tag[i])) {
+ snprintf(buf, sizeof(buf), "RemoveTag %s\n", tag[i]);
write_event(buf, True);
}
- free(ctag[i]);
+ free(tag[i]);
}
- free(ctag);
- ctag = newctag;
- nctag = nnewctag;
- ctagsz = newctagsz;
+ free(tag);
+ tag = newtag;
+ ntag = nnewtag;
+ tagsz = newtagsz;
for(i = 0; nview && (i < nclient); i++) {
for(j = 0; j < nview; j++) {
@@ -105,8 +105,8 @@ update_tags()
organize_client(view[sel], client[i]);
}
- if(!nview && nctag)
- select_view(ctag[0]);
+ if(!nview && ntag)
+ select_view(tag[0]);
}
unsigned int
diff --git a/cmd/wm/view.c b/cmd/wm/view.c
@@ -189,11 +189,11 @@ select_view(char *arg)
if(!v)
return;
cext_strlcpy(def.tag, arg, sizeof(def.tag));
- if(!istag(ctag, nctag, arg)) {
+ if(!istag(tag, ntag, arg)) {
char buf[256];
- ctag = (char **)cext_array_attach((void **)ctag, strdup(arg),
- sizeof(char *), &ctagsz);
- nctag++;
+ tag = (char **)cext_array_attach((void **)tag, strdup(arg),
+ sizeof(char *), &tagsz);
+ ntag++;
snprintf(buf, sizeof(buf), "NewTag %s\n", arg);
write_event(buf, True);
}
diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c
@@ -296,9 +296,9 @@ main(int argc, char *argv[])
ixp_server_open_conn(&srv, ConnectionNumber(dpy), check_x_event, nil);
init_x_event_handler();
- nctag = ctagsz = nview = nclient = viewsz = clientsz = sel = 0;
+ ntag = tagsz = nview = nclient = viewsz = clientsz = sel = 0;
view = nil;
- ctag = nil;
+ tag = nil;
client = nil;
expand[0] = 0;
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -180,9 +180,9 @@ Label **label;
unsigned int nlabel;
unsigned int labelsz;
char expand[256];
-char **ctag;
-unsigned int nctag;
-unsigned int ctagsz;
+char **tag;
+unsigned int ntag;
+unsigned int tagsz;
Display *dpy;
IXPServer *ixps;