MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Proc_ProceduresStep

Function Proc_ProceduresStep

src/procedures/proc_procedures.c:68–90  ·  view source on GitHub ↗

promote the rax iterator to the next procedure and return its name and mode.

Source from the content-addressed store, hash-verified

66
67// promote the rax iterator to the next procedure and return its name and mode.
68SIValue *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
92ProcedureResult Proc_ProceduresFree
93(

Callers

nothing calls this directly

Calls 4

SI_ConstStringValFunction · 0.85
Procedure_GetNameFunction · 0.85
Procedure_IsReadOnlyFunction · 0.85
Proc_FreeFunction · 0.85

Tested by

no test coverage detected