diff options
| author | Michael Biebl <biebl@debian.org> | 2023-03-09 20:01:53 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2023-03-09 20:01:53 +0100 |
| commit | cffb548b401e2cd3fad166aa92e0f634bbb1d4d6 (patch) | |
| tree | 6d803d8f7d0d92a1c5e5705974fff8975472af95 /src/nmcli/utils.h | |
| parent | 647d6b95d5475e0a1bf3d6f299d1cb8c9041a7a4 (diff) | |
| parent | 12e1ee797bbf0b10d1fd5afd4b947484769f2b9f (diff) | |
Merge tag 'debian/1.42.4-1' into debian/bullseye-backports
network-manager Debian release 1.42.4-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 /*****************************************************************************/ |