home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
stdfile_402.lzh
/
StdFile
/
VolList.c
< prev
Wrap
C/C++ Source or Header
|
1990-11-17
|
733b
|
47 lines
#include <libraries/dosextens.h>
#define toAPTR(b) ((b)<<2)
#define toBPTR(a) ((a)>>2)
struct DeviceList *list;
OpenVolList()
{
extern struct DosLibrary *DOSBase;
struct RootNode *root;
struct DosInfo *info;
root = DOSBase -> dl_Root;
info = toAPTR(root->rn_Info);
list = toAPTR(info->di_DevInfo);
}
ReadVolList(name)
char name[32];
{
struct DeviceList *next;
while(list) {
next = toAPTR(list->dl_Next);
if(list->dl_Type == DLT_VOLUME) {
char *ptr;
int count;
ptr = toAPTR((BPTR)list->dl_Name);
count = *ptr++;
if(count > 30)
count = 30;
strncpy(name, ptr, count);
name[count++] = ':';
name[count] = 0;
list = next;
return 1;
}
list = next;
}
return 0;
}
CloseVolList()
{
}