Lines Matching defs:config
21 #include <config.h>
61 typedef struct Config {
75 } Config;
85 Config *config;
98 static void check_terminate(Config *c) {
154 static void print_service_line(Config *config, char c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, int nl) {
158 if (!config->no_db_lookup)
162 if (config->parsable) {
214 print_service_line(i->config, '=', interface, protocol, name, type, domain, 0);
216 if (i->config->parsable)
249 check_terminate(i->config);
253 static ServiceInfo *add_service(Config *c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain) {
274 i->config = c;
281 static void remove_service(Config *c, ServiceInfo *i) {
307 Config *c = userdata;
356 static void browse_service_type(Config *c, const char *stype, const char *domain) {
398 Config *c = userdata;
430 static void browse_all(Config *c) {
461 Config *c = userdata;
504 static void browse_domains(Config *c) {
527 static int start(Config *config) {
531 if (config->verbose && !config->parsable) {
546 if (config->command == COMMAND_BROWSE_DOMAINS) {
557 if (config->command == COMMAND_BROWSE_SERVICES)
558 browse_service_type(config, config->stype, config->domain);
559 else if (config->command == COMMAND_BROWSE_ALL_SERVICES)
560 browse_all(config);
562 assert(config->command == COMMAND_BROWSE_DOMAINS);
563 browse_domains(config);
571 Config *config = userdata;
580 if (config->no_fail && avahi_client_errno(c) == AVAHI_ERR_DISCONNECTED) {
594 remove_service(config, services);
598 if (!(client = avahi_client_new(avahi_simple_poll_get(simple_poll), AVAHI_CLIENT_NO_FAIL, client_callback, config, &error))) {
615 if (start(config) < 0)
622 if (config->verbose && !config->parsable)
668 static int parse_command_line(Config *c, const char *argv0, int argc, char *argv[]) {
784 Config config;
802 if (parse_command_line(&config, argv0, argc, argv) < 0)
805 switch (config.command) {
828 if (!(client = avahi_client_new(avahi_simple_poll_get(simple_poll), config.no_fail ? AVAHI_CLIENT_NO_FAIL : 0, client_callback, &config, &error))) {
843 if (config.no_db_lookup)
859 remove_service(&config, services);
869 avahi_free(config.domain);
870 avahi_free(config.stype);