diff --git a/analyze-linuxcnc-wasm-blockers.sh b/analyze-linuxcnc-wasm-blockers.sh index 57328c0..431554d 100755 --- a/analyze-linuxcnc-wasm-blockers.sh +++ b/analyze-linuxcnc-wasm-blockers.sh @@ -8,8 +8,8 @@ cd "$(dirname "$0")" # src/emc/rs274ngc/gcodemodule.cc, interp_namedparams.cc, interp_o_word.cc, # and the py*.cc module bindings; tooldata/native-backend blockers come from # src/emc/tooldata/tooldata_mmap.cc and tooldata_db.cc; native filesystem -# blockers come from LinuxCNC RS274 sources such as interp_o_word.cc and -# interp_write.cc. +# coverage comes from LinuxCNC RS274 sources such as interp_o_word.cc +# directory traversal and rs274ngc_pre.cc parameter-file replacement. linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc} manifest=${1:-linuxcnc-rs274-wasm-source-files.txt} diff --git a/check-linuxcnc-wasm-blockers-source-map.sh b/check-linuxcnc-wasm-blockers-source-map.sh index cb01b62..15f5722 100755 --- a/check-linuxcnc-wasm-blockers-source-map.sh +++ b/check-linuxcnc-wasm-blockers-source-map.sh @@ -30,6 +30,16 @@ grep -F '#include "pythonplugin/python_plugin.hh"' "$linuxcnc_root/src/emc/rs274 grep -F 'dlopen' "$linuxcnc_root/src/emc/rs274ngc/interp_base.cc" >/dev/null grep -F 'opendir(direct)' "$linuxcnc_root/src/emc/rs274ngc/interp_o_word.cc" >/dev/null grep -F 'readdir(aDir)' "$linuxcnc_root/src/emc/rs274ngc/interp_o_word.cc" >/dev/null +grep -F 'std::string tempfile = std::string(filename) + ".new";' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F '+ RS274NGC_PARAMETER_FILE_BACKUP_SUFFIX;' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F 'unlink(bakfile.c_str());' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F 'if(link(filename, bakfile.c_str()) < 0)' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null +grep -F 'if(rename(tempfile.c_str(), filename) < 0)' \ + "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" >/dev/null grep -F '#define TOOL_MMAP_FILENAME ".tool.mmap"' "$linuxcnc_root/src/emc/tooldata/tooldata_mmap.cc" >/dev/null grep -F 'int tool_mmap_creator(' "$linuxcnc_root/src/emc/tooldata/tooldata_mmap.cc" >/dev/null @@ -153,6 +163,8 @@ for phrase in [ "does not add CNC behavior", "must not become smoke parser behavior", "blocked `dlopen` and blocked tooldata-users remain empty", + 'parameter-file replacement through `filename + ".new"`', + "O-word lookup and parameter-file replacement", "Python/Boost.Python remap paths remain tracked blockers", "./check-linuxcnc-wasm-blockers-source-map.sh", "does not interpret G-code", diff --git a/docs/linuxcnc-wasm-blockers-source-map.md b/docs/linuxcnc-wasm-blockers-source-map.md index b63dacf..6da3a50 100644 --- a/docs/linuxcnc-wasm-blockers-source-map.md +++ b/docs/linuxcnc-wasm-blockers-source-map.md @@ -18,6 +18,7 @@ a source-link/build guard only; it does not add CNC behavior and must not become replaced by the wasm-safe tooldata mmap backend shim. - `src/emc/rs274ngc/interp_o_word.cc` uses native directory traversal for O-word subroutine lookup; browser persistence remains OPFS-only. +- `src/emc/rs274ngc/rs274ngc_pre.cc` implements LinuxCNC parameter-file replacement through `filename + ".new"`, `filename + ".bak"`, `unlink`, `link`, and `rename`; browser persistence remains OPFS-only. ## Manifest Coverage @@ -44,7 +45,7 @@ a source-link/build guard only; it does not add CNC behavior and must not become | `core-dlopen-shimmed` | 1 | Core LinuxCNC `dlopen` user compiled with dlfcn shim. | | `core-tooldata-shimmed` | 1 | Core LinuxCNC tooldata source compiled with wasm tooldata shims. | | `core-tooldata-users-shimmed` | 2 | Core RS274/NML users of tooldata declarations. | -| `core-native-fs-shimmed` | 16 | Core sources with native filesystem includes or calls covered by WASM shims. | +| `core-native-fs-shimmed` | 16 | Core sources with native filesystem includes or calls covered by WASM shims, including O-word lookup and parameter-file replacement. | Required replacement set: