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

Function Register_PathFuncs

src/arithmetic/path_funcs/path_funcs.c:283–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283void Register_PathFuncs() {
284 SIType *types;
285 SIType ret_type;
286 AR_FuncDesc *func_desc;
287
288 types = array_new(SIType, 2);
289 array_append(types, T_PTR);
290 array_append(types, T_NULL | T_NODE | T_EDGE | T_PATH);
291 ret_type = T_PATH | T_NULL;
292 func_desc = AR_FuncDescNew("topath", AR_TOPATH, 1, VAR_ARG_LEN, types, ret_type, true, false);
293 AR_RegFunc(func_desc);
294
295 types = array_new(SIType, 3);
296 array_append(types, T_NULL | T_NODE);
297 array_append(types, T_NULL | T_NODE);
298 ret_type = T_PATH | T_NULL;
299 func_desc = AR_FuncDescNew("shortestpath", AR_SHORTEST_PATH, 2, 2, types, ret_type, true, false);
300 AR_SetPrivateDataRoutines(func_desc, ShortestPath_Free, ShortestPath_Clone);
301 AR_RegFunc(func_desc);
302
303 types = array_new(SIType, 1);
304 array_append(types, T_NULL | T_PATH);
305 ret_type = T_ARRAY | T_NULL;
306 func_desc = AR_FuncDescNew("nodes", AR_PATH_NODES, 1, 1, types, ret_type, false, false);
307 AR_RegFunc(func_desc);
308
309 types = array_new(SIType, 1);
310 array_append(types, T_NULL | T_PATH);
311 ret_type = T_ARRAY | T_NULL;
312 func_desc = AR_FuncDescNew("relationships", AR_PATH_RELATIONSHIPS, 1, 1, types, ret_type, false, false);
313 AR_RegFunc(func_desc);
314
315 types = array_new(SIType, 1);
316 array_append(types, T_NULL | T_PATH);
317 ret_type = T_INT64 | T_NULL;
318 func_desc = AR_FuncDescNew("length", AR_PATH_LENGTH, 1, 1, types, ret_type, false, false);
319 AR_RegFunc(func_desc);
320}
321

Callers 1

AR_RegisterFuncsFunction · 0.85

Calls 3

AR_FuncDescNewFunction · 0.85
AR_RegFuncFunction · 0.85

Tested by

no test coverage detected