Results of 1 - 2 of about 2 for pFunc (0.001 sec.)
- 1. 他のアプリケーションへの Python の埋め込み 11228
- 1. 他のアプリケーションへの Python の埋め込み 前章では、 Python を拡張する方法、すなわち C 関数のライブラリを Python に結びつけて機能を拡張する方法について述べました。同じようなことを別の方法でも実行できます: それは、自分の C/C++ アプリケー
...ます: #define PY_SSIZE_T_CLEAN #include <Python.h> int main ( int argc , char * argv []) { PyObject * pName , * pModule , * pFunc ; PyObject * pArgs , * pValue ; int i ; if ( argc < 3 ) { fprintf ( stderr , "Usage: call pythonfile funcname [args] \n "...]); /* pName のエラーチェックは省略 */ pModule = PyImport_Import ( pName ); Py_DECREF ( pName ); if ( pModule != NULL ) { pFunc = PyObject_GetAttrString ( pModule , argv [ 2 ]); /* pFunc は新しい参照 */ if ( pFunc && PyCallable_Check ( pFunc )) { pAr...eturn 1 ; } /* ここで pValue の参照が盗まれる: */ PyTuple_SetItem ( pArgs , i , pValue ); } pValue = PyObject_CallObject ( pFunc , pArgs ); Py_DECREF ( pArgs ); if ( pValue != NULL ) { printf ( "Result of call: %ld \n " , PyLong_AsLong ( pValue )); Py... - https://man.mtool.work/python/3.14/extending/embedding.html
- 型オブジェクト 7485
- 型オブジェクト type PyTypeObject 次に属します: Limited API (不透明な構造体として). 組み込み型を記述する際に用いられる、オブジェクトを表す C 構造体です。 PyTypeObject PyType_Type 次に属します: Stable ABI . 型オブジェクト自身の型オブジェクトで
..._tp_vectorcall で tp_vectorcall フィールドを設定できるようになりました。 詳細はフィールドの説明を参照してください。 void * pfunc The desired value of the slot. In most cases, this is a pointer to a function. pfunc values may not be NULL , except for t... - https://man.mtool.work/python/3.14/c-api/type.html
PREV
1
NEXT