1 #include <exec/rawfmt.h>
9 typedef void (*VOID_FUNC
)();
12 /****************************************************************************************/
14 void StrCat(char *s
, char *s2
)
19 /****************************************************************************************/
21 static void filltable(char **table
, char *buff
, char fill
)
39 /****************************************************************************************/
41 void FillNewLineTable (char **table
, char *buff
)
43 filltable(table
, buff
, '\n');
46 /****************************************************************************************/
48 void FillBarTable (char **table
, char *buff
)
50 filltable(table
, buff
, '|');
53 /****************************************************************************************/
56 AROS_UFH2 (void, puttostr
,
57 AROS_UFHA(UBYTE
, chr
, D0
),
58 AROS_UFHA(STRPTR
*,strPtrPtr
,A3
)
63 void puttostr(REGPARAM(d0
, UBYTE
, chr
),
64 REGPARAM(a3
, STRPTR
*, strPtrPtr
))
74 /****************************************************************************************/
77 AROS_UFH2 (void, CountBarsAndChars
,
78 AROS_UFHA(UBYTE
, chr
, D0
),
79 AROS_UFHA(ULONG
*,ptr
,A3
)
84 void CountBarsAndChars(REGPARAM(d0
, UBYTE
, chr
),
85 REGPARAM(a3
, ULONG
*, ptr
))
88 if (chr
== '|') (ptr
[0])++;
95 /****************************************************************************************/
98 AROS_UFH2 (void, CountNewLinesAndChars
,
99 AROS_UFHA(UBYTE
, chr
, D0
),
100 AROS_UFHA(ULONG
*,ptr
,A3
)
105 void CountNewLinesAndChars(REGPARAM(d0
, UBYTE
, chr
),
106 REGPARAM(a3
, ULONG
*, ptr
))
109 if (chr
== '\n') (ptr
[0])++;
116 /****************************************************************************************/
118 APTR
DofmtArgs (char *buff
, char *fmt
, ...)
125 /* Some AROS architectures don't have uniform varadics
126 * (ie an array of IPTR), so they can't use RawDoFmt()
127 * - we will use VNewRawDoFmt() instead.
130 retval
= VNewRawDoFmt(fmt
, (VOID_FUNC
)RAWFMTFUNC_STRING
, &str
, ap
);
133 retval
= RawDoFmt(fmt
, &fmt
+ 1, (VOID_FUNC
)puttostr
, &str
);
139 /****************************************************************************************/
141 APTR
Dofmt (char *buff
, char *fmt
, APTR args
)
145 return RawDoFmt(fmt
, args
, (VOID_FUNC
)puttostr
, &str
);
149 /****************************************************************************************/
151 APTR
DofmtCount (char *fmt
, APTR args
, ULONG
*ptr
, int mode
)
157 (mode
? ((VOID_FUNC
)CountBarsAndChars
) : ((VOID_FUNC
)CountNewLinesAndChars
) ),
161 /****************************************************************************************/
163 void ShortDelay(void)
168 /****************************************************************************************/
170 IPTR
LoopReqHandler(struct rtHandlerInfo
*rthi
)
172 IPTR handler_retval
, sigs
;
179 sigs
= Wait(rthi
->WaitMask
);
181 handler_retval
= rtReqHandlerA(rthi
, sigs
, NULL
);
183 } while (handler_retval
== CALL_HANDLER
);
185 return handler_retval
;
189 /****************************************************************************************/
191 void DoWaitPointer(struct Window
*win
, int doit
, int setpointer
)
196 rtSetWaitPointer(win
);
203 /****************************************************************************************/
205 APTR
DoLockWindow(struct Window
*win
, int doit
, APTR lock
, int lockit
)
207 if (!doit
|| !win
) return NULL
;
209 if (lockit
) return rtLockWindow(win
);
211 rtUnlockWindow(win
, lock
);
216 /****************************************************************************************/
218 void SetWinTitleFlash(struct Window
*win
, char *str
)
220 DisplayBeep(win
->WScreen
);
221 SetWindowTitles(win
, str
, (UBYTE
*)-1);
224 /****************************************************************************************/
225 /****************************************************************************************/
226 /****************************************************************************************/
227 /****************************************************************************************/
228 /****************************************************************************************/
229 /****************************************************************************************/