alsa.audio: move handling of XRUN when writting to the slave task
[AROS.git] / rom / filesys / console_handler / con_handler_intern.h
blob006029c9bd55efb2ba50e2d6945ee63081a50ead
1 #ifndef __CON_HANDLER_INTERN_H
2 #define __CON_HANDLER_INTERN_H
3 /*
4 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 $Id$
7 Desc: Internal header-file for emulation-handler.
8 Lang: english
9 */
11 /* AROS includes */
12 #include <exec/libraries.h>
13 #include <exec/types.h>
14 #include <dos/dosextens.h>
15 #include <intuition/intuition.h>
16 #include <hidd/hidd.h>
17 #include <aros/asmcall.h>
20 ** stegerg:
22 ** if BETTER_WRITE_HANDLING is #defined then writes are sent to
23 ** console.device in smaller parts (max. 256 bytes or upto next
24 ** LINEFEED).
26 ** NOTE: Could be problematic with control sequences in case of
27 ** the 256-Byte-Block write (write size is >256 but no LINE-
28 ** FEED was found in this first (or better actual) 256 bytes
29 ** to be written.
31 **/
33 #define BETTER_WRITE_HANDLING 1
34 #define RMB_FREEZES_OUTPUT 1
36 #define CONTASK_STACKSIZE (AROS_STACKSIZE)
37 #define CONTASK_PRIORITY 5
39 #define CONSOLEBUFFER_SIZE 256
40 #define INPUTBUFFER_SIZE 256
41 #define CMD_HISTORY_SIZE 32
42 #define PASTEBUFSIZE 16384
44 struct conTaskParams
46 struct conbase *conbase;
47 struct Task *parentTask;
48 ULONG initSignal;
51 struct filehandle
53 struct IOStdReq *conreadio;
54 struct IOStdReq conwriteio;
55 struct MsgPort *conreadmp;
56 struct MsgPort *conwritemp;
57 struct Window *window;
58 struct Window *otherwindow; /* WINDOW0xXXXXXXXX parameter */
59 struct Task *contask;
60 struct Task *breaktask;
61 struct Task *lastwritetask;
62 struct MinList pendingReads;
63 struct NewWindow nw;
64 struct MsgPort *timermp;
65 struct timerequest *timerreq;
66 struct MsgPort *appmsgport;
67 struct AppMessage *appmsg;
68 struct AppWindow *appwindow;
69 UBYTE *wintitle;
70 UBYTE *screenname;
71 #if BETTER_WRITE_HANDLING
72 LONG partlywrite_actual;
73 LONG partlywrite_size;
74 #endif
75 WORD conbufferpos;
76 WORD conbuffersize;
77 WORD inputstart; /* usually 0, but needed for multi-lines (CONTROL RETURN) */
78 WORD inputpos; /* cursor pos. inside line */
79 WORD inputsize; /* length of input string */
80 WORD canreadsize;
81 WORD historysize;
82 WORD historypos;
83 WORD historyviewpos;
84 WORD usecount;
85 UWORD flags;
87 UBYTE consolebuffer[CONSOLEBUFFER_SIZE + 2];
88 UBYTE inputbuffer[INPUTBUFFER_SIZE + 2];
89 UBYTE historybuffer[CMD_HISTORY_SIZE][INPUTBUFFER_SIZE + 1];
91 /* If pastebuffer != 0, this contains data to paste from ConClip */
92 WORD pastebufferpos;
93 WORD pastebuffersize;
94 STRPTR pastebuffer;
95 struct Device *inputbase;
96 struct IntuitionBase *intuibase;
97 struct GfxBase *gfxbase;
98 struct DosLibrary *dosbase;
99 struct Library *gtbase;
100 struct Library *utilbase;
101 struct Library *workbenchbase;
104 /* filehandle flags */
106 #define FHFLG_READPENDING 1
107 #define FHFLG_WRITEPENDING 2
108 #define FHFLG_CANREAD 4
109 #define FHFLG_WAIT 8 /* filename contained WAIT */
110 #define FHFLG_RAW 16 /* in RAW mode */
111 #define FHFLG_ASYNCCONSOLEREAD 32 /* There is a pending async console.device CMD_READ request */
112 #define FHFLG_AUTO 64 /* filename contained AUTO */
113 #define FHFLG_CONSOLEDEVICEOPEN 128
114 #define FHFLG_EOF 256
115 #define FHFLG_WAITFORCLOSE 512 /* Console with WAIT is waiting to be closed */
116 #define FHFLG_BOOTCON 1024/* Special marker for boot console */
118 #undef InputBase
119 #undef IntuitionBase
120 #undef DOSBase
121 #undef GadToolsBase
122 #undef UtilityBase
123 #undef WorkbenchBase
126 * FIXME: Remove these #define xxxBase hacks
127 * Do not use this in new code !
129 #define InputBase fh->inputbase
130 #define IntuitionBase fh->intuibase
131 #define DOSBase fh->dosbase
132 #define GadToolsBase fh->gtbase
133 #define GfxBase fh->gfxbase
134 #define UtilityBase fh->utilbase
135 #define WorkbenchBase fh->workbenchbase
137 #endif /* __CON_HANDLER_INTERN_H */