| 163 | } |
| 164 | |
| 165 | Node *Record_GetNode |
| 166 | ( |
| 167 | const Record r, |
| 168 | uint idx |
| 169 | ) { |
| 170 | switch(r->entries[idx].type) { |
| 171 | case REC_TYPE_NODE: |
| 172 | return &(r->entries[idx].value.n); |
| 173 | case REC_TYPE_UNKNOWN: |
| 174 | return NULL; |
| 175 | case REC_TYPE_SCALAR: |
| 176 | // Null scalar values are expected here; otherwise fall through. |
| 177 | if(SIValue_IsNull(r->entries[idx].value.s)) return NULL; |
| 178 | default: |
| 179 | ErrorCtx_RaiseRuntimeException("encountered unexpected type in Record; expected Node"); |
| 180 | return NULL; |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | Edge *Record_GetEdge |
| 185 | ( |
no test coverage detected