Blame


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