1 #include <exec/types.h>
3 #include <proto/exec.h>
4 #include <proto/intuition.h>
6 #include "asmsupport.h"
8 #include "transactions_protos.h"
10 #include "req_protos.h"
13 void dreqArgs(UBYTE
*fmt
, APTR params
)
17 if(globals
->debugreqs
!=FALSE
) {
19 CONST_STRPTR name
, device
;
23 AROS_BSTR_ADDR(globals
->devnode
->dn_Name
),
24 AROS_BSTR_ADDR(globals
->startupmsg
->fssm_Device
),
25 globals
->startupmsg
->fssm_Unit
,
29 if((fmt2
=AllocVec(strlen(fmt
)+100,0))!=0) {
30 _DEBUG(("\nREQUESTER\n\n"));
31 RawDoFmt("SmartFilesystem %s: (%s, unit %ld)\n\n%s",(RAWARG
)&args
,putChFunc
,fmt2
);
33 if (requestArgs(PROGRAMNAME
, fmt2
, "Continue|No more requesters", params
) == 0)
34 globals
->debugreqs
=FALSE
;
43 LONG
reqArgs(UBYTE
*fmt
, UBYTE
*gads
, APTR params
)
56 /* Simple requester function. It will put up a requester
59 "Volume 'BOOT' (DH0: scsi.device, unit 0)"
63 "Device DH0: (scsi.device, unit 0)"
65 This depends on whether or not there is a valid
68 if(globals
->volumenode
!=0) {
69 args
.dl
=AROS_BSTR_ADDR(globals
->volumenode
->dl_Name
);
72 args
.dn
=AROS_BSTR_ADDR(globals
->devnode
->dn_Name
);
73 args
.device
=AROS_BSTR_ADDR(globals
->startupmsg
->fssm_Device
);
74 args
.unit
=globals
->startupmsg
->fssm_Unit
;
77 if((fmt2
=AllocVec(strlen(fmt
)+100,0))!=0) {
79 if(globals
->volumenode
!=0) {
80 RawDoFmt("Volume '%s' (%s: %s, unit %ld)\n\n%s",(RAWARG
)&args
.dl
,putChFunc
,fmt2
);
83 RawDoFmt("Device %s: (%s, unit %ld)\n\n%s",(RAWARG
)&args
.dn
,putChFunc
,fmt2
);
86 gadget
= requestArgs(PROGRAMNAME
" request", fmt2
, gads
, params
);
95 LONG
req_unusualArgs(UBYTE
*fmt
, APTR params
)
107 /* Simple requester function. */
108 args
.dn
=AROS_BSTR_ADDR(globals
->devnode
->dn_Name
);
109 args
.device
=AROS_BSTR_ADDR(globals
->startupmsg
->fssm_Device
);
110 args
.unit
=globals
->startupmsg
->fssm_Unit
;
112 args
.msg
="This is a safety check requester, which should\n"\
113 "never appear under normal conditions. Please\n"\
114 "notify the author about the error above and if\n"\
115 "possible under what circumstances it appeared.\n\n"\
116 "BEWARE: SFS might crash if you click Continue.\n"\
117 " Please save your work first!";
119 if((fmt2
=AllocVec(strlen(fmt
)+400,0))!=0) {
121 RawDoFmt("SmartFilesystem %s: (%s, unit %ld)\n\n%s\n\n%s",(RAWARG
)&args
,putChFunc
,fmt2
);
122 gadget
= requestArgs(PROGRAMNAME
" request", fmt2
, "Continue", params
);
131 void request2(UBYTE
*text
) {
132 request(PROGRAMNAME
, text
, "Ok", 0);
137 LONG
requestArgs(UBYTE
*title
, UBYTE
*fmt
, UBYTE
*gads
, APTR params
)
139 struct EasyStruct es
;
141 es
.es_StructSize
=sizeof(struct EasyStruct
);
144 es
.es_TextFormat
=fmt
;
145 es
.es_GadgetFormat
=gads
;
147 return EasyRequestArgs(0, &es
, 0, params
);
152 void outputcachebuffer(struct CacheBuffer
*cb
) {
156 _DEBUG(("CacheBuffer at address 0x%08lx of block %ld (Locked = %ld, Bits = 0x%02lx)\n",cb
,cb
->blckno
,(LONG
)cb
->locked
,(LONG
)cb
->bits
));
160 for(n
=0; n
<(globals
->bytes_block
>>5); n
++) {
161 _DEBUG(("%08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",a
[0],a
[1],a
[2],a
[3],a
[4],a
[5],a
[6],a
[7]));