h t t p : / / w w w . m a i l n s p a c e . c o m
Some general purpose functions and header files for C under DOS
Source opened and released under GNU/GPL on 20th December 2004
These are some header files and general purpose functions that were made way back in 1994 for C. Some files could even be used in Clipper. Clipper was another popular programming language by Computer Associates at that time which shared some of its commands and file structures with dBase and FoxPro, but was far more powerful than them. Here's a list of files with their descriptions in brief.

Please note that all these files were made when DOS was the most widely used operating system. Therefore most of this could be useful now only for academic purposes. Secondly, use a DOS based text editor like edit.exe to view them. Notepad may not display all characters properly, especially box characters.

Please ignore all copyright notices. The code and files are released under GNU/GPL. You can download each file individually or download the full set of all these files including this description file.

  1. function.lib
    Although its extension is .lib, it is not a compiled library file and can be read in any text editor. It contains some general purpose functions that could make programming more comfortable. There were lot of very useful functions that I found missing in C but were available for Clipper. So the only way out was to make them once and for all to make future projects faster.

    Please note that before using any function that uses or manipultes screen, a function called setvduaddr() must be called. Just #include this file and functions will run provided other .h files as specified are also included.

  2. key_code.h
    This contains a list of all key_codes generated by the system (scan codes) on key presses. It is far easier to read and maintain code if it reads if (pressedKey == ESC) instead of if (pressedKey == 0x1b).

  3. b&w.h
    In good old DOS days, there used to be monochrome monitors and text could be displayed in bold, underlined, blinking, etc. This file once again contains all these codes to make programming confortable.

  4. colour.h
    Thought monochrome monitors were the popular choice, there used to be some colour monitors as well. This file is for colour monitors.

  5. box.h
    Under DOS, almost all applications required box drawing on the screen. C didn't have any function for drawing boxes. ASCII had a few box drawing characters. Remembering their ASCII codes and using them with printf() was not pleasing at all. So this file was made to be used with a function called drawbox() included in function.lib.

  6. print.h
    Dot Matrix printers were the most widely used printers. Again, there was nothing existing in C in those days that could make printing through C programs easier. Using print.h with the printing functions like print() made it easier.

  7. mouse.lib
    Mouse in those days was a luxury. Keyboard was the only standard input device. Still, it was fun to be able to use mouse in C programs and be one up among comtemporaries. A set of 6 interrupt based functions are here. But a few more functions could have been made but were never made because I went out from the field for some personal reasons.

  8. mouse.h
    As usual, some definitions that can be used with functions in mouse.h

  9. get.lib
    Here're two functions which in tandum can work as replacement for scanf(). As already mentioned earlier, I went out of the field, work on this was not complete to my satisfaction. So there may be some errors.

  10. inclall.txt
    It was tiring to type all #include statements everytime in every new project. So this file was made which will include all the necessary files in the project at one shot. Please note that the readymade .h files are kept after self made .h files so that they can over-ride definition duplicates if any.

  11. calendar.c
    This is the source code of a calendar made in C using some of the functions defined in function.lib and some of these header files. Although the calendar was made in 1994 when no one had even heard of Y2K, the source code is robust enough to take care of it without any problems. Note the speed with which it brings up the calendar for year 9999!! You can also download the pre-compiled executable calendar.com file. Although this DOS application will run from Windows, it would be better if the machine is restarted in DOS mode to run this application.

    Notice the primitive versions of some current GUI input objects like radio buttons. Secondly, the effect is that of an event based application rather than sequential one which was prevalent at that time. The clock running on the top-right corner adds to the effect that the application is event driven.

    There are some secret keypresses kept for fun. But since it is 10 years now, I don't mind revealing them :)). To view them, keep the CTRL key pressed and press ALT key three times.