/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.3
 *
 * Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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 "sipAPIQtCore.h"

#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qsystemsemaphore.sip"
#include <qsystemsemaphore.h>
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQSystemSemaphore.cpp"

#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qtipccommon.sip"
#include <qtipccommon.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQSystemSemaphore.cpp"
#line 24 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 36 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQSystemSemaphore.cpp"


PyDoc_STRVAR(doc_QSystemSemaphore_setKey, "setKey(self, key: str|None, initialValue: int = 0, mode: QSystemSemaphore.AccessMode = QSystemSemaphore.Open)");

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

    {
        const ::QString* a0;
        int a0State = 0;
        int a1 = 0;
        ::QSystemSemaphore::AccessMode a2 = QSystemSemaphore::Open;
        ::QSystemSemaphore *sipCpp;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_initialValue,
            sipName_mode,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|iE", &sipSelf, sipType_QSystemSemaphore, &sipCpp, sipType_QString, &a0, &a0State, &a1, sipType_QSystemSemaphore_AccessMode, &a2))
        {
            sipCpp->setKey(*a0, a1, a2);
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_setKey, doc_QSystemSemaphore_setKey);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_key, "key(self) -> str");

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

    {
        const ::QSystemSemaphore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSystemSemaphore, &sipCpp))
        {
            ::QString*sipRes;

            sipRes = new ::QString(sipCpp->key());

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

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_key, doc_QSystemSemaphore_key);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_acquire, "acquire(self) -> bool");

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

    {
        ::QSystemSemaphore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSystemSemaphore, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->acquire();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_acquire, doc_QSystemSemaphore_acquire);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_release, "release(self, n: int = 1) -> bool");

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

    {
        int a0 = 1;
        ::QSystemSemaphore *sipCpp;

        static const char *sipKwdList[] = {
            sipName_n,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|i", &sipSelf, sipType_QSystemSemaphore, &sipCpp, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->release(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_release, doc_QSystemSemaphore_release);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_error, "error(self) -> QSystemSemaphore.SystemSemaphoreError");

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

    {
        const ::QSystemSemaphore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSystemSemaphore, &sipCpp))
        {
            ::QSystemSemaphore::SystemSemaphoreError sipRes;

            sipRes = sipCpp->error();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QSystemSemaphore_SystemSemaphoreError);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_error, doc_QSystemSemaphore_error);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_errorString, "errorString(self) -> str");

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

    {
        const ::QSystemSemaphore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSystemSemaphore, &sipCpp))
        {
            ::QString*sipRes;

            sipRes = new ::QString(sipCpp->errorString());

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

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_errorString, doc_QSystemSemaphore_errorString);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_setNativeKey, "setNativeKey(self, key: QNativeIpcKey, initialValue: int = 0, mode: QSystemSemaphore.AccessMode = QSystemSemaphore.Open)\n"
"setNativeKey(self, key: str|None, initialValue: int = 0, mode: QSystemSemaphore.AccessMode = QSystemSemaphore.Open, type: QNativeIpcKey.Type = QNativeIpcKey.legacyDefaultTypeForOs())");

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

    {
        const ::QNativeIpcKey* a0;
        int a1 = 0;
        ::QSystemSemaphore::AccessMode a2 = QSystemSemaphore::Open;
        ::QSystemSemaphore *sipCpp;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_initialValue,
            sipName_mode,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|iE", &sipSelf, sipType_QSystemSemaphore, &sipCpp, sipType_QNativeIpcKey, &a0, &a1, sipType_QSystemSemaphore_AccessMode, &a2))
        {
            sipCpp->setNativeKey(*a0, a1, a2);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::QString* a0;
        int a0State = 0;
        int a1 = 0;
        ::QSystemSemaphore::AccessMode a2 = QSystemSemaphore::Open;
        int a3 = static_cast<int>(QNativeIpcKey::legacyDefaultTypeForOs());
        ::QSystemSemaphore *sipCpp;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_initialValue,
            sipName_mode,
            sipName_type,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|iEE", &sipSelf, sipType_QSystemSemaphore, &sipCpp, sipType_QString, &a0, &a0State, &a1, sipType_QSystemSemaphore_AccessMode, &a2, sipType_QNativeIpcKey_Type, &a3))
        {
            sipCpp->setNativeKey(*a0, a1, a2, static_cast< ::QNativeIpcKey::Type>(a3));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_setNativeKey, doc_QSystemSemaphore_setNativeKey);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_nativeIpcKey, "nativeIpcKey(self) -> QNativeIpcKey");

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

    {
        const ::QSystemSemaphore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSystemSemaphore, &sipCpp))
        {
            ::QNativeIpcKey*sipRes;

            sipRes = new ::QNativeIpcKey(sipCpp->nativeIpcKey());

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

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_nativeIpcKey, doc_QSystemSemaphore_nativeIpcKey);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_isKeyTypeSupported, "isKeyTypeSupported(type: QNativeIpcKey.Type) -> bool");

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

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArgs, "CE", &sipSelf, sipType_QNativeIpcKey_Type, &a0))
        {
            bool sipRes;

            sipRes = ::QSystemSemaphore::isKeyTypeSupported(static_cast< ::QNativeIpcKey::Type>(a0));

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_isKeyTypeSupported, doc_QSystemSemaphore_isKeyTypeSupported);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_platformSafeKey, "platformSafeKey(key: str|None, type: QNativeIpcKey.Type = QNativeIpcKey.DefaultTypeForOs) -> QNativeIpcKey");

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

    {
        const ::QString* a0;
        int a0State = 0;
        int a1 = static_cast<int>(QNativeIpcKey::DefaultTypeForOs);

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_type,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "CJ1|E", &sipSelf, sipType_QString, &a0, &a0State, sipType_QNativeIpcKey_Type, &a1))
        {
            ::QNativeIpcKey*sipRes;

            sipRes = new ::QNativeIpcKey(::QSystemSemaphore::platformSafeKey(*a0, static_cast< ::QNativeIpcKey::Type>(a1)));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

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

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_platformSafeKey, doc_QSystemSemaphore_platformSafeKey);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSystemSemaphore_legacyNativeKey, "legacyNativeKey(key: str|None, type: QNativeIpcKey.Type = QNativeIpcKey.legacyDefaultTypeForOs()) -> QNativeIpcKey");

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

    {
        const ::QString* a0;
        int a0State = 0;
        int a1 = static_cast<int>(QNativeIpcKey::legacyDefaultTypeForOs());

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_type,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "CJ1|E", &sipSelf, sipType_QString, &a0, &a0State, sipType_QNativeIpcKey_Type, &a1))
        {
            ::QNativeIpcKey*sipRes;

            sipRes = new ::QNativeIpcKey(::QSystemSemaphore::legacyNativeKey(*a0, static_cast< ::QNativeIpcKey::Type>(a1)));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

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

    sipNoMethod(sipParseErr, sipName_QSystemSemaphore, sipName_legacyNativeKey, doc_QSystemSemaphore_legacyNativeKey);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QSystemSemaphore(void *, int);}
