/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.23
 *
 * Copyright (c) 2020 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtNetwork.h"

#line 29 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/sip/QtNetwork/qpynetwork_qmap.sip"
#include <qmap.h>
#include <qssl.h>
#line 30 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/QtNetwork/sipQtNetworkQMultiMap0100QSslAlternativeNameEntryType0100QString.cpp"

#line 28 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/sip/QtNetwork/qssl.sip"
#include <qssl.h>
#line 34 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/QtNetwork/sipQtNetworkQMultiMap0100QSslAlternativeNameEntryType0100QString.cpp"
#line 27 "sip/QtCore/qstring.sip"
#include <qstring.h>
#line 37 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/QtNetwork/sipQtNetworkQMultiMap0100QSslAlternativeNameEntryType0100QString.cpp"


extern "C" {static void assign_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(void *, SIP_SSIZE_T, void *);}
static void assign_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString> *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString> *>(sipSrc);
}


extern "C" {static void *array_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(SIP_SSIZE_T);}
static void *array_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(SIP_SSIZE_T sipNrElem)
{
    return new  ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString>[sipNrElem];
}


extern "C" {static void *copy_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(const void *, SIP_SSIZE_T);}
static void *copy_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString>(reinterpret_cast<const  ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(void *, int);}
static void release_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(void *ptr, int)
{
    delete reinterpret_cast< ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString> *>(ptr);
}



extern "C" {static int convertTo_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(PyObject *, void **, int *, PyObject *);}
static int convertTo_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(PyObject *sipPy,void **,int *sipIsErr,PyObject *)
{
#line 150 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/sip/QtNetwork/qpynetwork_qmap.sip"
    if (!sipIsErr)
        return PyDict_Check(sipPy);

    PyErr_SetString(PyExc_NotImplementedError,
            "converting to QMultiMap<QSsl::AlternativeNameEntryType, QString> is unsupported");

    return 0;
#line 81 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/QtNetwork/sipQtNetworkQMultiMap0100QSslAlternativeNameEntryType0100QString.cpp"
}


extern "C" {static PyObject *convertFrom_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(void *, PyObject *);}
static PyObject *convertFrom_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString(void *sipCppV, PyObject *sipTransferObj)
{
    ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString> *sipCpp = reinterpret_cast< ::QMultiMap< ::QSsl::AlternativeNameEntryType, ::QString> *>(sipCppV);

#line 34 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/sip/QtNetwork/qpynetwork_qmap.sip"
    // Get the enum objects that are the dictionary keys.
    static PyObject *email_entry = 0;
    static PyObject *dns_entry = 0;

    if (!email_entry)
    {
        email_entry = PyObject_GetAttrString(
                (PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), "EmailEntry");

        if (!email_entry)
            return 0;
    }

    if (!dns_entry)
    {
        dns_entry = PyObject_GetAttrString(
                (PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), "DnsEntry");

        if (!dns_entry)
            return 0;
    }

    // Create the dictionary.
    PyObject *d = PyDict_New();

    if (!d)
        return 0;

    QList<QString> vl;

    // Handle the Qssl::EmailEntry key.
    vl = sipCpp->values(QSsl::EmailEntry);

    if (!vl.isEmpty())
    {
        PyObject *vlobj = PyList_New(vl.count());

        if (!vlobj)
        {
            Py_DECREF(d);
            return 0;
        }

        int rc = PyDict_SetItem(d, email_entry, vlobj);

        Py_DECREF(email_entry);
        Py_DECREF(vlobj);

        if (rc < 0)
        {
            Py_DECREF(d);
            return 0;
        }

        for (int i = 0; i < vl.count(); ++i)
        {
            QString *s = new QString(vl.at(i));
            PyObject *vobj = sipConvertFromNewType(s, sipType_QString,
                    sipTransferObj);

            if (!vobj)
            {
                delete s;
                Py_DECREF(d);
                return 0;
            }

            PyList_SetItem(vlobj, i, vobj);
        }
    }

    // Handle the Qssl::DnsEntry key.
    vl = sipCpp->values(QSsl::DnsEntry);

    if (!vl.isEmpty())
    {
        PyObject *vlobj = PyList_New(vl.count());

        if (!vlobj)
        {
            Py_DECREF(d);
            return 0;
        }

        int rc = PyDict_SetItem(d, dns_entry, vlobj);

        Py_DECREF(dns_entry);
        Py_DECREF(vlobj);

        if (rc < 0)
        {
            Py_DECREF(d);
            return 0;
        }

        for (int i = 0; i < vl.count(); ++i)
        {
            QString *s = new QString(vl.at(i));
            PyObject *vobj = sipConvertFromNewType(s, sipType_QString,
                    sipTransferObj);

            if (!vobj)
            {
                delete s;
                Py_DECREF(d);
                return 0;
            }

            PyList_SetItem(vlobj, i, vobj);
        }
    }

    return d;
#line 204 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/QtNetwork/sipQtNetworkQMultiMap0100QSslAlternativeNameEntryType0100QString.cpp"
}


sipMappedTypeDef sipTypeDef_QtNetwork_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString = {
    {
        -1,
        SIP_NULLPTR,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_0,     /* QMultiMap<QSsl::AlternativeNameEntryType,QString> */
        {0},
        0
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString,
    array_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString,
    copy_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString,
    release_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString,
    convertTo_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString,
    convertFrom_QMultiMap_0100QSsl_AlternativeNameEntryType_0100QString
};
