returns the end node of a relationship. */
| 116 | |
| 117 | /* returns the end node of a relationship. */ |
| 118 | SIValue AR_ENDNODE(SIValue *argv, int argc, void *private_data) { |
| 119 | if(SI_TYPE(argv[0]) == T_NULL) return SI_NullVal(); |
| 120 | Edge *e = argv[0].ptrval; |
| 121 | NodeID end_id = Edge_GetDestNodeID(e); |
| 122 | GraphContext *gc = QueryCtx_GetGraphCtx(); |
| 123 | Node *dest = rm_malloc(sizeof(Node)); |
| 124 | *dest = GE_NEW_NODE(); |
| 125 | // Retrieve the node from the graph. |
| 126 | Graph_GetNode(gc->g, end_id, dest); |
| 127 | SIValue si_node = SI_Node(dest); |
| 128 | // Mark this value as a heap allocation so that it gets freed properly. |
| 129 | SIValue_SetAllocationType(&si_node, M_SELF); |
| 130 | return si_node; |
| 131 | } |
| 132 | |
| 133 | /* returns true if the specified property exists in the node, or relationship. */ |
| 134 | SIValue AR_EXISTS(SIValue *argv, int argc, void *private_data) { |
nothing calls this directly
no test coverage detected