UPSCLI_DUMP_AUTHCONF_ITEM(3)
============================

NAME
----

upscli_dump_authconf_item, upscli_dump_authconf_list - Print authentication configuration node or list

SYNOPSIS
--------

------
	#include <authconf.h>

	int upscli_dump_authconf_item(FILE *stream,
        upscli_authconf_t *node, int for_debug, int show_pass);

	size_t upscli_dump_authconf_list(FILE *stream,
        int for_debug, int show_pass);
------

DESCRIPTION
-----------

The *upscli_dump_authconf_item()* function prints a single configuration 'node'
to the specified 'stream'. If 'stream' is NULL, it defaults to `stdout`.

The *upscli_dump_authconf_list()* function prints the entire internal list of
authentication configurations to the specified 'stream'.

These functions are primarily intended for debugging purposes to verify the
content of the parsed configuration.

*for_debug*::
If 'for_debug' is '0', 'NULL' strings are not dumped, and the global section
(a 'node' with 'NULL' or empty 'section' field) is not indented. String
contents are printed in double-quotes with appropriate encoding to escape
characters special for NUT configuration parser. Theoretically, this could
be used to populate a conforming NUT auth configuration file.
+
If 'for_debug' is '1', 'NULL' strings are dumped as unquoted `<null>`, and
the global section is titled as `[<null>]` and indented like any other.
String contents are also printed in double-quotes with appropriate encoding.
+
If 'for_debug' is '2', behavior is like with '1' except that string contents
are printed in double-quotes but otherwise as they were (result may be invalid
for subsequent re-parsing, if there are unfortunate combinations of special
characters).

*show_pass*::
If 'show_pass' is '0', `<redacted>` would be shown in case of non-NULL strings
for user and private key passwords. Set it to '1' to show such sensitive data
(ideally just in test programs, not in regular clients).

RETURN VALUE
------------

The *upscli_dump_authconf_item()* function returns the return value of the
underlying linkman:fprintf[3] call, or -1 if 'node' is NULL.

The *upscli_dump_authconf_list()* function returns the number of nodes
seen in the list (and likely printed).

SEE ALSO
--------

linkman:upscli_create_authconf_item[3],
linkman:upscli_read_authconf_file[3], linkman:upscli_get_authconf_list[3]
