roll_value.h 643 B

1234567891011121314151617
  1. #pragma once
  2. #include <stdint.h>
  3. typedef enum { RollOverflowBehaviorStop, RollOverflowBehaviorRoll } TotpRollValueOverflowBehavior;
  4. #define TOTP_ROLL_VALUE_FN_HEADER(type, step_type) \
  5. void totp_roll_value_##type( \
  6. type* value, \
  7. step_type step, \
  8. type min, \
  9. type max, \
  10. TotpRollValueOverflowBehavior overflow_behavior)
  11. TOTP_ROLL_VALUE_FN_HEADER(int8_t, int8_t);
  12. TOTP_ROLL_VALUE_FN_HEADER(uint8_t, int8_t);
  13. TOTP_ROLL_VALUE_FN_HEADER(uint16_t, int16_t);