#include <stdio.h>
#include <stdbool.h>
typedef enum
{
TEST_FLAG = -1,
AZIMUTH_SPEED_MONITOR_FLAG,
POWER_SUPPLY_MONITOR_FLAG,
LASER_ALIVE_MONITOR_FLAG,
ENABLE_REQUESTED_FLAG,
LASER_SAFETY_FLAG_COUNT
} LaserPumpFlag;
bool sys_laser_pump_enable_get_flag(LaserPumpFlag flag)
{
bool result = false;
if (flag < LASER_SAFETY_FLAG_COUNT)
{
printf("flag was accepted (%d)\n", flag
); result = flag;
}
else
{
printf("flag was not accepted (%d)\n", flag
); }
return result;
}
int main(void) {
// your code goes here
sys_laser_pump_enable_get_flag(-1);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRib29sLmg+CnR5cGVkZWYgZW51bQp7CglURVNUX0ZMQUcgPSAtMSwKICAgIEFaSU1VVEhfU1BFRURfTU9OSVRPUl9GTEFHLAogICAgUE9XRVJfU1VQUExZX01PTklUT1JfRkxBRywKICAgIExBU0VSX0FMSVZFX01PTklUT1JfRkxBRywKICAgIEVOQUJMRV9SRVFVRVNURURfRkxBRywKICAgIExBU0VSX1NBRkVUWV9GTEFHX0NPVU5UCn0gTGFzZXJQdW1wRmxhZzsKCmJvb2wgc3lzX2xhc2VyX3B1bXBfZW5hYmxlX2dldF9mbGFnKExhc2VyUHVtcEZsYWcgZmxhZykKewogICAgYm9vbCByZXN1bHQgPSBmYWxzZTsKCiAgICBpZiAoZmxhZyA8IExBU0VSX1NBRkVUWV9GTEFHX0NPVU5UKQogICAgewogICAgCXByaW50ZigiZmxhZyB3YXMgYWNjZXB0ZWQgKCVkKVxuIiwgZmxhZyk7CiAgICAgICAgcmVzdWx0ID0gZmxhZzsKICAgIH0KICAgIGVsc2UKICAgIHsKICAgIAlwcmludGYoImZsYWcgd2FzIG5vdCBhY2NlcHRlZCAoJWQpXG4iLCBmbGFnKTsKICAgIH0KCiAgICByZXR1cm4gcmVzdWx0Owp9CgppbnQgbWFpbih2b2lkKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglzeXNfbGFzZXJfcHVtcF9lbmFibGVfZ2V0X2ZsYWcoLTEpOwoJcmV0dXJuIDA7Cn0K