Category : Network Files
Archive   : VOLGRAF.ZIP
Filename : VOLGRAF.C

 
Output of file : VOLGRAF.C contained in archive : VOLGRAF.ZIP
/* VOLGRAF - determines Volume information on Novell NetWare volumes, and
displays the information graphically. */

#include
#include
#include
#include

#define LINT_ARGS
#define LINTARGS

#define MSC 1
#include

extern int main(void );
extern int draw_bar(int total_bar,unsigned short total_units,unsigned short free_units);
extern int change(unsigned short new_value,unsigned short old_value);

int main()
{

int ret_code,
key,
max_bar_length = 50,
delay_time = 500,
max_vols = 32,
first_vol = 0,
vols_on_screen = 4;

char change_char;
WORD old_free_blks[32],
old_free_slots[32];

/* set up NetWare call variables */

BYTE vol_num;
char vol_name[16];
WORD total_blks,
sectors_per_blk,
free_blks,
dir_slots,
free_dir_slots,
removable;


/* Set Up display screen */

_clearscreen(_GCLEARSCREEN); /* clrscr(); */
_setvideomode(_MRES16COLOR); /* highvideo(); */
printf("\n VolGraf v1.0 LemonSoft, Ltd.\n");
_moveto(1,25); /* gotoxy(1,25); */
printf(" + to go forward - to go backward to quit");
/* normvideo(); */

-moveto(1,2); /* gotoxy(1,2); */
printf("\n Volume 0% 50% 100%\n");
printf("==================================================================");

/* Enter the main loop */

do{

_moveto(1,5); /* gotoxy(1,5); */

for( vol_num=first_vol; vol_num< (first_vol+vols_on_screen);
vol_num++) {

ret_code = GetVolumeInfoWithNumber(
vol_num,
vol_name,
&total_blks,
§ors_per_blk,
&free_blks,
&dir_slots,
&free_dir_slots,
&removable );

if (ret_code == 0){
if (vol_name[0] != '\x0'){
change_char = change(free_blks, old_free_blks[vol_num]);
old_free_blks[vol_num] = free_blks;
printf("%-15s Blocks: %c", vol_name, change_char);
draw_bar(max_bar_length, total_blks, free_blks);
printf("\n %10ld Kb Free", (long)((long) (sectors_per_blk/2)*free_blks));
change_char = change(free_dir_slots, old_free_slots[vol_num]);
old_free_slots[vol_num] = free_dir_slots;
printf("\n DirEntries: %c", change_char);
draw_bar(max_bar_length, dir_slots, free_dir_slots);
printf("\n %10d Free Directory Entries\n", free_dir_slots);
printf("\n");

}else{ /* if there was no volume name */

printf("Volume %2d not installed.", vol_num+1);

clreol();
printf("\n");
clreol();
printf("\n");
clreol();
printf("\n");
clreol();
printf("\n");
clreol();
printf("\n");
}
} else { /* an error */

printf("Some horrible error occurred. ErrorCode = %d\n",ret_code);
}
}

/* check for user input */

key = kbhit();

if (key != 0){
key=getch();
if ((key == '+') || (key == '-')){
if ((key == '+') && (first_vol < max_vols - vols_on_screen)){
first_vol += vols_on_screen;
}
if ((key == '-') && (first_vol > 0)){
first_vol -= vols_on_screen;
}
}
if (key != 27){ /* ESC */
key = 0;
}
}

// delay(delay_time);

} while (key == 0); /* do */

} /* main */

/* draw_bar procedure */

int draw_bar(total_bar, total_units, free_units)
int total_bar;
WORD total_units;
WORD free_units;
{
int bar_loop, bar_length;

bar_length = ((free_units * (long) total_bar) / total_units);

for (bar_loop = 0; bar_loop < (total_bar - bar_length); bar_loop++)
printf("%c", '¯');
for (bar_loop = 0; bar_loop < bar_length; bar_loop++)
printf("%c", 'ì');
}

/* Change procedure - this proc will determine the direction of change
since the last read and return the appropriate character

A 16 is a right arrow and a 17 is a left arrow. 32 is a space
*/

int change(new_value, old_value)
WORD new_value;
WORD old_value;
{
if (new_value < old_value)
return(16);
else if (new_value > old_value)
return(17);
else
return(32);
}






  3 Responses to “Category : Network Files
Archive   : VOLGRAF.ZIP
Filename : VOLGRAF.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/