Main index | Section 3 | Options |
#include <libxo/xo.h>
The name parameter give the name of the attribute to be encoded. The fmt parameter gives a printf-style format string used to format the value of the attribute using any remaining arguments, or the vap parameter as passed to xo_attr_hv().
EXAMPLE: xo_attr("seconds", "%ld", (unsigned long) login_time); struct tm *tmp = localtime(login_time); strftime(buf, sizeof(buf), "%R", tmp); xo_emit("Logged in at {:login-time} , buf); XML: <login-time seconds="1408336270">00:14</login-time>
Since attributes are only emitted in XML, their use should be limited to meta-data and additional or redundant representations of data already emitted in other form.
LIBXO (3) | July, 2014 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs. | ” |
— Maurice Wilkes |