A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20180221/097f7fd5/attachment-0001.ksh below:

#include "pycapsule.h" extern "C" { void* FUNCTION_CALL_MODE hello(char* b) { printf(" hello......%s\n",b); return NULL; } void* FUNCTION_CALL_MODE GetContext(PyObject *capsule) { printf(" GetContext......\n"); //if (!PyCapsule_IsValid((PyObject *)capsule, "Context")) { // printf(" the Capsule Context is no Valid\n"); // return NULL; //} //return PyCapsule_GetPointer((PyObject *)capsule, "Context"); return NULL; } void* FUNCTION_CALL_MODE GetRequest(PyObject *capsule) { printf(" GetRequest......\n"); if (!PyCapsule_IsValid(capsule, "Request")) { printf(" the Capsule Request is no Valid\n"); return NULL; } return PyCapsule_GetPointer(capsule, "Request"); } void* FUNCTION_CALL_MODE GetAnswer(PyObject *capsule) { printf(" GetAnswer......\n"); if (!PyCapsule_IsValid(capsule, "Answer")) { printf(" the Capsule Answer is no Valid\n"); return NULL; } return PyCapsule_GetPointer(capsule, "Answer"); } PyObject * FUNCTION_CALL_MODE VoidptrToPyobject(void* lpdata, const char* name) { printf(" VoidptrToPyobject......\n"); return PyCapsule_New(lpdata, name, NULL); } void * FUNCTION_CALL_MODE PyobjectToVoidptr(PyObject * capsule, const char* name) { printf(" VoidptrToPyobject......\n"); void* lpdata = PyCapsule_GetPointer(capsule, name); printf("VoidptrToPyobject :%s\n", (char*)lpdata); return lpdata; } PyObject * FUNCTION_CALL_MODE VoidptrToPyobjectS() { printf(" VoidptrToPyobject1......\n"); void * lpdata = "123"; const char* name = "zhaoya"; return PyCapsule_New(lpdata, name, NULL); } }

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4