mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
64-bit
This commit is contained in:
parent
c9ee9e62f6
commit
3fe9465ac9
14 changed files with 30 additions and 27 deletions
|
@ -41,7 +41,7 @@ nrep(void)
|
||||||
|
|
||||||
sym = symlook("NREP", S_VAR, 0);
|
sym = symlook("NREP", S_VAR, 0);
|
||||||
if(sym){
|
if(sym){
|
||||||
w = (Word *) sym->value;
|
w = sym->u.ptr;
|
||||||
if (w && w->s && *w->s)
|
if (w && w->s && *w->s)
|
||||||
nreps = atoi(w->s);
|
nreps = atoi(w->s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,15 +55,15 @@ atimeof(int force, char *name)
|
||||||
t = mtime(archive);
|
t = mtime(archive);
|
||||||
sym = symlook(archive, S_AGG, 0);
|
sym = symlook(archive, S_AGG, 0);
|
||||||
if(sym){
|
if(sym){
|
||||||
if(force || (t > (long)sym->value)){
|
if(force || (t > sym->u.value)){
|
||||||
atimes(archive);
|
atimes(archive);
|
||||||
sym->value = (void *)t;
|
sym->u.value = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
atimes(archive);
|
atimes(archive);
|
||||||
/* mark the aggegate as having been done */
|
/* mark the aggegate as having been done */
|
||||||
symlook(strdup(archive), S_AGG, "")->value = (void *)t;
|
symlook(strdup(archive), S_AGG, "")->u.value = t;
|
||||||
}
|
}
|
||||||
/* truncate long member name to sizeof of name field in archive header */
|
/* truncate long member name to sizeof of name field in archive header */
|
||||||
if(dolong)
|
if(dolong)
|
||||||
|
@ -72,7 +72,7 @@ atimeof(int force, char *name)
|
||||||
snprint(buf, sizeof(buf), "%s(%.*s)", archive, SARNAME, member);
|
snprint(buf, sizeof(buf), "%s(%.*s)", archive, SARNAME, member);
|
||||||
sym = symlook(buf, S_TIME, 0);
|
sym = symlook(buf, S_TIME, 0);
|
||||||
if (sym)
|
if (sym)
|
||||||
return (long)sym->value; /* uggh */
|
return sym->u.value;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ atimes(char *ar)
|
||||||
}
|
}
|
||||||
snprint(buf, sizeof buf, "%s(%s)", ar, name);
|
snprint(buf, sizeof buf, "%s(%s)", ar, name);
|
||||||
sym = symlook(strdup(buf), S_TIME, (void *)t);
|
sym = symlook(strdup(buf), S_TIME, (void *)t);
|
||||||
sym->value = (void *)t;
|
sym->u.value = t;
|
||||||
skip:
|
skip:
|
||||||
t = atol(h.size);
|
t = atol(h.size);
|
||||||
if(t&01) t++;
|
if(t&01) t++;
|
||||||
|
|
|
@ -79,7 +79,7 @@ ecopy(Symtab *s)
|
||||||
for(p = myenv; *p; p++)
|
for(p = myenv; *p; p++)
|
||||||
if(strcmp(*p, s->name) == 0)
|
if(strcmp(*p, s->name) == 0)
|
||||||
return;
|
return;
|
||||||
envinsert(s->name, (Word *) s->value);
|
envinsert(s->name, s->u.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -23,7 +23,7 @@ timeof(char *name, int force)
|
||||||
|
|
||||||
sym = symlook(name, S_TIME, 0);
|
sym = symlook(name, S_TIME, 0);
|
||||||
if (sym)
|
if (sym)
|
||||||
return (long) sym->value; /* uggh */
|
return sym->u.value;
|
||||||
|
|
||||||
t = mtime(name);
|
t = mtime(name);
|
||||||
if(t == 0)
|
if(t == 0)
|
||||||
|
@ -77,7 +77,7 @@ timeinit(char *s)
|
||||||
} while(*s);
|
} while(*s);
|
||||||
c = *s;
|
c = *s;
|
||||||
*s = 0;
|
*s = 0;
|
||||||
symlook(strdup(cp), S_TIME, (void *)t)->value = (void *)t;
|
symlook(strdup(cp), S_TIME, (void *)t)->u.value = t;
|
||||||
if (c)
|
if (c)
|
||||||
*s++ = c;
|
*s++ = c;
|
||||||
while(*s){
|
while(*s){
|
||||||
|
|
|
@ -40,14 +40,14 @@ applyrules(char *target, char *cnt)
|
||||||
/* print("applyrules(%lux='%s')\n", target, target); */
|
/* print("applyrules(%lux='%s')\n", target, target); */
|
||||||
sym = symlook(target, S_NODE, 0);
|
sym = symlook(target, S_NODE, 0);
|
||||||
if(sym)
|
if(sym)
|
||||||
return (Node *)(sym->value);
|
return sym->u.ptr;
|
||||||
target = strdup(target);
|
target = strdup(target);
|
||||||
node = newnode(target);
|
node = newnode(target);
|
||||||
head.n = 0;
|
head.n = 0;
|
||||||
head.next = 0;
|
head.next = 0;
|
||||||
sym = symlook(target, S_TARGET, 0);
|
sym = symlook(target, S_TARGET, 0);
|
||||||
memset((char*)rmatch, 0, sizeof(rmatch));
|
memset((char*)rmatch, 0, sizeof(rmatch));
|
||||||
for(r = sym? (Rule *)(sym->value):0; r; r = r->chain){
|
for(r = sym? sym->u.ptr:0; r; r = r->chain){
|
||||||
if(r->attr&META) continue;
|
if(r->attr&META) continue;
|
||||||
if(strcmp(target, r->target)) continue;
|
if(strcmp(target, r->target)) continue;
|
||||||
if((!r->recipe || !*r->recipe) && (!r->tail || !r->tail->s || !*r->tail->s)) continue; /* no effect; ignore */
|
if((!r->recipe || !*r->recipe) && (!r->tail || !r->tail->s || !*r->tail->s)) continue; /* no effect; ignore */
|
||||||
|
|
|
@ -221,11 +221,11 @@ outofdate(Node *node, Arc *arc, int eval)
|
||||||
str = strdup(buf);
|
str = strdup(buf);
|
||||||
ret = pcmp(arc->prog, node->name, arc->n->name, arc->r->shellt, arc->r->shellcmd);
|
ret = pcmp(arc->prog, node->name, arc->n->name, arc->r->shellt, arc->r->shellcmd);
|
||||||
if(sym)
|
if(sym)
|
||||||
sym->value = (void *)ret;
|
sym->u.value = ret;
|
||||||
else
|
else
|
||||||
symlook(str, S_OUTOFDATE, (void *)ret);
|
symlook(str, S_OUTOFDATE, (void *)ret);
|
||||||
} else
|
} else
|
||||||
ret = (int)sym->value;
|
ret = sym->u.value;
|
||||||
return(ret-1);
|
return(ret-1);
|
||||||
} else if(strchr(arc->n->name, '(') && arc->n->time == 0) /* missing archive member */
|
} else if(strchr(arc->n->name, '(') && arc->n->time == 0) /* missing archive member */
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -129,7 +129,10 @@ typedef struct Symtab
|
||||||
{
|
{
|
||||||
short space;
|
short space;
|
||||||
char *name;
|
char *name;
|
||||||
void *value;
|
union {
|
||||||
|
void *ptr;
|
||||||
|
uintptr value;
|
||||||
|
} u;
|
||||||
struct Symtab *next;
|
struct Symtab *next;
|
||||||
} Symtab;
|
} Symtab;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ dorecipe(Node *node)
|
||||||
aw = aw->next;
|
aw = aw->next;
|
||||||
if((s = symlook(buf, S_NODE, 0)) == 0)
|
if((s = symlook(buf, S_NODE, 0)) == 0)
|
||||||
continue; /* not a node we are interested in */
|
continue; /* not a node we are interested in */
|
||||||
n = (Node *)s->value;
|
n = s->u.ptr;
|
||||||
if(aflag == 0 && n->time) {
|
if(aflag == 0 && n->time) {
|
||||||
for(a = n->prereqs; a; a = a->next)
|
for(a = n->prereqs; a; a = a->next)
|
||||||
if(a->n && outofdate(n, a, 0))
|
if(a->n && outofdate(n, a, 0))
|
||||||
|
|
|
@ -15,7 +15,7 @@ addrule(char *head, Word *tail, char *body, Word *ahead, int attr, int hline, ch
|
||||||
r = 0;
|
r = 0;
|
||||||
reuse = 0;
|
reuse = 0;
|
||||||
if(sym = symlook(head, S_TARGET, 0)){
|
if(sym = symlook(head, S_TARGET, 0)){
|
||||||
for(r = (Rule *)sym->value; r; r = r->chain)
|
for(r = sym->u.ptr; r; r = r->chain)
|
||||||
if(rcmp(r, head, tail) == 0){
|
if(rcmp(r, head, tail) == 0){
|
||||||
reuse = 1;
|
reuse = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -35,7 +35,7 @@ addrule(char *head, Word *tail, char *body, Word *ahead, int attr, int hline, ch
|
||||||
r->prog = prog;
|
r->prog = prog;
|
||||||
r->rule = nrules++;
|
r->rule = nrules++;
|
||||||
if(!reuse){
|
if(!reuse){
|
||||||
rr = (Rule *)symlook(head, S_TARGET, (void *)r)->value;
|
rr = symlook(head, S_TARGET, (void *)r)->u.ptr;
|
||||||
if(rr != r){
|
if(rr != r){
|
||||||
r->chain = rr->chain;
|
r->chain = rr->chain;
|
||||||
rr->chain = r;
|
rr->chain = r;
|
||||||
|
|
|
@ -168,7 +168,7 @@ again: /* rogue processes */
|
||||||
for(w = j->t; w; w = w->next){
|
for(w = j->t; w; w = w->next){
|
||||||
if((s = symlook(w->s, S_NODE, 0)) == 0)
|
if((s = symlook(w->s, S_NODE, 0)) == 0)
|
||||||
continue; /* not interested in this node */
|
continue; /* not interested in this node */
|
||||||
update(uarg, (Node *)s->value);
|
update(uarg, s->u.ptr);
|
||||||
}
|
}
|
||||||
if(nrunning < nproclimit)
|
if(nrunning < nproclimit)
|
||||||
sched();
|
sched();
|
||||||
|
@ -182,7 +182,7 @@ nproc(void)
|
||||||
Word *w;
|
Word *w;
|
||||||
|
|
||||||
if(sym = symlook("NPROC", S_VAR, 0)) {
|
if(sym = symlook("NPROC", S_VAR, 0)) {
|
||||||
w = (Word *) sym->value;
|
w = sym->u.ptr;
|
||||||
if (w && w->s && w->s[0])
|
if (w && w->s && w->s[0])
|
||||||
nproclimit = atoi(w->s);
|
nproclimit = atoi(w->s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ symlook(char *sym, int space, void *install)
|
||||||
s = (Symtab *)Malloc(sizeof(Symtab));
|
s = (Symtab *)Malloc(sizeof(Symtab));
|
||||||
s->space = space;
|
s->space = space;
|
||||||
s->name = sym;
|
s->name = sym;
|
||||||
s->value = install;
|
s->u.ptr = install;
|
||||||
s->next = hash[h];
|
s->next = hash[h];
|
||||||
hash[h] = s;
|
hash[h] = s;
|
||||||
return(s);
|
return(s);
|
||||||
|
|
|
@ -41,7 +41,7 @@ readenv(void)
|
||||||
continue;
|
continue;
|
||||||
s = strdup(*p);
|
s = strdup(*p);
|
||||||
setvar(s, (void *)w);
|
setvar(s, (void *)w);
|
||||||
symlook(s, S_EXPORTED, (void*)"")->value = (void*)"";
|
symlook(s, S_EXPORTED, (void*)"")->u.ptr = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "mk.h"
|
#include "mk.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
setvar(char *name, void *value)
|
setvar(char *name, void *ptr)
|
||||||
{
|
{
|
||||||
symlook(name, S_VAR, value)->value = value;
|
symlook(name, S_VAR, ptr)->u.ptr = ptr;
|
||||||
symlook(name, S_MAKEVAR, (void*)"");
|
symlook(name, S_MAKEVAR, (void*)"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ print1(Symtab *s)
|
||||||
Word *w;
|
Word *w;
|
||||||
|
|
||||||
Bprint(&bout, "\t%s=", s->name);
|
Bprint(&bout, "\t%s=", s->name);
|
||||||
for (w = (Word *) s->value; w; w = w->next)
|
for (w = s->u.ptr; w; w = w->next)
|
||||||
Bprint(&bout, "'%s'", w->s);
|
Bprint(&bout, "'%s'", w->s);
|
||||||
Bprint(&bout, "\n");
|
Bprint(&bout, "\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ varmatch(char *name, char **s)
|
||||||
sym = symlook(name, S_VAR, 0);
|
sym = symlook(name, S_VAR, 0);
|
||||||
if(sym){
|
if(sym){
|
||||||
/* check for at least one non-NULL value */
|
/* check for at least one non-NULL value */
|
||||||
for (w = (Word*)sym->value; w; w = w->next)
|
for (w = sym->u.ptr; w; w = w->next)
|
||||||
if(w->s && *w->s)
|
if(w->s && *w->s)
|
||||||
return wdup(w);
|
return wdup(w);
|
||||||
}
|
}
|
||||||
|
@ -113,10 +113,10 @@ expandvar(char **s)
|
||||||
*s = end+1;
|
*s = end+1;
|
||||||
|
|
||||||
sym = symlook(buf->start, S_VAR, 0);
|
sym = symlook(buf->start, S_VAR, 0);
|
||||||
if(sym == 0 || sym->value == 0)
|
if(sym == 0 || sym->u.ptr == 0)
|
||||||
w = newword(buf->start);
|
w = newword(buf->start);
|
||||||
else
|
else
|
||||||
w = subsub((Word*) sym->value, cp, end);
|
w = subsub(sym->u.ptr, cp, end);
|
||||||
freebuf(buf);
|
freebuf(buf);
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue