testprint.c - 9base - revived minimalist port of Plan 9 userland to Unix
(HTM) git clone git://git.suckless.org/9base
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
testprint.c (334B)
---
1 #include <u.h>
2 #include <libc.h>
3
4 void
5 main(int argc, char **argv)
6 {
7 char c;
8
9 c = argv[1][strlen(argv[1])-1];
10 if(c == 'f' || c == 'e' || c == 'g' || c == 'F' || c == 'E' || c == 'G')
11 print(argv[1], atof(argv[2]));
12 else if(c == 'x' || c == 'u' || c == 'd' || c == 'c' || c == 'C' || c == 'X')
13 print(argv[1], atoi(argv[2]));
14 }