Subject: ScanDisk HOW-TO Date: Thu, 9 Nov 2000 17:23:40 -0600 From: Joe Cosentino To: Kurt Zammit CC: Enrico Bartky, Jim Hall OK guys... Here's an overview of how to code ScanDisk and some of the features I've implemented. 1) The ScanDisk interface is based off of Defrag's which was written by Imre Leber, licensed under the GPL. If you have any questions about ScanDisk's interactive user interface (with buttons and stuff), email him. (Dialog boxes, buttons, etc...) 2) Command-line interface: EXTREMELY IMPORTANT: This is how to do this. In scandisk.c on line 794, you will see this: if (flags.no_screen==TRUE) This means that the user wants to use the command line interface because 1) They used the /NOUI or the /TEXT options on the command line, or in scandisk.ini they set Display = Off. Also, you will see that the function get_descriptor has the following syntax: get_descriptor(int drive, int interactive). The interactive means that the user wants to use the regular interface if it is set at 1. If it is set at 0, then the user wants to use the command line interface. All you have to do to further implement the command line interface is use the interactive parameter in the functions. So, if I want to make a function that scans the FAT, this is what I'd do: int scan_fat(int drive, int interactive) { if (interactive) { // DO STUFF WITH THE UI LIBRARY. } // end if. else { printf("Checking FAT...."); // FAT SCANNING FUNCTIONS. printf("Done.\n"); } // end else. } // end scan_fat. Pretty simple. All you have to do is study the code a little bit...I've made it extremely easy to follow. You can see in the call to get_descriptor on line 799, under the command line interface it says get_descriptor(drive, 0); This is because the interface is not being used, so we set interactive to 0. On line 838, we ARE using the interface, so it reads get_descriptor(drive, 1); 3) Same thing for the LOG functions and the INI file reader. All you have to do to find out how they are implemented is study the code. It's really easy to follow and self explanatory. 4) ALL the help functions have already been implemented when you click "More Information". 5) Don't forget to allow for the /CHECKONLY switch (and the /AUTOFIX switch when implemented <-- hasn't been done yet). 6) If you have M$-$candisk at home on a Windows 9x machine and want to see how the DOS part of it works, instead of re-booting your system to run in M$-DO$ mode, type scandisk /TEXT at the command line. The /NOUI switch will not work. 7) I have included a HTML file in the /DOC folder that describes (briefly) some of the command line switches (and some undocumented ones for ScanDisk). I have not implemented all the command line switches yet...only some of them. 8) This code was compiled with Borland Turbo C++ 3.0 and NASM 0.98. Make sure you have these installed on your system to compile ScanDisk. PLEASE NOTE: I don't want this email to come off in a bad way...the reason I'm sending it is because I will not be here to answer your questions (if you have any) and I want to leave this as thorougly documented as I can before I leave. ***ALSO IMPORTANT:*** Please look over ALL of the code before Saturday to see if there's anything I forgot that you need help with. I will only be around to answer questions as late as 12:00PM Central Standard Time on Monday, November 13th. Later, Joe