| 513 | } |
| 514 | |
| 515 | Attribute_ID GraphContext_GetAttributeID |
| 516 | ( |
| 517 | GraphContext *gc, |
| 518 | const char *attribute |
| 519 | ) { |
| 520 | // Acquire a read lock for looking up the attribute. |
| 521 | pthread_rwlock_rdlock(&gc->_attribute_rwlock); |
| 522 | // Look up the attribute ID. |
| 523 | void *id = raxFind(gc->attributes, (unsigned char *)attribute, strlen(attribute)); |
| 524 | // Release the lock. |
| 525 | pthread_rwlock_unlock(&gc->_attribute_rwlock); |
| 526 | |
| 527 | if(id == raxNotFound) return ATTRIBUTE_ID_NONE; |
| 528 | |
| 529 | return (uintptr_t)id; |
| 530 | } |
| 531 | |
| 532 | void GraphContext_RemoveAttribute |
| 533 | ( |
no outgoing calls
no test coverage detected