+static int start(Config *config) {
+
+ assert(!browsing);
+
+ if (config->verbose && !config->parsable) {
+ const char *version, *hn;
+
+ if (!(version = avahi_client_get_version_string(client))) {
+ fprintf(stderr, _("Failed to query version string: %s\n"), avahi_strerror(avahi_client_errno(client)));
+ return -1;
+ }
+
+ if (!(hn = avahi_client_get_host_name_fqdn(client))) {
+ fprintf(stderr, _("Failed to query host name: %s\n"), avahi_strerror(avahi_client_errno(client)));
+ return -1;
+ }
+
+ fprintf(stderr, _("Server version: %s; Host name: %s\n"), version, hn);
+
+ if (config->command == COMMAND_BROWSE_DOMAINS) {
+ /* Translators: This is a column heading with abbreviations for
+ * Event (+/-), Network Interface, Protocol (IPv4/v6), Domain */
+ fprintf(stderr, _("E Ifce Prot Domain\n"));
+ } else {
+ /* Translators: This is a column heading with abbreviations for
+ * Event (+/-), Network Interface, Protocol (IPv4/v6), Domain */
+ fprintf(stderr, _("E Ifce Prot %-*s %-20s Domain\n"), n_columns-35, _("Name"), _("Type"));
+ }
+ }
+
+ if (config->command == COMMAND_BROWSE_SERVICES)
+ browse_service_type(config, config->stype, config->domain);
+ else if (config->command == COMMAND_BROWSE_ALL_SERVICES)
+ browse_all(config);
+ else {
+ assert(config->command == COMMAND_BROWSE_DOMAINS);
+ browse_domains(config);
+ }
+
+ browsing = 1;
+ return 0;
+}
+