diff options
author | Armin Rigo <arigo@tunes.org> | 2021-07-20 18:29:51 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2021-07-20 18:29:51 +0200 |
commit | 22e1e59ec60b8d0f768acb2393d44d43af846919 (patch) | |
tree | 55e92ec3bc921c5a7d54a83258f6477d12a25397 /doc | |
parent | fa570d4811ccccd471eb902637e17d7f0998de2a (diff) | |
download | cffi-22e1e59ec60b8d0f768acb2393d44d43af846919.tar.gz |
Issue #504: mention that cffi_start_python() is static, and document why and how to call it
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/embedding.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/source/embedding.rst b/doc/source/embedding.rst index f26a0f2..8020f21 100644 --- a/doc/source/embedding.rst +++ b/doc/source/embedding.rst @@ -522,3 +522,10 @@ calling the C function ``cffi_start_python()`` with no argument. It returns an integer, 0 or -1, to tell if the initialization succeeded or not. Currently there is no way to prevent a failing initialization from also dumping a traceback and more information to stderr. +Note that the function ``cffi_start_python()`` is static: it must be +called from C source written inside ``ffibuilder.set_source()``. To +call it from somewhere else, you need to make a function (with a +different non-static name) in the ``ffibuilder.set_source()`` that just +calls ``cffi_start_python()``. The reason it is static is to avoid +naming conflicts in case you are ultimately trying to link a large C +program with more than one cffi embedded module in it. |