Given a command ID, this function set by reference 'word' and 'bit' * so that user->allowed_commands[word] will address the right word * where the corresponding bit for the provided ID is stored, and * so that user->allowed_commands[word]&bit will identify that specific * bit. The function returns C_ERR in case the specified ID overflows * the bitmap in the user representation. */
| 372 | * bit. The function returns C_ERR in case the specified ID overflows |
| 373 | * the bitmap in the user representation. */ |
| 374 | int ACLGetCommandBitCoordinates(uint64_t id, uint64_t *word, uint64_t *bit) { |
| 375 | if (id >= USER_COMMAND_BITS_COUNT) return C_ERR; |
| 376 | *word = id / sizeof(uint64_t) / 8; |
| 377 | *bit = 1ULL << (id % (sizeof(uint64_t) * 8)); |
| 378 | return C_OK; |
| 379 | } |
| 380 | |
| 381 | /* Check if the specified command bit is set for the specified user. |
| 382 | * The function returns 1 is the bit is set or 0 if it is not. |
no outgoing calls
no test coverage detected