returns the start node of a relationship. */
| 100 | |
| 101 | /* returns the start node of a relationship. */ |
| 102 | SIValue AR_STARTNODE(SIValue *argv, int argc, void *private_data) { |
| 103 | if(SI_TYPE(argv[0]) == T_NULL) return SI_NullVal(); |
| 104 | Edge *e = argv[0].ptrval; |
| 105 | NodeID start_id = Edge_GetSrcNodeID(e); |
| 106 | GraphContext *gc = QueryCtx_GetGraphCtx(); |
| 107 | Node *src = rm_malloc(sizeof(Node)); |
| 108 | *src = GE_NEW_NODE(); |
| 109 | // Retrieve the node from the graph. |
| 110 | Graph_GetNode(gc->g, start_id, src); |
| 111 | SIValue si_node = SI_Node(src); |
| 112 | // Mark this value as a heap allocation so that it gets freed properly. |
| 113 | SIValue_SetAllocationType(&si_node, M_SELF); |
| 114 | return si_node; |
| 115 | } |
| 116 | |
| 117 | /* returns the end node of a relationship. */ |
| 118 | SIValue AR_ENDNODE(SIValue *argv, int argc, void *private_data) { |
nothing calls this directly
no test coverage detected