cli: Convert SSID to a printable form

If SSID is a UTF-8 string, it is printed as it is, but enclosed in quotes.
Otherwise the bytes are converted to hex string (in uppercase).
The added quotes for UTF-8 string allow to disambiguate the two forms.
This commit is contained in:
Jiří Klimeš
2010-03-24 23:28:00 +01:00
parent a91da03b65
commit 1e329c5c0c
3 changed files with 29 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
/* === Functions === */
int matches (const char *cmd, const char *pattern);
int next_arg (int *argc, char ***argv);
char *ssid_to_printable (const char *str, gsize len);
GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error);
gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error);
void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]);