| 271 | } |
| 272 | |
| 273 | XN_C_API XnStatus xnContextRunXmlScriptFromFileEx(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode) |
| 274 | { |
| 275 | XnStatus nRetVal = XN_STATUS_OK; |
| 276 | |
| 277 | XN_VALIDATE_INPUT_PTR(pContext); |
| 278 | XN_VALIDATE_INPUT_PTR(strFileName); |
| 279 | XN_VALIDATE_OUTPUT_PTR(phScriptNode); |
| 280 | |
| 281 | *phScriptNode = NULL; |
| 282 | |
| 283 | XnNodeHandle hScriptNode; |
| 284 | nRetVal = xnCreateScriptNode(pContext, XN_SCRIPT_FORMAT_XML, &hScriptNode); |
| 285 | XN_IS_STATUS_OK(nRetVal); |
| 286 | |
| 287 | nRetVal = xnLoadScriptFromFile(hScriptNode, strFileName); |
| 288 | if (nRetVal != XN_STATUS_OK) |
| 289 | { |
| 290 | xnProductionNodeRelease(hScriptNode); |
| 291 | return (nRetVal); |
| 292 | } |
| 293 | |
| 294 | nRetVal = xnScriptNodeRun(hScriptNode, pErrors); |
| 295 | if (nRetVal != XN_STATUS_OK) |
| 296 | { |
| 297 | xnProductionNodeRelease(hScriptNode); |
| 298 | return (nRetVal); |
| 299 | } |
| 300 | |
| 301 | *phScriptNode = hScriptNode; |
| 302 | |
| 303 | return (XN_STATUS_OK); |
| 304 | } |
| 305 | |
| 306 | XN_C_API XnStatus xnContextRunXmlScriptEx(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode) |
| 307 | { |
no test coverage detected