diff options
author | rsc <devnull@localhost> | 2006-05-31 04:55:43 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-05-31 04:55:43 +0000 |
commit | 14695b90acb1226ee1b137350e6dbbbc73c2f0e7 (patch) | |
tree | 80977dd7ae4bc48269845cb62061f6a4063fdfd1 /src/cmd/graph | |
parent | 6bd2526b02d9c05391932097f2a8b71c1a1bdc59 (diff) | |
download | plan9port-14695b90acb1226ee1b137350e6dbbbc73c2f0e7.tar.gz plan9port-14695b90acb1226ee1b137350e6dbbbc73c2f0e7.tar.bz2 plan9port-14695b90acb1226ee1b137350e6dbbbc73c2f0e7.zip |
no c99 isms
Diffstat (limited to 'src/cmd/graph')
-rw-r--r-- | src/cmd/graph/graph.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/cmd/graph/graph.c b/src/cmd/graph/graph.c index 336b0b18..7da0b81b 100644 --- a/src/cmd/graph/graph.c +++ b/src/cmd/graph/graph.c @@ -67,16 +67,29 @@ struct z { struct { char *name; int next; -} palette[] = { - ['b'] { "blue", 'b' }, - ['c'] { "cyan", 'c' }, - ['g'] { "green", 'g' }, - ['k'] { "kblack", 'k' }, - ['m'] { "magenta", 'm' }, - ['r'] { "red", 'r' }, - ['w'] { "white", 'w' }, - ['y'] { "yellow", 'y' } +} palette[256]; + +static char* colors[] = { + "blue", + "cyan", + "green", + "kblack", + "magenta", + "red", + "white", + "yellow" }; +static void +initpalette(void) +{ + int i; + + for(i=0; i<nelem(colors); i++){ + palette[(uchar)colors[i][0]].name = colors[i]; + palette[(uchar)colors[i][0]].next = colors[i][0]; + } +} + int pencolor = 'k'; void init(struct xy *); @@ -106,6 +119,7 @@ void axlab(char, struct xy *, char *); int main(int argc,char *argv[]){ + initpalette(); openpl(); range(0,0,4096,4096); init(&xd); |