| 476 | |
| 477 | |
| 478 | SRD_PRIV int srd_call_sub_decoder_end(struct srd_decoder_inst *di, char **error) |
| 479 | { |
| 480 | assert(di && di->next_di); |
| 481 | |
| 482 | GSList *l; |
| 483 | struct srd_decoder_inst *sub_dec; |
| 484 | PyObject *py_res; |
| 485 | |
| 486 | for (l = di->next_di; l; l = l->next){ |
| 487 | sub_dec = l->data; |
| 488 | |
| 489 | if (PyObject_HasAttrString(sub_dec->py_inst, "end")) |
| 490 | { |
| 491 | py_res = PyObject_CallMethod(sub_dec->py_inst, "end", NULL); |
| 492 | |
| 493 | if (!py_res) |
| 494 | { |
| 495 | srd_exception_catch(error, "Protocol decoder instance %s", |
| 496 | sub_dec->inst_id); |
| 497 | return SRD_ERR_PYTHON; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | //next level decoder |
| 502 | if (sub_dec->next_di != NULL){ |
| 503 | if (srd_call_sub_decoder_end(sub_dec, error) != SRD_OK) |
| 504 | return SRD_ERR_PYTHON; |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | return SRD_OK; |
| 509 | } |
| 510 | |
| 511 | /** @} */ |
no test coverage detected