pike.git / src / modules / _Protocols_DNS_SD / sd.c

version» Context lines:

pike.git/src/modules/_Protocols_DNS_SD/sd.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: sd.c,v 1.1 2005/04/09 21:07:21 jonasw Exp $ + || $Id: sd.c,v 1.2 2005/05/29 10:48:33 jonasw Exp $   */         /* Glue for DNS Service Discovery, which is built on top of e.g. Multicast    DNS (ZeroConf/Rendezvous). Using this API a Pike program can register a    service (e.g. a web server) and have other applications on the local    network detect it without additional configuration.       The specification can be found at <http://www.dns-sd.org/>.   
pike.git/src/modules/_Protocols_DNS_SD/sd.c:27:   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "threads.h"      #include <signal.h>    - RCSID("$Id: sd.c,v 1.1 2005/04/09 21:07:21 jonasw Exp $"); + RCSID("$Id: sd.c,v 1.2 2005/05/29 10:48:33 jonasw Exp $");         #ifdef THIS   #undef THIS   #endif   #define THIS ((struct service *)(Pike_fp->current_storage))   #define sp Pike_sp         #if defined(HAVE_DNS_SD) || defined(HAVE_HOWL)                  #ifdef HAVE_DNS_SD      /* Mac OS X interface is defined in <dns_sd.h> */   #ifdef HAVE_DNS_SD_H -  +  + /* Workaround for typo in 10.3 header (which 10.4 doesn't preserve) */ + #define kDNSServiceErr_BadinterfaceIndex kDNSServiceErr_BadInterfaceIndex +    #include <dns_sd.h>   #endif      #define IS_ERR(x) ((x) != kDNSServiceErr_NoError)      /* Instance variables for each service registration */   struct service {    DNSServiceRef service_ref;   };       - /* Workaround for 10.4 header changes */ - #if !defined(kDNSServiceErr_BadinterfaceIndex) - # define kDNSServiceErr_BadinterfaceIndex kDNSServiceErr_BadInterfaceIndex - #endif -  +    static void raise_error(char *msg, DNSServiceErrorType err)   {    char *reason;       if (err == kDNSServiceErr_NoError)    return;       switch (err) {    case kDNSServiceErr_NoSuchName:    reason = "No such name";
pike.git/src/modules/_Protocols_DNS_SD/sd.c:104:    break;    case kDNSServiceErr_NameConflict:    reason = "Name conflict";    break;    case kDNSServiceErr_Invalid:    reason = "Invalid";    break;    case kDNSServiceErr_Incompatible:    reason = "Incompatible";    break; -  case kDNSServiceErr_BadinterfaceIndex: +  case kDNSServiceErr_BadInterfaceIndex:    reason = "Bad interface index";    break;    default:    reason = "Unknown error";    break;    }    Pike_error("DNS_SD: %s Reason: %s (%d)\n", msg, reason, err);   }