9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | 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 }