diff options
| author | Michael Biebl <biebl@debian.org> | 2023-02-10 11:50:34 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2023-02-10 11:50:34 +0100 |
| commit | 1372848511cb896b80b51ed1a3e9606bd9816631 (patch) | |
| tree | 674792b9385bdef935988894b45f06b2af39f88c /src/nmcli/utils.h | |
| parent | 40ec077ea305994c1fc2130add6787ca0c73e2c6 (diff) | |
New upstream version 1.42.0 upstream/1.42.0
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 /*****************************************************************************/ |