2 * Copyright (c) 2014, 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, July 2014
18 { "employee", "object", "Employee data" },
19 { "first-name", "string", "First name of employee" },
20 { "last-name", "string", "Last name of employee" },
21 { "department", "number", "Department number" },
23 int info_count = (sizeof(info) / sizeof(info[0]));
26 main (int argc, char **argv)
33 { "Terry", "Jones", 660 },
34 { "Leslie", "Patterson", 341 },
35 { "Ashley", "Smith", 1440 },
39 argc = xo_parse_args(argc, argv);
43 xo_set_info(NULL, info, info_count);
45 xo_set_flags(NULL, XOF_DTRT);
47 xo_open_container("employees");
48 xo_open_list("employee");
50 for ( ; ep->e_first; ep++) {
51 xo_open_instance("employee");
52 xo_emit("{:first-name} {:last-name} works in dept #{:department/%u}\n",
53 ep->e_first, ep->e_last, ep->e_dept);
54 xo_close_instance_d();
58 xo_close_container_d();