Commit 8538459e authored by Fawzi Mohamed's avatar Fawzi Mohamed Committed by Robert Löhning
Browse files

zeroconf: set exports consistently

Fixes build on windows.

Change-Id: I46d918aa9e22843f073f0ebae05dc4da2b701834
Reviewed-on: http://codereview.qt-project.org/6366


Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent a3d0b084
......@@ -155,42 +155,42 @@ public:
if (m_refSockFD == 0) qDebug() << QLatin1String("NativeZConfLib.m_refSockFD == 0");
}
virtual ~NativeZConfLib() {
~NativeZConfLib() {
}
virtual QString name(){
QString name(){
return QString::fromUtf8("NativeZeroConfLib@%1").arg(size_t(this),0,16);
}
// virtual bool tryStartDaemon();
virtual void refDeallocate(DNSServiceRef sdRef) {
void refDeallocate(DNSServiceRef sdRef) {
if (m_refDeallocate == 0) return;
m_refDeallocate(sdRef);
}
virtual DNSServiceErrorType resolve(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *name,
const char *regtype, const char *domain,
DNSServiceResolveReply callBack, void *context)
DNSServiceErrorType resolve(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *name,
const char *regtype, const char *domain,
DNSServiceResolveReply callBack, void *context)
{
if (m_resolve == 0) return kDNSServiceErr_Unsupported;
return m_resolve(sdRef, flags, interfaceIndex, name, regtype, domain, callBack, context);
}
virtual DNSServiceErrorType queryRecord(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *fullname,
uint16_t rrtype, uint16_t rrclass,
DNSServiceQueryRecordReply callBack, void *context)
DNSServiceErrorType queryRecord(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *fullname,
uint16_t rrtype, uint16_t rrclass,
DNSServiceQueryRecordReply callBack, void *context)
{
if (m_queryRecord == 0) return kDNSServiceErr_Unsupported;
return m_queryRecord(sdRef, flags, interfaceIndex, fullname,
rrtype, rrclass, callBack, context);
}
virtual DNSServiceErrorType getAddrInfo(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, DNSServiceProtocol protocol,
const char *hostname, DNSServiceGetAddrInfoReply callBack,
void *context)
DNSServiceErrorType getAddrInfo(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, DNSServiceProtocol protocol,
const char *hostname, DNSServiceGetAddrInfoReply callBack,
void *context)
{
enum { longTTL = 100 };
if (m_getAddrInfo == 0) {
......@@ -220,60 +220,60 @@ public:
hostname, callBack, context);
}
virtual uint16_t txtRecordGetCount(uint16_t txtLen, const void *txtRecord)
uint16_t txtRecordGetCount(uint16_t txtLen, const void *txtRecord)
{
if (m_txtRecordGetCount == 0) return 0;
return m_txtRecordGetCount(txtLen, txtRecord);
}
virtual DNSServiceErrorType txtRecordGetItemAtIndex(uint16_t txtLen, const void *txtRecord,
uint16_t itemIndex, uint16_t keyBufLen,
char *key, uint8_t *valueLen, const void **value)
DNSServiceErrorType txtRecordGetItemAtIndex(uint16_t txtLen, const void *txtRecord,
uint16_t itemIndex, uint16_t keyBufLen,
char *key, uint8_t *valueLen, const void **value)
{
if (m_txtRecordGetItemAtIndex == 0) return kDNSServiceErr_Unsupported;
return m_txtRecordGetItemAtIndex(txtLen, txtRecord, itemIndex, keyBufLen,
key, valueLen, value);
}
virtual DNSServiceErrorType reconfirmRecord(DNSServiceFlags flags, uint32_t interfaceIndex,
const char *fullname, uint16_t rrtype,
uint16_t rrclass, uint16_t rdlen, const void *rdata)
DNSServiceErrorType reconfirmRecord(DNSServiceFlags flags, uint32_t interfaceIndex,
const char *fullname, uint16_t rrtype,
uint16_t rrclass, uint16_t rdlen, const void *rdata)
{
if (m_reconfirmRecord == 0) return kDNSServiceErr_Unsupported;
return m_reconfirmRecord(flags, interfaceIndex, fullname, rrtype,
rrclass, rdlen, rdata);
}
virtual DNSServiceErrorType browse(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *regtype,
const char *domain, DNSServiceBrowseReply callBack,
void *context)
DNSServiceErrorType browse(DNSServiceRef *sdRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *regtype,
const char *domain, DNSServiceBrowseReply callBack,
void *context)
{
if (m_browse == 0) return kDNSServiceErr_Unsupported;
return m_browse(sdRef, flags, interfaceIndex, regtype, domain, callBack, context);
}
virtual DNSServiceErrorType getProperty(const char *property, // Requested property (i.e. kDNSServiceProperty_DaemonVersion)
void *result, // Pointer to place to store result
uint32_t *size // size of result location
)
DNSServiceErrorType getProperty(const char *property, // Requested property (i.e. kDNSServiceProperty_DaemonVersion)
void *result, // Pointer to place to store result
uint32_t *size // size of result location
)
{
if (m_getProperty == 0)
return kDNSServiceErr_Unsupported;
return m_getProperty(property, result, size);
}
virtual DNSServiceErrorType processResult(DNSServiceRef sdRef) {
DNSServiceErrorType processResult(DNSServiceRef sdRef) {
if (m_processResult == 0) return kDNSServiceErr_Unsupported;
return m_processResult(sdRef);
}
virtual DNSServiceErrorType createConnection(DNSServiceRef *sdRef) {
DNSServiceErrorType createConnection(DNSServiceRef *sdRef) {
if (m_createConnection == 0) return kDNSServiceErr_Unsupported;
return m_createConnection(sdRef);
}
virtual int refSockFD(DNSServiceRef sdRef) {
int refSockFD(DNSServiceRef sdRef) {
if (m_refSockFD == 0) return kDNSServiceErr_Unsupported;
return m_refSockFD(sdRef);
}
......
......@@ -125,16 +125,16 @@ int fromFullNameC(const char * const fullName, QString &service, QString &regtyp
// ----------------- C callbacks -----------------
extern "C" void cServiceResolveReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullname,
const char *hosttarget,
uint16_t port, /* In network byte order */
uint16_t txtLen,
const unsigned char *txtRecord,
void *context)
extern "C" void DNSSD_API cServiceResolveReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullname,
const char *hosttarget,
uint16_t port, /* In network byte order */
uint16_t txtLen,
const unsigned char *txtRecord,
void *context)
{
if (DEBUG_SERVICEBROWSER)
qDebug() << "cServiceResolveReply(" << ((size_t)sdRef) << ", " << ((quint32)flags) << ", " << interfaceIndex
......@@ -146,17 +146,17 @@ extern "C" void cServiceResolveReply(DNSServiceRef sdRef,
}
}
extern "C" void cTxtRecordReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullname,
uint16_t rrtype,
uint16_t rrclass,
uint16_t rdlen,
const void *rdata,
uint32_t ttl,
void *context)
extern "C" void DNSSD_API cTxtRecordReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullname,
uint16_t rrtype,
uint16_t rrclass,
uint16_t rdlen,
const void *rdata,
uint32_t ttl,
void *context)
{
if (DEBUG_SERVICEBROWSER)
qDebug() << "cTxtRecordReply(" << ((size_t)sdRef) << ", " << ((int)flags) << ", " << interfaceIndex
......@@ -168,14 +168,14 @@ extern "C" void cTxtRecordReply(DNSServiceRef sdRef,
}
}
extern "C" void cAddrReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *hostname,
const struct sockaddr *address,
uint32_t ttl,
void *context)
extern "C" void DNSSD_API cAddrReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *hostname,
const struct sockaddr *address,
uint32_t ttl,
void *context)
{
if (DEBUG_SERVICEBROWSER)
qDebug() << "cAddrReply(" << ((size_t)sdRef) << ", " << ((int)flags) << ", " << interfaceIndex
......@@ -188,14 +188,14 @@ extern "C" void cAddrReply(DNSServiceRef sdRef,
}
/// callback for service browsing
extern "C" void cBrowseReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
const char *replyDomain,
void *context)
extern "C" void DNSSD_API cBrowseReply(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
const char *replyDomain,
void *context)
{
if (DEBUG_SERVICEBROWSER)
qDebug() << "cBrowseReply(" << ((size_t)sdRef) << ", " << flags << ", " << interfaceIndex
......
......@@ -74,10 +74,10 @@ public:
DNSServiceGetAddrInfoReply callBack, void *context) = 0;
// remove txt functions from lib and always embed?
virtual uint16_t DNSSD_API txtRecordGetCount(uint16_t txtLen, const void *txtRecord) = 0;
virtual DNSServiceErrorType DNSSD_API txtRecordGetItemAtIndex(uint16_t txtLen, const void *txtRecord,
uint16_t itemIndex, uint16_t keyBufLen, char *key,
uint8_t *valueLen, const void **value) = 0;
virtual uint16_t txtRecordGetCount(uint16_t txtLen, const void *txtRecord) = 0;
virtual DNSServiceErrorType txtRecordGetItemAtIndex(uint16_t txtLen, const void *txtRecord,
uint16_t itemIndex, uint16_t keyBufLen, char *key,
uint8_t *valueLen, const void **value) = 0;
virtual DNSServiceErrorType reconfirmRecord(DNSServiceFlags flags, uint32_t interfaceIndex,
const char *fullname, uint16_t rrtype, uint16_t rrclass,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment