/*
 * Module code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 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 "sipAPIpylupdate.h"

#line 70 "/build/pyqt5/src/PyQt5-5.15.7/sip/pylupdate/pylupdatemod.sip"
#include "pylupdate.h"
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/pylupdate/sippylupdatecmodule.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 32 "/build/pyqt5/src/PyQt5-5.15.7/build/pylupdate/sippylupdatecmodule.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qmap.sip"
#include <qmap.h>
#line 35 "/build/pyqt5/src/PyQt5-5.15.7/build/pylupdate/sippylupdatecmodule.cpp"

/* Define the strings used by this module. */
const char sipStrings_pylupdate[] = {
    'Q', 'M', 'a', 'p', '<', 'Q', 'S', 't', 'r', 'i', 'n', 'g', ',', 'Q', 'S', 't', 'r', 'i', 'n', 'g', '>', 0,
    's', 't', 'r', 'i', 'p', 'O', 'b', 's', 'o', 'l', 'e', 't', 'e', 'M', 'e', 's', 's', 'a', 'g', 'e', 's', 0,
    's', 't', 'r', 'i', 'p', 'E', 'm', 'p', 't', 'y', 'C', 'o', 'n', 't', 'e', 'x', 't', 's', 0,
    's', 'i', 'p', '.', 's', 'i', 'm', 'p', 'l', 'e', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 0,
    'P', 'y', 'Q', 't', '5', '.', 'p', 'y', 'l', 'u', 'p', 'd', 'a', 't', 'e', 0,
    'M', 'e', 't', 'a', 'T', 'r', 'a', 'n', 's', 'l', 'a', 't', 'o', 'r', 0,
    'p', 'r', 'o', 'F', 'i', 'l', 'e', 'T', 'a', 'g', 'M', 'a', 'p', 0,
    'f', 'e', 't', 'c', 'h', 't', 'r', '_', 'p', 'y', 0,
    'f', 'e', 't', 'c', 'h', 't', 'r', '_', 'u', 'i', 0,
    's', 'e', 't', 'C', 'o', 'd', 'e', 'c', 0,
    'm', 'e', 'r', 'g', 'e', 0,
    'l', 'o', 'a', 'd', 0,
    's', 'a', 'v', 'e', 0,
};


PyDoc_STRVAR(doc_proFileTagMap, "proFileTagMap(str) -> Dict[str, str]");

extern "C" {static PyObject *func_proFileTagMap(PyObject *,PyObject *);}
static PyObject *func_proFileTagMap(PyObject *,PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QString* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QString, &a0, &a0State))
        {
            QMap< ::QString, ::QString>*sipRes;

            sipRes = new QMap< ::QString, ::QString>(proFileTagMap(*a0));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            return sipConvertFromNewType(sipRes,sipType_QMap_0100QString_0100QString,SIP_NULLPTR);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_proFileTagMap, doc_proFileTagMap);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_merge, "merge(MetaTranslator, MetaTranslator, MetaTranslator, bool, bool, str)");

