/* irec.h */

#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
#include <math.h>
#include <dos.h>
#include <dos/dostags.h>
#include <time.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>

#include <libraries/dos.h>
#include <libraries/asl.h>
#include <libraries/locale.h>
#include <devices/input.h>
#include <devices/inputevent.h>

#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>
#include <exec/exec.h>
#include <dos/dos.h>
#include <graphics/gfx.h>
#include <utility/tagitem.h>

#include <workbench/icon.h>
#include <workbench/startup.h>
#include <workbench/workbench.h>

#include <proto/all.h>
#include <clib/muimaster_protos.h>

#include <rexx/errors.h>

#include <pragmas/asl_pragmas.h>
#include <pragmas/wb_pragmas.h>
#include <pragmas/icon_pragmas.h>
#include <pragmas/muimaster_pragmas.h>
#include <pragmas/commodities_pragmas.h>
#include <pragmas/gadtools_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include <pragmas/exec_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/gadtools_pragmas.h>


#define STRMAXLEN 256
#define IREC_VERSION "$VER: IREC 1.4 "__DATE__" "__TIME__
#define RETURN_QUIT  0
#define RETURN_STOP  1
#define RETURN_IS_OK 2
#define REC_START    1
#define REC_STOP     2

struct action 
       {
        CxObj            *key;
        CxObj            *sender;
        CxObj            *translate;
        UBYTE             hotkey[STRMAXLEN];           
        UBYTE             file [STRMAXLEN]; 
       	LONG              id;
       };
       
struct a_node
       {
       	struct Node   an_Node;
      	 struct action an_action;
       };
/*--------------------------------------------------------*/

extern struct NewBroker  newbroker;
extern CxObj            *broker;  
extern UBYTE             rec_file[STRMAXLEN];
extern LONG              recording;
extern ULONG             min_delay;
extern BYTE              h_priority;
extern ULONG             i_dl,i_mb;
extern ULONG             rec_max,max_on;
extern LONG              SigBit;

extern struct Library       *UtilityBase;
extern struct Library       *IconBase;
extern struct Library       *CxBase;
extern struct Library       *KeymapBase;

extern void __stdargs main(int argc,char **argv);
extern int            OpenBroker(int argc, char **argv);
extern void           CloseBroker(void);
extern struct a_node *MakeActionNode(UBYTE *key,UBYTE *file, LONG id);
extern void           RemActionNode(struct a_node *node);
extern int            HandleBroker(void);
extern void           rec_start_f(ULONG n);
extern void           rec_stop_f(UBYTE *name);
extern LONG           init_recorder(void);
extern void           exit_recorder(void);
