<commit_before>#include "dns_sd.h"
#include <stdlib.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "_cgo_export.h"

void BrowseReply
(
    DNSServiceRef sdRef,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    DNSServiceErrorType errorCode,
    const char *serviceName,
    const char *regType,
    const char *replyDomain,
    void *context
)
{
    goBrowseReply(
        interfaceIndex,
        (char *)serviceName,
        (char *)regType,
        (char *)replyDomain,
        context
    );
}

DNSServiceErrorType Browse
(
    DNSServiceRef *ref,
    DNSServiceFlags flags,
    const char* regType,
    void *context
)
{
    DNSServiceErrorType err = DNSServiceBrowse(ref, 0, flags, regType, NULL, BrowseReply, context);
    return err;
}

void ResolveReply
(
    DNSServiceRef sdRef,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    DNSServiceErrorType errorCode,
    const char *fullName,
    const char *hostTarget,
    uint16_t port,
    uint16_t txtLen,
    const unsigned char *txtRecords,
    void *context
)
{
    goResolveReply(
        interfaceIndex,
        (char *)fullName,
        (char *)hostTarget,
        port,
        txtLen,
        (void *)txtRecords,
        context
    );
}

DNSServiceErrorType Resolve
(
    DNSServiceRef *ref,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    const char *serviceName,
    const char *regType,
    const char *replyDomain,
    void *context
)
{
    DNSServiceErrorType err = DNSServiceResolve(ref, flags, interfaceIndex, serviceName, regType, replyDomain, ResolveReply, context);
    return err;
}

void QueryRecordReply
(
    DNSServiceRef sdRef,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    DNSServiceErrorType errorCode,
    const char *fullName,<commit_msg>also resolve reply's port is network byte order<commit_after>#include "dns_sd.h"
#include <stdlib.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "_cgo_export.h"

void BrowseReply
(
    DNSServiceRef sdRef,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    DNSServiceErrorType errorCode,
    const char *serviceName,
    const char *regType,
    const char *replyDomain,
    void *context
)
{
    goBrowseReply(
        interfaceIndex,
        (char *)serviceName,
        (char *)regType,
        (char *)replyDomain,
        context
    );
}

DNSServiceErrorType Browse
(
    DNSServiceRef *ref,
    DNSServiceFlags flags,
    const char* regType,
    void *context
)
{
    DNSServiceErrorType err = DNSServiceBrowse(ref, 0, flags, regType, NULL, BrowseReply, context);
    return err;
}

void ResolveReply
(
    DNSServiceRef sdRef,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    DNSServiceErrorType errorCode,
    const char *fullName,
    const char *hostTarget,
    uint16_t port,
    uint16_t txtLen,
    const unsigned char *txtRecords,
    void *context
)
{
    goResolveReply(
        interfaceIndex,
        (char *)fullName,
        (char *)hostTarget,
        ntohs(port),
        txtLen,
        (void *)txtRecords,
        context
    );
}

DNSServiceErrorType Resolve
(
    DNSServiceRef *ref,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    const char *serviceName,
    const char *regType,
    const char *replyDomain,
    void *context
)
{
    DNSServiceErrorType err = DNSServiceResolve(ref, flags, interfaceIndex, serviceName, regType, replyDomain, ResolveReply, context);
    return err;
}

void QueryRecordReply
(
    DNSServiceRef sdRef,
    DNSServiceFlags flags,
    uint32_t interfaceIndex,
    DNSServiceErrorType errorCode,
    const char *fullName,
{'fraction_non_alphanumeric': 0.0831275720164609, 'fraction_numerical': 0.007133058984910837, 'mean_word_length': 3.087443946188341, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5464541', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1188, 'n_words': 296}