From 89f9930ec4e1e45f25f8b1a859a6d6ee117a2852 Mon Sep 17 00:00:00 2001 From: cnc Date: Tue, 2 Jun 2026 10:51:56 +0800 Subject: [PATCH] Document LinuxCNC Boost.Python shim source basis --- core/wasm_shims/boost/python/class.hpp | 2 ++ core/wasm_shims/boost/python/converter/registry.hpp | 2 ++ core/wasm_shims/boost/python/def.hpp | 2 ++ core/wasm_shims/boost/python/detail/caller.hpp | 2 ++ core/wasm_shims/boost/python/enum.hpp | 2 ++ core/wasm_shims/boost/python/exception_translator.hpp | 2 ++ core/wasm_shims/boost/python/module.hpp | 2 ++ core/wasm_shims/boost/python/object/class_detail.hpp | 2 ++ core/wasm_shims/boost/python/object_fwd.hpp | 3 ++- .../boost/python/return_internal_reference.hpp | 2 ++ .../python/suite/indexing/map_indexing_suite.hpp | 2 ++ test-linuxcnc-wasm-cmake-safe-probe.sh | 11 +++++++++++ 12 files changed, 33 insertions(+), 1 deletion(-) diff --git a/core/wasm_shims/boost/python/class.hpp b/core/wasm_shims/boost/python/class.hpp index cbbe6de..a91e838 100644 --- a/core/wasm_shims/boost/python/class.hpp +++ b/core/wasm_shims/boost/python/class.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: interpmodule.cc, pyblock.cc, pyemctypes.cc, and +// array1.hh include boost/python/class.hpp for Python binding classes. #include #include diff --git a/core/wasm_shims/boost/python/converter/registry.hpp b/core/wasm_shims/boost/python/converter/registry.hpp index a330665..7c0ae33 100644 --- a/core/wasm_shims/boost/python/converter/registry.hpp +++ b/core/wasm_shims/boost/python/converter/registry.hpp @@ -1,3 +1,5 @@ #pragma once +// LinuxCNC source basis: array1.hh includes boost/python/converter/registry.hpp +// for registered class object lookup. #include "boost/python/object.hpp" diff --git a/core/wasm_shims/boost/python/def.hpp b/core/wasm_shims/boost/python/def.hpp index 8079dbe..9a90651 100644 --- a/core/wasm_shims/boost/python/def.hpp +++ b/core/wasm_shims/boost/python/def.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: canonmodule.cc and interpmodule.cc include +// boost/python/def.hpp for Boost.Python module functions. #include "boost/python/object.hpp" namespace boost { diff --git a/core/wasm_shims/boost/python/detail/caller.hpp b/core/wasm_shims/boost/python/detail/caller.hpp index a330665..af338f9 100644 --- a/core/wasm_shims/boost/python/detail/caller.hpp +++ b/core/wasm_shims/boost/python/detail/caller.hpp @@ -1,3 +1,5 @@ #pragma once +// LinuxCNC source basis: pyarrays.cc includes boost/python/detail/caller.hpp +// for return_internal_reference support. #include "boost/python/object.hpp" diff --git a/core/wasm_shims/boost/python/enum.hpp b/core/wasm_shims/boost/python/enum.hpp index 64e73a5..7f84687 100644 --- a/core/wasm_shims/boost/python/enum.hpp +++ b/core/wasm_shims/boost/python/enum.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: canonmodule.cc, boost_pyenum_macros.hh, and array1.hh +// use boost::python::enum_ for Python enum bindings. #include "boost/python/object.hpp" namespace boost { diff --git a/core/wasm_shims/boost/python/exception_translator.hpp b/core/wasm_shims/boost/python/exception_translator.hpp index 1f5a1a2..c0ebe66 100644 --- a/core/wasm_shims/boost/python/exception_translator.hpp +++ b/core/wasm_shims/boost/python/exception_translator.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: interpmodule.cc uses +// boost::python::register_exception_translator. #include "boost/python/object.hpp" namespace boost { diff --git a/core/wasm_shims/boost/python/module.hpp b/core/wasm_shims/boost/python/module.hpp index 42e73bb..56bf865 100644 --- a/core/wasm_shims/boost/python/module.hpp +++ b/core/wasm_shims/boost/python/module.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: canonmodule.cc and interpmodule.cc use +// BOOST_PYTHON_MODULE for embedded Python module declarations. #include "boost/python/object.hpp" #define BOOST_PYTHON_MODULE(name) extern "C" void init_##name() diff --git a/core/wasm_shims/boost/python/object/class_detail.hpp b/core/wasm_shims/boost/python/object/class_detail.hpp index 7049839..e77f476 100644 --- a/core/wasm_shims/boost/python/object/class_detail.hpp +++ b/core/wasm_shims/boost/python/object/class_detail.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: array1.hh includes boost/python/object/class_detail.hpp +// for registered_class_object(). #include "boost/python/object.hpp" namespace boost { diff --git a/core/wasm_shims/boost/python/object_fwd.hpp b/core/wasm_shims/boost/python/object_fwd.hpp index 18a176a..e318241 100644 --- a/core/wasm_shims/boost/python/object_fwd.hpp +++ b/core/wasm_shims/boost/python/object_fwd.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: interp_internal.hh forward-declares Boost.Python +// object pointers through boost/python/object_fwd.hpp. namespace boost { namespace python { @@ -7,4 +9,3 @@ class object; } // namespace python } // namespace boost - diff --git a/core/wasm_shims/boost/python/return_internal_reference.hpp b/core/wasm_shims/boost/python/return_internal_reference.hpp index c278e92..79348a2 100644 --- a/core/wasm_shims/boost/python/return_internal_reference.hpp +++ b/core/wasm_shims/boost/python/return_internal_reference.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: pyarrays.cc uses boost::python::return_internal_reference +// for array wrapper bindings. #include "boost/python/object.hpp" namespace boost { diff --git a/core/wasm_shims/boost/python/suite/indexing/map_indexing_suite.hpp b/core/wasm_shims/boost/python/suite/indexing/map_indexing_suite.hpp index cdba34a..ddaab7a 100644 --- a/core/wasm_shims/boost/python/suite/indexing/map_indexing_suite.hpp +++ b/core/wasm_shims/boost/python/suite/indexing/map_indexing_suite.hpp @@ -1,5 +1,7 @@ #pragma once +// LinuxCNC source basis: interpmodule.cc, pyblock.cc, pyparamclass.cc, and +// pyinterp1.cc include map_indexing_suite for Boost.Python map wrappers. namespace boost { namespace python { diff --git a/test-linuxcnc-wasm-cmake-safe-probe.sh b/test-linuxcnc-wasm-cmake-safe-probe.sh index 4cff6f4..7329cab 100755 --- a/test-linuxcnc-wasm-cmake-safe-probe.sh +++ b/test-linuxcnc-wasm-cmake-safe-probe.sh @@ -1420,6 +1420,17 @@ grep -F 'LinuxCNC source basis: interp_python.cc, interp_namedparams.cc,' core/w grep -F 'LinuxCNC source basis: interp_python.cc, rs274ngc_pre.cc, and' core/wasm_shims/boost/python/import.hpp >/dev/null grep -F 'LinuxCNC source basis: interp_python.cc and python_plugin.cc use' core/wasm_shims/boost/python/str.hpp >/dev/null grep -F 'LinuxCNC source basis: rs274ngc_pre.cc uses boost::python::scope' core/wasm_shims/boost/python/scope.hpp >/dev/null +grep -F 'LinuxCNC source basis: interpmodule.cc, pyblock.cc, pyemctypes.cc, and' core/wasm_shims/boost/python/class.hpp >/dev/null +grep -F 'LinuxCNC source basis: canonmodule.cc and interpmodule.cc include' core/wasm_shims/boost/python/def.hpp >/dev/null +grep -F 'LinuxCNC source basis: canonmodule.cc and interpmodule.cc use' core/wasm_shims/boost/python/module.hpp >/dev/null +grep -F 'LinuxCNC source basis: canonmodule.cc, boost_pyenum_macros.hh, and array1.hh' core/wasm_shims/boost/python/enum.hpp >/dev/null +grep -F 'LinuxCNC source basis: interpmodule.cc uses' core/wasm_shims/boost/python/exception_translator.hpp >/dev/null +grep -F 'LinuxCNC source basis: pyarrays.cc uses boost::python::return_internal_reference' core/wasm_shims/boost/python/return_internal_reference.hpp >/dev/null +grep -F 'LinuxCNC source basis: pyarrays.cc includes boost/python/detail/caller.hpp' core/wasm_shims/boost/python/detail/caller.hpp >/dev/null +grep -F 'LinuxCNC source basis: array1.hh includes boost/python/converter/registry.hpp' core/wasm_shims/boost/python/converter/registry.hpp >/dev/null +grep -F 'LinuxCNC source basis: array1.hh includes boost/python/object/class_detail.hpp' core/wasm_shims/boost/python/object/class_detail.hpp >/dev/null +grep -F 'LinuxCNC source basis: interp_internal.hh forward-declares Boost.Python' core/wasm_shims/boost/python/object_fwd.hpp >/dev/null +grep -F 'LinuxCNC source basis: interpmodule.cc, pyblock.cc, pyparamclass.cc, and' core/wasm_shims/boost/python/suite/indexing/map_indexing_suite.hpp >/dev/null test -f core/wasm_shims/libgen.h grep -F 'LinuxCNC source basis: src/emc/rs274ngc/interp_o_word.cc uses basename()' core/wasm_shims/libgen.h >/dev/null grep -F 'inline char *basename(const char *path)' core/wasm_shims/libgen.h >/dev/null