/* ----------------------------------------------------------------------------
 * Raima Database Manager
 *
 * Copyright (c) 2011 Raima Inc.,  All rights reserved.
 *
 * Use of this software, whether in source code format, or in executable,
 * binary object code form, is governed by the Raima LICENSE which
 * is fully described in the LICENSE.TXT file, included within this
 * distribution of files.
 * ----------------------------------------------------------------------------
 */

/* hatypes.h - Contains type definitions for the HA functions */

#if !defined(__HATYPES_H)
#define __HATYPES_H

#if defined(__cplusplus)
extern "C" {
#endif

typedef uint64_t HA_USER;

/* Return code definition for the HA functions */
typedef enum {
    HA_DIAG_OKAY = 0,
    HA_DIAG_EOQ,
    HA_DIAG_FAILED,
    HA_DIAG_NOMEMORY,
    HA_DIAG_INVOP,
    HA_DIAG_NODB,
    HA_DIAG_EXECERR,
    HA_DIAG_INVNULL,
    HA_DIAG_RPCERR,
    HA_DIAG_IASYNC
} HA_DIAG;

/* Status code definition for the HA functions */
typedef enum {
    HA_DB_SYNC_ERROR = 1001,    /* 1001 */
    HA_DB_DESTROY,              /* 1002 */
    HA_QUEUE_OVERFLOW,          /* 1003 */
    HA_MASTERDB_CLOSED,         /* 1004 */
    HA_MASTERDB_OPENED,         /* 1005 */
    HA_SLAVEDB_CLOSED,          /* 1006 */
    HA_SLAVEDB_OPENED,          /* 1007 */
    HA_SLAVEDB_NOTFOUND,        /* 1008 */

    /* Codes used for event callouts */
    HA_MASTER_DISCONNECT,       /* 1009 */
    HA_MASTER_IASYNC,           /* 1010 */
    HA_SLAVE_DISCONNECT,        /* 1011 */
    HA_SLAVE_LOCKED,            /* 1012 */
    HA_SLAVE_SYNCING,           /* 1013 */
    HA_SLAVE_TIMEOUT,           /* 1014 */
    HA_SLAVE_UPDATED,           /* 1015 */
} HA_STATUS;

typedef enum {
    HA_INT_SYNC = 0,
    HA_INT_ASYNC_PENDING,
    HA_INT_ASYNC
} HA_INT_STATUS;

typedef enum {
    HA_ACT_QUIESCE = 0,
    HA_ACT_WAKEUP
} HA_ACT_TYPE;

#if defined(__cplusplus)
}
#endif

#endif  /* __HATYPES_H */

