<commit_before>﻿#pragma warning disable 1591

using System;

namespace SharpTox
{
    public class ToxDns
    {
        private IntPtr tox_dns3;

        private Object obj;

        /// <summary>
        /// Initializes a new instance of tox dns3.
        /// </summary>
        /// <param name="public_key"></param>
        public ToxDns(string public_key)
        {
            obj = new Object();

            tox_dns3 = ToxDnsFunctions.New(public_key);

            if (tox_dns3 == IntPtr.Zero)
                throw new Exception("Could not create a new tox_dns3 instance with the provided public_key");
        }

        /// <summary>
        /// Destroys the tox dns3 object.
        /// </summary>
        public void Kill()
        {
            lock (obj)
            {
                if (tox_dns3 == IntPtr.Zero)
                    throw null;

                ToxDnsFunctions.Kill(tox_dns3);
            }
        }

        /// <summary>
        /// Generates a dns3 string used to query the dns server.
        /// </summary>
        /// <param name="name">Name of the registered user.</param>
        /// <param name="request_id"></param>
        /// <returns></returns>
        public string GenerateDns3String(string name)
        {
            lock (obj)
            {
                if (tox_dns3 == IntPtr.Zero)
                    throw null;

                return ToxDnsFunctions.GenerateDns3String(tox_dns3, name);
            }
        }

        /// <summary>
        /// Decodes and decrypts the dns3 string returned by GenerateDns3String.
        /// </summary>
        /// <param name="dns3_string"></param>
        /// <param name="request_id"></param>
        /// <returns></returns>
        public string DecryptDns3TXT(string dns3_string)
        {
            lock (obj)
            {
                if (tox_dns3 == IntPtr.Zero)
                    throw null;

                return ToxDnsFunctions.DecryptDns3TXT(tox_dns3, dns3_string);
            }
        }

        /// <summary>
        /// Retrieves the pointer of this tox dns3 object.
        /// </summary>
        /// <returns></returns>
        public IntPtr GetPointer()
        {
            return tox_dns3;
        }
    }
}

#pragma warning restore 1591<commit_msg>Updated the dns functions (added request_id)<commit_after>﻿#pragma warning disable 1591

using System;

namespace SharpTox
{
    public class ToxDns
    {
        private IntPtr tox_dns3;

        private Object obj;

        /// <summary>
        /// Initializes a new instance of tox dns3.
        /// </summary>
        /// <param name="public_key"></param>
        public ToxDns(string public_key)
        {
            obj = new Object();

            tox_dns3 = ToxDnsFunctions.New(public_key);

            if (tox_dns3 == IntPtr.Zero)
                throw new Exception("Could not create a new tox_dns3 instance with the provided public_key");
        }

        /// <summary>
        /// Destroys the tox dns3 object.
        /// </summary>
        public void Kill()
        {
            lock (obj)
            {
                if (tox_dns3 == IntPtr.Zero)
                    throw null;

                ToxDnsFunctions.Kill(tox_dns3);
            }
        }

        /// <summary>
        /// Generates a dns3 string used to query the dns server.
        /// </summary>
        /// <param name="name">Name of the registered user.</param>
        /// <param name="request_id"></param>
        /// <returns></returns>
        public string GenerateDns3String(string name, int request_id)
        {
            lock (obj)
            {
                if (tox_dns3 == IntPtr.Zero)
                    throw null;

                return ToxDnsFunctions.GenerateDns3String(tox_dns3, name, request_id);
            }
        }

        /// <summary>
        /// Decodes and decrypts the dns3 string returned by GenerateDns3String.
        /// </summary>
        /// <param name="dns3_string"></param>
        /// <param name="request_id"></param>
        /// <returns></returns>
        public string DecryptDns3TXT(string dns3_string, int request_id)
        {
            lock (obj)
            {
                if (tox_dns3 == IntPtr.Zero)
                    throw null;

                return ToxDnsFunctions.DecryptDns3TXT(tox_dns3, dns3_string, request_id);
            }
        }

        /// <summary>
        /// Retrieves the pointer of this tox dns3 object.
        /// </summary>
        /// <returns></returns>
        public IntPtr GetPointer()
        {
            return tox_dns3;
        }
    }
}

#pragma warning restore 1591
{'fraction_non_alphanumeric': 0.11003236245954692, 'fraction_numerical': 0.013807982740021575, 'mean_word_length': 1.3677221654749745, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, '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': '762190', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1297, 'n_words': 320}