static void release_QSystemSemaphore(void *sipCppV, int)
{
    delete reinterpret_cast< ::QSystemSemaphore *>(sipCppV);
}


extern "C" {static void dealloc_QSystemSemaphore(sipSimpleWrapper *);}
static void dealloc_QSystemSemaphore(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QSystemSemaphore(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QSystemSemaphore(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QSystemSemaphore(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    ::QSystemSemaphore *sipCpp = SIP_NULLPTR;

    {
        const ::QNativeIpcKey* a0;
        int a1 = 0;
        ::QSystemSemaphore::AccessMode a2 = QSystemSemaphore::Open;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_initialValue,
            sipName_mode,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9|iE", sipType_QNativeIpcKey, &a0, &a1, sipType_QSystemSemaphore_AccessMode, &a2))
        {
            sipCpp = new ::QSystemSemaphore(*a0, a1, a2);

            return sipCpp;
        }
    }

    {
        const ::QString* a0;
        int a0State = 0;
        int a1 = 0;
        ::QSystemSemaphore::AccessMode a2 = QSystemSemaphore::Open;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_initialValue,
            sipName_mode,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|iE", sipType_QString, &a0, &a0State, &a1, sipType_QSystemSemaphore_AccessMode, &a2))
        {
            sipCpp = new ::QSystemSemaphore(*a0, a1, a2);
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QSystemSemaphore[] = {
    {sipName_acquire, meth_QSystemSemaphore_acquire, METH_VARARGS, doc_QSystemSemaphore_acquire},
    {sipName_error, meth_QSystemSemaphore_error, METH_VARARGS, doc_QSystemSemaphore_error},
    {sipName_errorString, meth_QSystemSemaphore_errorString, METH_VARARGS, doc_QSystemSemaphore_errorString},
    {sipName_isKeyTypeSupported, meth_QSystemSemaphore_isKeyTypeSupported, METH_VARARGS, doc_QSystemSemaphore_isKeyTypeSupported},
    {sipName_key, meth_QSystemSemaphore_key, METH_VARARGS, doc_QSystemSemaphore_key},
    {sipName_legacyNativeKey, SIP_MLMETH_CAST(meth_QSystemSemaphore_legacyNativeKey), METH_VARARGS|METH_KEYWORDS, doc_QSystemSemaphore_legacyNativeKey},
    {sipName_nativeIpcKey, meth_QSystemSemaphore_nativeIpcKey, METH_VARARGS, doc_QSystemSemaphore_nativeIpcKey},
    {sipName_platformSafeKey, SIP_MLMETH_CAST(meth_QSystemSemaphore_platformSafeKey), METH_VARARGS|METH_KEYWORDS, doc_QSystemSemaphore_platformSafeKey},
    {sipName_release, SIP_MLMETH_CAST(meth_QSystemSemaphore_release), METH_VARARGS|METH_KEYWORDS, doc_QSystemSemaphore_release},
    {sipName_setKey, SIP_MLMETH_CAST(meth_QSystemSemaphore_setKey), METH_VARARGS|METH_KEYWORDS, doc_QSystemSemaphore_setKey},
    {sipName_setNativeKey, SIP_MLMETH_CAST(meth_QSystemSemaphore_setNativeKey), METH_VARARGS|METH_KEYWORDS, doc_QSystemSemaphore_setNativeKey}
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QSystemSemaphore[] = {
    {sipName_Open, static_cast<int>(::QSystemSemaphore::Open)},
    {sipName_Create, static_cast<int>(::QSystemSemaphore::Create)},
    {sipName_NoError, static_cast<int>(::QSystemSemaphore::NoError)},
    {sipName_PermissionDenied, static_cast<int>(::QSystemSemaphore::PermissionDenied)},
    {sipName_KeyError, static_cast<int>(::QSystemSemaphore::KeyError)},
    {sipName_AlreadyExists, static_cast<int>(::QSystemSemaphore::AlreadyExists)},
    {sipName_NotFound, static_cast<int>(::QSystemSemaphore::NotFound)},
    {sipName_OutOfResources, static_cast<int>(::QSystemSemaphore::OutOfResources)},
    {sipName_UnknownError, static_cast<int>(::QSystemSemaphore::UnknownError)},
    {0, 0}
};

PyDoc_STRVAR(doc_QSystemSemaphore, "\1QSystemSemaphore(key: QNativeIpcKey, initialValue: int = 0, mode: QSystemSemaphore.AccessMode = QSystemSemaphore.Open)\n"
"QSystemSemaphore(key: str|None, initialValue: int = 0, mode: QSystemSemaphore.AccessMode = QSystemSemaphore.Open)");


sipClassTypeDef sipTypeDef_QtCore_QSystemSemaphore = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSystemSemaphore,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QSystemSemaphore,
        {0, 0, 1},
        11, methods_QSystemSemaphore,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QSystemSemaphore, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QSystemSemaphore,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QSystemSemaphore,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSystemSemaphore,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QSystemSemaphore,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::QSystemSemaphore),
};
