/*
**    Name: odbcdm.h
**
**    Date: Sat Jul 19 16:09:26 2003
**
*/

#ifndef _ODBCDM_H
#define _ODBCDM_H

#include "os.h"
#include "wimp.h"
#include "toolbox.h"
#include "event.h"
#include "setjmp.h"

/* Structure used by driver manager to track drivers */

typedef struct _RISCOSDLRef {
    void *handle;
    char dll[256];
    int count;
}  RISCOSDLRef;

extern RISCOSDLRef riscosdlref[];

typedef struct _Choices {
    int quittime;
    int nice;
    int nicecount;
} Choices;

extern Choices choices;

/* Driver manager initialisation */

extern int riscosdlrefinit;

/* Count of calls to alloc functions */

extern int riscosalloc;

extern osbool Quit_Application;

extern jmp_buf ossup_jmp_buf;

extern int errno;

extern char *__progname ;

extern toolbox_block block;

#define odbcdm_RESET   0x8003
#define odbcdm_HELP    0x8001
#define odbcdm_CHOICES 0x8000
#define odbcdm_LOGS    0x8002

#ifdef __cplusplus
extern "C" {
#endif

/* Event handlers */

osbool menu_quit(bits,toolbox_action *,toolbox_block *,void *);
osbool menu_reset(bits,toolbox_action *,toolbox_block *,void *);
osbool menu_logs(bits,toolbox_action *,toolbox_block *,void *);
osbool menu_choices(bits,toolbox_action *,toolbox_block *,void *);
osbool menu_help(bits,toolbox_action *,toolbox_block *,void *);
osbool quit(wimp_message *,void *);
osbool iconbar_clicked(bits event_code,toolbox_action *action,toolbox_block *block,void *handle);
osbool message_pending(wimp_message *message,void *handle);
osbool null_reason_code(wimp_event_no event,wimp_block *block,toolbox_block *id_block,void *handle);

/* Check to see if any drivers loaded */

osbool check_quit(void);

#ifdef __cplusplus
}
#endif

#endif
