alsa.audio: move handling of XRUN when writting to the slave task
[AROS.git] / rom / filesys / SFS / SFSquery / SFSquery.c
blob9c996b4d42247b85f5139cad2f954f6b453982f0
1 #include <dos/dos.h>
2 #include <dos/dosextens.h>
3 #include <proto/dos.h>
4 #include <proto/exec.h>
5 #include <utility/tagitem.h>
6 #include <stdio.h>
8 #include "../FS/packets.h"
9 #include "../FS/query.h"
11 const char version[]="\0$VER: SFSquery 1.0 (" ADATE ")\r\n";
13 LONG main() {
14 struct RDArgs *readarg;
15 UBYTE template[]="DEVICE/A\n";
17 struct {char *name;} arglist={NULL};
19 if((DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",37))!=0) {
20 if((readarg=ReadArgs(template,(IPTR *)&arglist,0))!=0) {
21 struct MsgPort *msgport;
22 struct DosList *dl;
23 UBYTE *devname=arglist.name;
25 while(*devname!=0) {
26 if(*devname==':') {
27 *devname=0;
28 break;
30 devname++;
33 dl=LockDosList(LDF_DEVICES|LDF_READ);
34 if((dl=FindDosEntry(dl,arglist.name,LDF_DEVICES))!=0) {
35 LONG errorcode;
37 msgport=dl->dol_Task;
38 UnLockDosList(LDF_DEVICES|LDF_READ);
41 struct TagItem tags[]={
42 {ASQ_CACHE_ACCESSES , 0},
43 {ASQ_CACHE_MISSES , 0},
45 {ASQ_START_BYTEH , 0},
46 {ASQ_START_BYTEL , 0},
47 {ASQ_END_BYTEH , 0},
48 {ASQ_END_BYTEL , 0},
49 {ASQ_DEVICE_API , 0},
51 {ASQ_BLOCK_SIZE , 0},
52 {ASQ_TOTAL_BLOCKS , 0},
54 {ASQ_ROOTBLOCK , 0},
55 {ASQ_ROOTBLOCK_OBJECTNODES, 0},
56 {ASQ_ROOTBLOCK_EXTENTS , 0},
57 {ASQ_FIRST_BITMAP_BLOCK , 0},
58 {ASQ_FIRST_ADMINSPACE , 0},
60 {ASQ_CACHE_LINES , 0},
61 {ASQ_CACHE_READAHEADSIZE , 0},
62 {ASQ_CACHE_MODE , 0},
63 {ASQ_CACHE_BUFFERS , 0},
65 {ASQ_IS_CASESENSITIVE , 0},
66 {ASQ_HAS_RECYCLED , 0},
67 {TAG_END , 0}
71 printf("SFSquery information for %s:\n", arglist.name);
72 if((errorcode=DoPkt(msgport, ACTION_SFS_QUERY, (SIPTR)&tags, 0, 0, 0, 0))!=DOSFALSE) {
73 ULONG perc;
75 if(tags[0].ti_Data!=0) {
76 perc=tags[1].ti_Data*100 / tags[0].ti_Data;
78 else {
79 perc=0;
82 printf("Start/end-offset : 0x%08lx:%08lx - 0x%08lx:%08lx bytes\n", tags[2].ti_Data, tags[3].ti_Data, tags[4].ti_Data, tags[5].ti_Data);
83 printf("Device API : ");
85 switch(tags[6].ti_Data) {
86 case ASQDA_NSD:
87 printf("NSD (64-bit)\n");
88 break;
89 case ASQDA_TD64:
90 printf("TD64\n");
91 break;
92 case ASQDA_SCSIDIRECT:
93 printf("SCSI direct\n");
94 break;
95 default:
96 printf("(standard)\n");
97 break;
100 printf("Bytes/block : %-8ld Total blocks : %ld\n", tags[7].ti_Data, tags[8].ti_Data);
101 printf("Cache accesses : %-8ld Cache misses : %ld (%ld%%)\n", tags[0].ti_Data, tags[1].ti_Data, (long)perc);
102 printf("Read-ahead cache : %ldx %ld bytes ",tags[14].ti_Data, tags[15].ti_Data);
104 if(tags[16].ti_Data!=0) {
105 printf("(Copyback)\n");
107 else {
108 printf("(Write-through)\n");
111 printf("DOS buffers : %-8ld\n", tags[17].ti_Data);
113 printf("SFS settings : ");
115 if(tags[18].ti_Data!=0) {
116 printf("[CASE SENSITIVE] ");
119 if(tags[19].ti_Data!=0) {
120 printf("[RECYCLED] ");
123 printf("\n");
127 else {
128 VPrintf("Couldn't find device '%s:'.\n",(IPTR *)&arglist.name);
129 UnLockDosList(LDF_DEVICES|LDF_READ);
132 FreeArgs(readarg);
134 else {
135 PutStr("Wrong arguments!\n");
137 CloseLibrary((struct Library *)DOSBase);
139 return(0);