__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

aptanhua@216.73.216.189: ~ $
/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */
/**
   Implementation of the Python slots for PyGreenletUnswitchable_Type
*/
#ifndef PY_GREENLET_UNSWITCHABLE_CPP
#define PY_GREENLET_UNSWITCHABLE_CPP



#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h" // PyMemberDef

#include "greenlet_internal.hpp"
// Code after this point can assume access to things declared in stdint.h,
// including the fixed-width types. This goes for the platform-specific switch functions
// as well.
#include "greenlet_refs.hpp"
#include "greenlet_slp_switch.hpp"

#include "greenlet_thread_support.hpp"
#include "TGreenlet.hpp"

#include "TGreenlet.cpp"
#include "TGreenletGlobals.cpp"
#include "TThreadStateDestroy.cpp"


using greenlet::LockGuard;
using greenlet::LockInitError;
using greenlet::PyErrOccurred;
using greenlet::Require;

using greenlet::g_handle_exit;
using greenlet::single_result;

using greenlet::Greenlet;
using greenlet::UserGreenlet;
using greenlet::MainGreenlet;
using greenlet::BrokenGreenlet;
using greenlet::ThreadState;
using greenlet::PythonState;


#include "PyGreenlet.hpp"

static PyGreenlet*
green_unswitchable_new(PyTypeObject* type, PyObject* UNUSED(args), PyObject* UNUSED(kwds))
{
    PyGreenlet* o =
        (PyGreenlet*)PyBaseObject_Type.tp_new(type, mod_globs->empty_tuple, mod_globs->empty_dict);
    if (o) {
        new BrokenGreenlet(o, GET_THREAD_STATE().state().borrow_current());
        assert(Py_REFCNT(o) == 1);
    }
    return o;
}

static PyObject*
green_unswitchable_getforce(PyGreenlet* self, void* UNUSED(context))
{
    BrokenGreenlet* broken = dynamic_cast<BrokenGreenlet*>(self->pimpl);
    return PyBool_FromLong(broken->_force_switch_error);
}

static int
green_unswitchable_setforce(PyGreenlet* self, PyObject* nforce, void* UNUSED(context))
{
    if (!nforce) {
        PyErr_SetString(
            PyExc_AttributeError,
            "Cannot delete force_switch_error"
        );
        return -1;
    }
    BrokenGreenlet* broken = dynamic_cast<BrokenGreenlet*>(self->pimpl);
    int is_true = PyObject_IsTrue(nforce);
    if (is_true == -1) {
        return -1;
    }
    broken->_force_switch_error = is_true;
    return 0;
}

static PyObject*
green_unswitchable_getforceslp(PyGreenlet* self, void* UNUSED(context))
{
    BrokenGreenlet* broken = dynamic_cast<BrokenGreenlet*>(self->pimpl);
    return PyBool_FromLong(broken->_force_slp_switch_error);
}

static int
green_unswitchable_setforceslp(PyGreenlet* self, PyObject* nforce, void* UNUSED(context))
{
    if (!nforce) {
        PyErr_SetString(
            PyExc_AttributeError,
            "Cannot delete force_slp_switch_error"
        );
        return -1;
    }
    BrokenGreenlet* broken = dynamic_cast<BrokenGreenlet*>(self->pimpl);
    int is_true = PyObject_IsTrue(nforce);
    if (is_true == -1) {
        return -1;
    }
    broken->_force_slp_switch_error = is_true;
    return 0;
}

static PyGetSetDef green_unswitchable_getsets[] = {
    /* name, getter, setter, doc, closure (context pointer) */
    {
      .name="force_switch_error",
      .get=(getter)green_unswitchable_getforce,
      .set=(setter)green_unswitchable_setforce,
      .doc=nullptr
    },
    {
      .name="force_slp_switch_error",
      .get=(getter)green_unswitchable_getforceslp,
      .set=(setter)green_unswitchable_setforceslp,
      .doc=nullptr
    },
    {.name=nullptr}
};

PyTypeObject PyGreenletUnswitchable_Type = {
    .ob_base = PyVarObject_HEAD_INIT(NULL, 0)
    .tp_name = "greenlet._greenlet.UnswitchableGreenlet",
    .tp_dealloc = (destructor)green_dealloc,
    .tp_flags = G_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    .tp_doc = "Undocumented internal class for testing error conditions",
    .tp_traverse = (traverseproc)green_traverse,
    .tp_clear = (inquiry)green_clear,

    .tp_getset = green_unswitchable_getsets,
    .tp_base = &PyGreenlet_Type,
    .tp_init = (initproc)green_init,
    .tp_alloc = PyType_GenericAlloc,
    .tp_new = (newfunc)green_unswitchable_new,
    .tp_free = PyObject_GC_Del,
#ifndef Py_GIL_DISABLED
    // See comments in the base type
    .tp_is_gc = (inquiry)green_is_gc,
#endif
};


#endif

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
platform Folder 0755
tests Folder 0755
CObjects.cpp File 3.57 KB 0644
PyGreenlet.cpp File 27.52 KB 0644
PyGreenlet.hpp File 1.43 KB 0644
PyGreenletUnswitchable.cpp File 4.06 KB 0644
PyModule.cpp File 8.59 KB 0644
TBrokenGreenlet.cpp File 1021 B 0644
TExceptionState.cpp File 1.33 KB 0644
TGreenlet.cpp File 25.62 KB 0644
TGreenlet.hpp File 28.58 KB 0644
TGreenletGlobals.cpp File 3.84 KB 0644
TMainGreenlet.cpp File 3.51 KB 0644
TPythonState.cpp File 19.15 KB 0644
TStackState.cpp File 7.21 KB 0644
TThreadState.hpp File 23.34 KB 0644
TThreadStateCreator.hpp File 2.7 KB 0644
TThreadStateDestroy.cpp File 7.99 KB 0644
TUserGreenlet.cpp File 23.76 KB 0644
__init__.py File 1.41 KB 0644
_greenlet.cpython-312-x86_64-linux-gnu.so File 1.32 MB 0755
greenlet.cpp File 10.83 KB 0644
greenlet.h File 4.64 KB 0644
greenlet_allocator.hpp File 1.79 KB 0644
greenlet_compiler_compat.hpp File 4.24 KB 0644
greenlet_cpython_compat.hpp File 3.25 KB 0644
greenlet_exceptions.hpp File 4.4 KB 0644
greenlet_internal.hpp File 2.7 KB 0644
greenlet_msvc_compat.hpp File 3.12 KB 0644
greenlet_refs.hpp File 37.17 KB 0644
greenlet_slp_switch.hpp File 3.22 KB 0644
greenlet_thread_support.hpp File 867 B 0644
slp_platformselect.h File 3.87 KB 0644