2 * Copyright (c) 2015, Juniper Networks, Inc.
4 * This SOFTWARE is licensed under the LICENSE provided in the
5 * ../Copyright file. By downloading, installing, copying, or otherwise
6 * using the SOFTWARE, you agree to be bound by the terms of that
8 * Phil Shafer, June 2015
19 #include <sys/param.h>
26 main (int argc, char **argv)
28 static char domainname[] = "gt_01";
29 static char path[MAXPATHLEN];
30 const char *tzone = "EST";
31 const char *lang = "pig_latin";
33 argc = xo_parse_args(argc, argv);
37 for (argc = 1; argv[argc]; argc++) {
38 if (strcmp(argv[argc], "tz") == 0)
40 else if (strcmp(argv[argc], "lang") == 0)
42 else if (strcmp(argv[argc], "po") == 0)
43 strlcpy(path, argv[++argc], sizeof(path));
46 setenv("LANG", lang, 1);
47 setenv("TZ", tzone, 1);
50 getcwd(path, sizeof(path));
51 strlcat(path, "/po", sizeof(path));
54 setlocale(LC_ALL, "");
55 bindtextdomain(domainname, path);
56 bindtextdomain("ldns", path);
57 bindtextdomain("strerror", path);
58 textdomain(domainname);
61 xo_open_container("top");
63 xo_emit("{G:}Your {qg:adjective} {g:noun} is {g:verb} {qg:owner} {g:target}\n",
64 "flaming", "sword", "burning", "my", "couch");
66 xo_emit("{G:}The {qg:adjective} {g:noun} was {g:verb} {qg:owner} {g:target}\n",
67 "flaming", "sword", "burning", "my", "couch");
71 for (i = 0; i < 5; i++)
72 xo_emit("{lw:bytes/%d}{Ngp:byte,bytes}\n", i);
74 xo_emit("{G:}{L:total} {:total/%u}\n", 1234);
76 xo_emit("{G:ldns}Received {:received/%zu} {Ngp:byte,bytes} "
77 "from {:from/%s}#{:port/%d} in {:time/%d} ms\n",
78 (size_t) 1234, "foop", 4321, 32);
80 xo_emit("{G:}Received {:received/%zu} {Ngp:byte,bytes} "
81 "from {:from/%s}#{:port/%d} in {:time/%d} ms\n",
82 (size_t) 1234, "foop", 4321, 32);
84 xo_emit("{G:/%s}Received {:received/%zu} {Ngp:byte,bytes} "
85 "from {:from/%s}#{:port/%d} in {:time/%d} ms\n",
86 "ldns", (size_t) 1234, "foop", 4321, 32);
89 tv.tv_sec = 1435085229;
93 (void) gmtime_r(&tv.tv_sec, &tm);
96 strftime(date, sizeof(date), "%+", &tm);
98 xo_emit("{G:}Only {:marzlevanes/%d} {Ngp:marzlevane,marzlevanes} "
99 "are functioning correctly\n", 3);
101 xo_emit("{G:}Version {:version} {:date}\n", "1.2.3", date);
104 xo_emit_warn("{G:}Unable to {g:verb/objectulate} forward velociping");
105 xo_emit_warn("{G:}{g:style/automatic} synchronization of {g:type/cardinal} "
106 "{g:target/grammeters} failed");
107 xo_emit("{G:}{Lwcg:hydrocoptic marzlevanes}{:marzlevanes/%d}\n", 6);
109 xo_emit("{G:}{Lwcg:Windings}{g:windings}\n", "lotus-o-delta");
111 xo_close_container("top");