Blame


1 91c13e54 2004-02-29 devnull /*
2 91c13e54 2004-02-29 devnull * The authors of this software are Rob Pike and Ken Thompson.
3 91c13e54 2004-02-29 devnull * Copyright (c) 2002 by Lucent Technologies.
4 91c13e54 2004-02-29 devnull * Permission to use, copy, modify, and distribute this software for any
5 91c13e54 2004-02-29 devnull * purpose without fee is hereby granted, provided that this entire notice
6 91c13e54 2004-02-29 devnull * is included in all copies of any software which is or includes a copy
7 91c13e54 2004-02-29 devnull * or modification of this software and in all copies of the supporting
8 91c13e54 2004-02-29 devnull * documentation for such software.
9 91c13e54 2004-02-29 devnull * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
10 c90dd38f 2004-12-29 devnull * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE
11 c90dd38f 2004-12-29 devnull * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
12 91c13e54 2004-02-29 devnull * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
13 91c13e54 2004-02-29 devnull */
14 df121a00 2004-12-26 devnull #include <stdio.h>
15 91c13e54 2004-02-29 devnull #include <stdarg.h>
16 91c13e54 2004-02-29 devnull #include <utf.h>
17 e5aa96ac 2004-12-26 devnull #include "plan9.h"
18 91c13e54 2004-02-29 devnull #include "fmt.h"
19 e5aa96ac 2004-12-26 devnull #include "fmtdef.h"
20 91c13e54 2004-02-29 devnull
21 91c13e54 2004-02-29 devnull int
22 91c13e54 2004-02-29 devnull main(int argc, char *argv[])
23 91c13e54 2004-02-29 devnull {
24 91c13e54 2004-02-29 devnull quotefmtinstall();
25 91c13e54 2004-02-29 devnull print("hello world\n");
26 91c13e54 2004-02-29 devnull print("x: %x\n", 0x87654321);
27 91c13e54 2004-02-29 devnull print("u: %u\n", 0x87654321);
28 91c13e54 2004-02-29 devnull print("d: %d\n", 0x87654321);
29 91c13e54 2004-02-29 devnull print("s: %s\n", "hi there");
30 91c13e54 2004-02-29 devnull print("q: %q\n", "hi i'm here");
31 91c13e54 2004-02-29 devnull print("c: %c\n", '!');
32 91c13e54 2004-02-29 devnull print("g: %g %g %g\n", 3.14159, 3.14159e10, 3.14159e-10);
33 91c13e54 2004-02-29 devnull print("e: %e %e %e\n", 3.14159, 3.14159e10, 3.14159e-10);
34 91c13e54 2004-02-29 devnull print("f: %f %f %f\n", 3.14159, 3.14159e10, 3.14159e-10);
35 91c13e54 2004-02-29 devnull print("smiley: %C\n", (Rune)0x263a);
36 df121a00 2004-12-26 devnull print("%g %.18g\n", 2e25, 2e25);
37 91c13e54 2004-02-29 devnull print("%2.18g\n", 1.0);
38 df121a00 2004-12-26 devnull print("%2.18f\n", 1.0);
39 91c13e54 2004-02-29 devnull print("%f\n", 3.1415927/4);
40 91c13e54 2004-02-29 devnull print("%d\n", 23);
41 91c13e54 2004-02-29 devnull print("%i\n", 23);
42 df121a00 2004-12-26 devnull print("%0.10d\n", 12345);
43 91c13e54 2004-02-29 devnull return 0;
44 91c13e54 2004-02-29 devnull }