31 lines
444 B
C
Executable File
31 lines
444 B
C
Executable File
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <hwo/bits.h>
|
|
|
|
struct _access
|
|
{
|
|
int32_t service_partner_id;
|
|
int32_t staff_id;
|
|
int32_t access_code;
|
|
int32_t passcode;
|
|
int32_t magic1;
|
|
int32_t effective_rights;
|
|
};
|
|
|
|
extern struct _access _access;
|
|
|
|
|
|
int32_t access_authorize(struct _access* access);
|
|
|
|
static inline uint8_t access_check(struct _access* access,uint8_t n)
|
|
{
|
|
if (access->effective_rights & BIT(n))
|
|
return 1;
|
|
|
|
return 0;
|
|
};
|
|
|
|
|
|
|