#ifndef __cmos_h
#define __cmos_h

#ifndef BOOL_DEFINED
#ifdef __STDC_VERSION__
#if __STDC_VERSION__ >= 199901l
#include <stdbool.h>
#define BOOL_DEFINED
#endif
#endif
#ifndef BOOL_DEFINED
typedef int bool;
#define true 1
#define false 0
#define BOOL_DEFINED
#endif
#endif

/* mask_and_value is a byte,
   upper nibble = mask (bit set in mask => cleared in value)
   lower nibble = bits to set
   Only bits 0-3 of each nibble are significant
*/
extern void cmos_set(int mask_and_value);

#ifdef RISCOS3

/* Restores value from just before cmos_set was last called */
extern void cmos_restore(void);

extern bool cmos_changed;

#else  /* !defined RISCOS3 */

#ifndef RISCOS4
#error RISCOS3 and/or RISCOS4 macros must be defined
#endif /* !defined RISCOS4 */

#define cmos_changed FALSE
#define cmos_restore()

#endif  /* defined RISCOS3 */

/* This goes here because it used to be static and
   I can't be bothered to move it */
#ifdef RISCOS4
#ifdef RISCOS3
bool riscos4(void);
#else
#define riscos4() TRUE
#endif /* RISCOS3 */
#endif /* RISCOS4 */

#endif  /* __cmos_h */
