diff options
| author | Jeremy Bicha <jeremy.bicha@canonical.com> | 2023-02-14 10:06:06 -0500 |
|---|---|---|
| committer | Jeremy Bicha <jeremy.bicha@canonical.com> | 2023-02-14 10:06:06 -0500 |
| commit | b3c2e57e153446d32d16f2d99e6abbb50146dddb (patch) | |
| tree | e71a5353ff26c7e33cbe6e482874bedc1c3cc1cd /src/nmcli/utils.h | |
| parent | 1d817ebf5302c204e3ce9d3512db13bf834fee33 (diff) | |
| parent | ed857ba34efc2ec899f2e3fbd8e35324561a55b2 (diff) | |
Merge tag 'debian/1.42.0-1' into ubuntu/master
network-manager Debian release 1.42.0-1
Diffstat (limited to 'src/nmcli/utils.h')
| -rw-r--r-- | src/nmcli/utils.h | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/src/nmcli/utils.h b/src/nmcli/utils.h index c6ead55b..5d9449f5 100644 --- a/src/nmcli/utils.h +++ b/src/nmcli/utils.h @@ -359,13 +359,43 @@ nmc_meta_generic_get_enum_with_detail(NmcMetaGenericGetEnumType get_enum_type, /*****************************************************************************/ -gboolean nmc_print(const NmcConfig *nmc_config, - gpointer const *targets, - gpointer targets_data, - const char *header_name_no_l10n, - const NMMetaAbstractInfo *const *fields, - const char *fields_str, - GError **error); +gboolean nmc_print_table(const NmcConfig *nmc_config, + gpointer const *targets, + gpointer targets_data, + const char *header_name_no_l10n, + const NMMetaAbstractInfo *const *fields, + const char *fields_str, + GError **error); + +/*****************************************************************************/ + +#if 0 +/* For manual testing to sync output with LIBNM_CLIENT_DEBUG/LIBNM_CLIENT_DEBUG_FILE */ +#define nmc_print(...) \ + G_STMT_START \ + { \ + gs_free char *_ss = g_strdup_printf(__VA_ARGS__); \ + gs_free char *_ss1 = g_strdup_printf("nmcli[out]: %s", _ss); \ + \ + nm_utils_print(0, _ss1); \ + nm_utils_print(1, _ss); \ + } \ + G_STMT_END + +#define nmc_printerr(...) \ + G_STMT_START \ + { \ + gs_free char *_ss = g_strdup_printf(__VA_ARGS__); \ + gs_free char *_ss1 = g_strdup_printf("nmcli[err]: %s", _ss); \ + \ + nm_utils_print(0, _ss1); \ + nm_utils_print(2, _ss); \ + } \ + G_STMT_END +#else +#define nmc_print(...) g_print(__VA_ARGS__) +#define nmc_printerr(...) g_printerr(__VA_ARGS__) +#endif /*****************************************************************************/ |