promote the rax iterator to the next procedure and return its name and mode.
| 66 | |
| 67 | // promote the rax iterator to the next procedure and return its name and mode. |
| 68 | SIValue *Proc_ProceduresStep |
| 69 | ( |
| 70 | ProcedureCtx *ctx |
| 71 | ) { |
| 72 | ASSERT(ctx->privateData); |
| 73 | |
| 74 | ProcProceduresPrivateData *pdata = (ProcProceduresPrivateData *)ctx->privateData; |
| 75 | // depleted? |
| 76 | if(!raxNext(&pdata->iter)) return NULL; |
| 77 | |
| 78 | // returns the current procedure's name and mode |
| 79 | ProcGenerator gen = pdata->iter.data; |
| 80 | ProcedureCtx *curr_proc_ctx = gen(); |
| 81 | |
| 82 | if(pdata->yield_name) *pdata->yield_name = |
| 83 | SI_ConstStringVal(Procedure_GetName(curr_proc_ctx)); |
| 84 | if(pdata->yield_mode) *pdata->yield_mode = |
| 85 | Procedure_IsReadOnly(curr_proc_ctx) ? SI_ConstStringVal("READ") : |
| 86 | SI_ConstStringVal("WRITE"); |
| 87 | |
| 88 | Proc_Free(curr_proc_ctx); |
| 89 | return pdata->output; |
| 90 | } |
| 91 | |
| 92 | ProcedureResult Proc_ProceduresFree |
| 93 | ( |
nothing calls this directly
no test coverage detected