X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdnssd.c;h=3efaa97958755b3e7a7bde8dcd6bc89b482e3b70;hb=427cd9fb5c59495ac493ab1c5bc118a08fc70ef1;hp=96e32dc7d561902a76f17fabcf7efb3fcfa9ba8f;hpb=1b4a582b04fc39d9d4d930acb4d0803bdedfb32e;p=deb_shairplay.git diff --git a/src/lib/dnssd.c b/src/lib/dnssd.c index 96e32dc..3efaa97 100644 --- a/src/lib/dnssd.c +++ b/src/lib/dnssd.c @@ -1,3 +1,17 @@ +/** + * Copyright (C) 2011-2012 Juho Vähä-Herttua + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + #include #include #include @@ -14,12 +28,13 @@ #ifndef WIN32 # include +# define DNSSD_STDCALL #else # include # if !defined(EFI32) && !defined(EFI64) -# define DNSSD_API __stdcall +# define DNSSD_STDCALL __stdcall # else -# define DNSSD_API +# define DNSSD_STDCALL # endif typedef struct _DNSServiceRef_t *DNSServiceRef; @@ -28,7 +43,7 @@ typedef union _TXTRecordRef_t { char PrivateData[16]; char *ForceNaturalAlignmen typedef uint32_t DNSServiceFlags; typedef int32_t DNSServiceErrorType; -typedef void (DNSSD_API *DNSServiceRegisterReply) +typedef void (DNSSD_STDCALL *DNSServiceRegisterReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, @@ -40,7 +55,7 @@ typedef void (DNSSD_API *DNSServiceRegisterReply) ); #endif -typedef DNSServiceErrorType (DNSSD_API *DNSServiceRegister_t) +typedef DNSServiceErrorType (DNSSD_STDCALL *DNSServiceRegister_t) ( DNSServiceRef *sdRef, DNSServiceFlags flags, @@ -55,23 +70,23 @@ typedef DNSServiceErrorType (DNSSD_API *DNSServiceRegister_t) DNSServiceRegisterReply callBack, void *context ); -typedef void (DNSSD_API *DNSServiceRefDeallocate_t)(DNSServiceRef sdRef); -typedef void (DNSSD_API *TXTRecordCreate_t) +typedef void (DNSSD_STDCALL *DNSServiceRefDeallocate_t)(DNSServiceRef sdRef); +typedef void (DNSSD_STDCALL *TXTRecordCreate_t) ( TXTRecordRef *txtRecord, uint16_t bufferLen, void *buffer ); -typedef void (DNSSD_API *TXTRecordDeallocate_t)(TXTRecordRef *txtRecord); -typedef DNSServiceErrorType (DNSSD_API *TXTRecordSetValue_t) +typedef void (DNSSD_STDCALL *TXTRecordDeallocate_t)(TXTRecordRef *txtRecord); +typedef DNSServiceErrorType (DNSSD_STDCALL *TXTRecordSetValue_t) ( TXTRecordRef *txtRecord, const char *key, uint8_t valueSize, const void *value ); -typedef uint16_t (DNSSD_API *TXTRecordGetLength_t)(const TXTRecordRef *txtRecord); -typedef const void * (DNSSD_API *TXTRecordGetBytesPtr_t)(const TXTRecordRef *txtRecord); +typedef uint16_t (DNSSD_STDCALL *TXTRecordGetLength_t)(const TXTRecordRef *txtRecord); +typedef const void * (DNSSD_STDCALL *TXTRecordGetBytesPtr_t)(const TXTRecordRef *txtRecord); struct dnssd_s {