home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************/
- /* File: VINFO.C */
- /* */
- /* Function: List information about all volumes on the default */
- /* server. */
- /* */
- /* Usage: vinfo */
- /* */
- /* Functions Called: GetVolumeInfoWithNumber */
- /* GetPreferredConnectionID */
- /* GetDefaultConnectionID */
- /* GetPrimaryConnectionID */
- /* SetPreferredConnectionID */
- /* ISShellLoaded */
- /* */
- /***************************************************************************/
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
- #include "netware.h"
-
- void main( void )
- {
- int r;
- int i;
- char vname[17];
- unsigned int spb,tb,ab,tds,ads;
- int vir;
- int thisserver,prefserver;
-
- if (IsShellLoaded() != SUCCESS)
- {
- printf("*** No netware shell loaded ***\n");
- return;
- }
-
- if ((prefserver = GetPreferredConnectionID()) == 0)
- {
- if ((thisserver = GetDefaultConnectionID()) == 0)
- thisserver = GetPrimaryConnectionID();
- SetPreferredConnectionID( thisserver );
- }
- else
- thisserver = prefserver;
-
- for(i=0;i<32;i++)
- {
- r=GetVolumeInfoWithNumber((byte)i,vname,
- &spb,&tb,&ab,&tds,&ads,&vir);
- if (r != 0)
- printf("GetVolumeInfoWithNumber failed %02.2x on Volume: %d\n",
- r,i);
- else
- if (strlen(vname)!=0)
- {
- printf("\nVolume %d:- %s\n",i,vname);
- printf(" sectors per block: %u\n",spb);
- printf(" total blocks: %u\n",tb);
- printf(" available blocks: %u\n",ab);
- printf(" total directory slots: %u\n",tds);
- printf(" available directory slots: %u\n",ads);
- printf(" volume is removable: %d\n",vir);
- }
- }
-
- if (thisserver != prefserver) /* reset preferred server */
- SetPreferredConnectionID( prefserver );
- }
-
-