4.5 KiB
4.5 KiB
LinuxCNC tooldata source map
This map records the source basis and boundaries for LinuxCNC tooldata coverage in native, source-link, switchkins, and WASM-safe build paths. It is a source-link/shim guard only; it must not add CNC behavior and must not expand the temporary smoke parser.
LinuxCNC Source Basis
src/emc/tooldata/Submakefileselectstooldata_mmap.ccortooldata_nml.cc, and always includestooldata_common.cc,tooldata_db.cc, andtool_watch.cc.src/emc/tooldata/tooldata_common.ccprovides tool table parsing, formatting, load/save, and database-mode entry points.src/emc/tooldata/tooldata_mmap.ccprovides native mmap tool table storage.src/emc/tooldata/tooldata_nml.ccprovides the NML tool table registration backend selected byTOOL_NML_FLAG.src/emc/tooldata/tooldata_db.ccprovides external database entry points.src/emc/tooldata/tooldata_db.ccreturns-1fromtooldata_db_getall()when the external DB is not live, and returns0fromtooldata_db_notify()without side effects in that same state.src/emc/tooldata/tool_mmap_read.ccandsrc/emc/tooldata/tool_watch.ccare utility sources from the same LinuxCNC tooldata build metadata.src/emc/tooldata/tooldata.hhdeclares the tooldata API used by RS274 and WASM-safe shims.
Manifest And Shim Coverage
| Coverage | Boundary |
|---|---|
linuxcnc-rs274-source-files.txt |
Tracks the full LinuxCNC src/emc/tooldata source directory and tooldata.hh. |
linuxcnc-rs274-wasm-source-files.txt |
Links tooldata_common.cc, blocks native tooldata_mmap.cc, and records runtime shim source bases for tooldata_db.cc and tooldata_nml.cc. |
linuxcnc-kinematics-source-files.txt |
Tracks 10 LinuxCNC TOOL_TABLE files referenced by covered M428/M429/M430 INI sources as tooldata source coverage only. |
core/wasm_shims/tooldata/tooldata_mmap_backend.cc |
Adapts LinuxCNC tooldata_mmap.cc exports to WASM-safe in-memory storage. |
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc |
Adapts LinuxCNC tooldata_nml.cc and tooldata_db.cc runtime entry points without native services. |
test-linuxcnc-wasm-tooldata-link.sh |
Links the wasm-safe tooldata shim against LinuxCNC tooldata runtime expectations. |
test-linuxcnc-wasm-tooldata-common-link.sh |
Links LinuxCNC tooldata_common.cc through the wasm-safe standalone probe. |
test-linuxcnc-wasm-tooldata-mmap-symbols.sh |
Compares wasm mmap backend exports with LinuxCNC tooldata_mmap.cc. |
test-linuxcnc-wasm-tooldata-runtime-symbols.sh |
Compares runtime stub exports with LinuxCNC tooldata_db.cc and tooldata_nml.cc. |
External DB Stub Boundaries
core/wasm_shims/tooldata/tooldata_runtime_stubs.ccmust keep external DB services unavailable for browser-safe probes; it must not fork, exec, poll, or keep a live external database process.tooldata_db_init()must preserve the LinuxCNCMAX_DB_PROGRAM_ARGS=10,strtok_r()argument splitting, andaccess(..., X_OK)rejection edges fromsrc/emc/tooldata/tooldata_db.ccbefore returning-1.tooldata_db_getall()must return-1whiledb_liveis false, andtooldata_db_notify()must return0without side effects whiledb_liveis false.
Boundaries
- Tool table files referenced by switchkins INI files are source coverage only; they must not become browser API fields or generated switchkins aliases.
- WASM-safe tooldata shims must preserve the LinuxCNC export surface checked by symbol probes.
- WASM-safe tooldata runtime stubs must keep external database services unavailable while preserving LinuxCNC inactive-DB return values.
- Native and source-link paths must keep the full LinuxCNC
src/emc/tooldatasource directory tracked in the native RS274 manifest. build-wasm.shmust run tooldata link and symbol probes before copying browser artifacts.test-native.sh,test-linuxcnc-source-link.sh, andbuild-wasm.shmust run./check-linuxcnc-tooldata-source-map.shbefore consuming tooldata-backed native objects, source-linked LinuxCNC objects, or browser artifacts.- The tooldata source-map guard validates LinuxCNC source/shim ownership and manifest drift only; it does not interpret G-code.
Checks
Run:
./check-linuxcnc-tooldata-source-map.sh
./test-native.sh
./test-linuxcnc-source-link.sh
./build-wasm.sh
check-linuxcnc-tooldata-source-map.sh keeps this document, LinuxCNC tooldata
source anchors, manifest coverage, WASM shim/probe boundaries, and switchkins
TOOL_TABLE source-only policy synchronized.