/************************************************************
* Copyright (C) 2006-2007 Masahiko SAWAI All Rights Reserved. 
************************************************************/
#ifndef WIIREMOTE_UTILS_H
#define WIIREMOTE_UTILS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <wiiremote.h> 

#define WRMT_CheckButton WRMT_CheckButtonAny
#define WRMT_CheckButtonAny(buttons, button_mask) ((buttons) & (button_mask))
#define WRMT_CheckButtonAll(buttons, button_mask) (((buttons) & (button_mask)) == (button_mask))

#define WRMT_CheckLED WRMT_CheckLEDAny
#define WRMT_CheckLEDAny(leds, led_mask) ((leds) & (led_mask))
#define WRMT_CheckLEDAll(leds, led_mask) (((leds) & (led_mask)) == (led_mask))

#define WRMT_WiiRemote_CheckButton WRMT_WiiRemote_CheckButtonAny
#define WRMT_WiiRemote_CheckButtonAny(wiiremote, button_mask) (WRMT_WiiRemote_GetState((wiiremote), WRMT_DATA_BUTTONS) & (button_mask))
#define WRMT_WiiRemote_CheckButtonAll(wiiremote, button_mask) ((WRMT_WiiRemote_GetState((wiiremote), WRMT_DATA_BUTTONS) & (button_mask)) == (button_mask))

#define WRMT_WiiRemote_CheckLED WRMT_WiiRemote_CheckLEDAny
#define WRMT_WiiRemote_CheckLEDAny(wiiremote, led_mask) (WRMT_WiiRemote_GetState((wiiremote), WRMT_DATA_LEDS) & (led_mask))
#define WRMT_WiiRemote_CheckLEDAll(wiiremote, led_mask) ((WRMT_WiiRemote_GetState((wiiremote), WRMT_DATA_LEDS) & (led_mask)) == (led_mask))

#ifdef __cplusplus
}
#endif

#endif /* WIIREMOTE_UTILS_H */

