Add tree traversal utilities to C API.

PiperOrigin-RevId: 639285787
Change-Id: Ieb52da87fb5e1c674985f03c9ff2b18783d1d657
This commit is contained in:
Alessio Quaglino
2024-06-01 01:26:05 -07:00
committed by Copybara-Service
parent 936866be0f
commit 14a3ce5ffa
5 changed files with 112 additions and 2 deletions
+9
View File
@@ -916,6 +916,15 @@ MJAPI mjsDefault* mjs_getSpecDefault(mjSpec* s);
MJAPI int mjs_getId(mjElement* element);
//---------------------------------- Tree traversal ------------------------------------------------
// Return body's first child of given type.
MJAPI mjElement* mjs_firstChild(mjsBody* body, mjtObj type);
// Return body's next child of the same type; return NULL if child is last.
MJAPI mjElement* mjs_nextChild(mjsBody* body, mjElement* child);
//---------------------------------- Attribute setters ---------------------------------------------
// Copy text to string.