static PyObject *authGSSClientClean(PyObject *self, PyObject *args) { gss_client_state *state; PyObject *pystate; int result = 0; if (! PyArg_ParseTuple(args, "O", &pystate)) { return NULL; } if (!PyCObject_Check(pystate)) { PyErr_SetString(PyExc_TypeError, "Expected a context object"); return NULL; } state = (gss_client_state *)PyCObject_AsVoidPtr(pystate); if (state != NULL) { result = authenticate_gss_client_clean(state); free(state); PyCObject_SetVoidPtr(pystate, NULL); } return Py_BuildValue("i", result); }
void destruct_client(PyObject* o) { gss_client_state *state; state = PyCapsule_GetPointer(o, NULL); #else void destruct_client(void* o) { gss_client_state *state; state = (gss_client_state *)o; #endif if (state != NULL) { authenticate_gss_client_clean(state); free(state); } }