extern "C" {static PyObject *func_merge(PyObject *,PyObject *);}
static PyObject *func_merge(PyObject *,PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::MetaTranslator* a0;
        const  ::MetaTranslator* a1;
         ::MetaTranslator* a2;
        bool a3;
        bool a4;
        const  ::QString* a5;
        int a5State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J8J8J8bbJ1", sipType_MetaTranslator, &a0, sipType_MetaTranslator, &a1, sipType_MetaTranslator, &a2, &a3, &a4, sipType_QString, &a5, &a5State))
        {
            merge(a0,a1,a2,a3,a4,*a5);
            sipReleaseType(const_cast< ::QString *>(a5), sipType_QString, a5State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_merge, doc_merge);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_fetchtr_ui, "fetchtr_ui(bytes, MetaTranslator, str, bool)");

extern "C" {static PyObject *func_fetchtr_ui(PyObject *,PyObject *);}
static PyObject *func_fetchtr_ui(PyObject *,PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const char* a0;
         ::MetaTranslator* a1;
        const char* a2;
        PyObject *a2Keep;
        bool a3;

        if (sipParseArgs(&sipParseErr, sipArgs, "sJ8ALb", &a0, sipType_MetaTranslator, &a1, &a2Keep, &a2, &a3))
        {
            fetchtr_ui(a0,a1,a2,a3);
            Py_DECREF(a2Keep);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_fetchtr_ui, doc_fetchtr_ui);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_fetchtr_py, "fetchtr_py(bytes, MetaTranslator, str, bool, str, str, str)");

extern "C" {static PyObject *func_fetchtr_py(PyObject *,PyObject *);}
static PyObject *func_fetchtr_py(PyObject *,PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const char* a0;
         ::MetaTranslator* a1;
        const char* a2;
        PyObject *a2Keep;
        bool a3;
        const char* a4;
        PyObject *a4Keep;
        const char* a5;
        PyObject *a5Keep;
        const char* a6;
        PyObject *a6Keep;

        if (sipParseArgs(&sipParseErr, sipArgs, "sJ8ALbALALAL", &a0, sipType_MetaTranslator, &a1, &a2Keep, &a2, &a3, &a4Keep, &a4, &a5Keep, &a5, &a6Keep, &a6))
        {
            fetchtr_py(a0,a1,a2,a3,a4,a5,a6);
            Py_DECREF(a2Keep);
            Py_DECREF(a4Keep);
            Py_DECREF(a5Keep);
            Py_DECREF(a6Keep);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_fetchtr_py, doc_fetchtr_py);

    return SIP_NULLPTR;
}


/*
 * This defines each type in this module.
 */
sipTypeDef *sipExportedTypes_pylupdate[] = {
    &sipTypeDef_pylupdate_MetaTranslator.ctd_base,
    &sipTypeDef_pylupdate_QMap_0100QString_0100QString.mtd_base,
};


/* This defines the types that this module needs to import from QtCore. */
sipImportedTypeDef sipImportedTypes_pylupdate_QtCore[] = {
    {"QString"},
    {SIP_NULLPTR}
};


/* This defines the modules that this module needs to import. */
static sipImportedModuleDef importsTable[] = {
    {"PyQt5.QtCore", sipImportedTypes_pylupdate_QtCore, SIP_NULLPTR, SIP_NULLPTR},
    {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR}
};


/* This defines this module. */
sipExportedModuleDef sipModuleAPI_pylupdate = {
    SIP_NULLPTR,
    11,
    sipNameNr_PyQt5_pylupdate,
    0,
    sipStrings_pylupdate,
    importsTable,
    SIP_NULLPTR,
    2,
    sipExportedTypes_pylupdate,
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};


/* The SIP API and the APIs of any imported modules. */
const sipAPIDef *sipAPI_pylupdate;

sip_qt_metaobject_func sip_pylupdate_qt_metaobject;
sip_qt_metacall_func sip_pylupdate_qt_metacall;
sip_qt_metacast_func sip_pylupdate_qt_metacast;


/* The Python module initialisation function. */
#if defined(SIP_STATIC_MODULE)
extern "C" PyObject *PyInit_pylupdate()
#else
PyMODINIT_FUNC PyInit_pylupdate()
#endif
{
    static PyMethodDef sip_methods[] = {
        {sipName_proFileTagMap, func_proFileTagMap, METH_VARARGS, doc_proFileTagMap},
        {sipName_merge, func_merge, METH_VARARGS, doc_merge},
        {sipName_fetchtr_ui, func_fetchtr_ui, METH_VARARGS, doc_fetchtr_ui},
        {sipName_fetchtr_py, func_fetchtr_py, METH_VARARGS, doc_fetchtr_py},
        {SIP_NULLPTR, SIP_NULLPTR, 0, SIP_NULLPTR}
    };

    static PyModuleDef sip_module_def = {
        PyModuleDef_HEAD_INIT,
        "PyQt5.pylupdate",
        SIP_NULLPTR,
        -1,
        sip_methods,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_NULLPTR
    };

    PyObject *sipModule, *sipModuleDict;
    PyObject *sip_sipmod, *sip_capiobj;

    /* Initialise the module and get it's dictionary. */
    if ((sipModule = PyModule_Create(&sip_module_def)) == SIP_NULLPTR)
        return SIP_NULLPTR;

    sipModuleDict = PyModule_GetDict(sipModule);

    /* Get the SIP module's API. */
    if ((sip_sipmod = PyImport_ImportModule("PyQt5.sip")) == SIP_NULLPTR)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    sip_capiobj = PyDict_GetItemString(PyModule_GetDict(sip_sipmod), "_C_API");
    Py_DECREF(sip_sipmod);

    if (sip_capiobj == SIP_NULLPTR || !PyCapsule_CheckExact(sip_capiobj))
    {
        PyErr_SetString(PyExc_AttributeError, "PyQt5.sip._C_API is missing or has the wrong type");
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    sipAPI_pylupdate = reinterpret_cast<const sipAPIDef *>(PyCapsule_GetPointer(sip_capiobj, "PyQt5.sip._C_API"));

    if (sipAPI_pylupdate == SIP_NULLPTR)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    /* Export the module and publish it's API. */
    if (sipExportModule(&sipModuleAPI_pylupdate, 12, 11, 0) < 0)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    sip_pylupdate_qt_metaobject = (sip_qt_metaobject_func)sipImportSymbol("qtcore_qt_metaobject");
    sip_pylupdate_qt_metacall = (sip_qt_metacall_func)sipImportSymbol("qtcore_qt_metacall");
    sip_pylupdate_qt_metacast = (sip_qt_metacast_func)sipImportSymbol("qtcore_qt_metacast");

    if (!sip_pylupdate_qt_metacast)
        Py_FatalError("Unable to import qtcore_qt_metacast");

    /* Initialise the module now all its dependencies have been set up. */
    if (sipInitModule(&sipModuleAPI_pylupdate,sipModuleDict) < 0)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    return sipModule;
}
