aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-12-18 16:39:59 -0600
committerRob Landley <rob@landley.net>2015-12-18 16:39:59 -0600
commit8b64a3e64775ddf779f828560543393bdcf2f31d (patch)
tree9f8098b6a5d71042a48d45b055523ab3285719bb /scripts
parent1efcb17d971666d334468149c5a604e76b5d9092 (diff)
downloadtoybox-8b64a3e64775ddf779f828560543393bdcf2f31d.tar.gz
Next giant chunk of ps work: add _NAME_TAG bitmask values to tags.h
(leading underscore version is 1<<NAME_TAG version, with 1LL for >31 shift), suck lots of magic constants out of ps and use tag macros instead, redo command line display so there's now 6 variants (CMD COMM ARGS from posix, NAME CMDLINE from android, and COMMAND for completeness). Document more cases where posix is nuts or widely ignored.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mktags.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/mktags.c b/scripts/mktags.c
index e6fceeab..3604260c 100644
--- a/scripts/mktags.c
+++ b/scripts/mktags.c
@@ -47,8 +47,10 @@ int main(int argc, char *argv[])
if (!isalpha(*s) && !isdigit(*s)) *s = '_';
s++;
}
- printf("% *d\n",
- 30-printf("#define %s_%.*s", tag, (int)(s-start), start), ++idx);
+ printf("#define %s_%*.*s %d\n", tag, -40, (int)(s-start), start, idx);
+ printf("#define _%s_%*.*s (1%s<<%d)\n", tag, -39, (int)(s-start), start,
+ idx>31 ? "LL": "", idx);
+ idx++;
}
free(line);
}