+/**
+ * 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 <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifndef WIN32
# include <dns_sd.h>
+# define DNSSD_STDCALL
#else
# include <stdint.h>
# 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;
typedef uint32_t DNSServiceFlags;
typedef int32_t DNSServiceErrorType;
-typedef void (DNSSD_API *DNSServiceRegisterReply)
+typedef void (DNSSD_STDCALL *DNSServiceRegisterReply)
(
DNSServiceRef sdRef,
DNSServiceFlags flags,
);
#endif
-typedef DNSServiceErrorType (DNSSD_API *DNSServiceRegister_t)
+typedef DNSServiceErrorType (DNSSD_STDCALL *DNSServiceRegister_t)
(
DNSServiceRef *sdRef,
DNSServiceFlags flags,
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 {