Contents Chapter 1: Installation and Use (a) Contents of the library disk (b) Installing the library and the header files (c) Using the library with Microsoft's CL compiler (d) Using the library with Borland's TCC compiler (e) Using more than one Dolphin library Chapter 2: Conventions and Utilities (a) The Dolphin defined types (b) The header files (c) The _f functions (d) The SHOWFUNC utility Chapter 3: The Library Functions 3.1 Date functions Introduction date_earlier() & date_earlier_c() Reports if one date is earlier than another. date_to_jdn() & date_to_jdn_c() Converts a date to a Julian day number. date_to_str() & date_to_str_c() Converts a date to a character string. date_valid() & date_valid_c() Tells if a date is a valid date. day_name() Returns "Sunday", etc. days_in_date_range() & days_in_date_range_c() Returns days between two dates. days_in_month() & days_in_month_c() Returns number of days in a given month. days_in_year() & days_in_year_c() Returns number of days in a given year. day_of_week() & day_of_week_c() Returns day-of-week for a given date. get_system_date() Fills in date structure with system date. is_leap_year() & is_leap_year_c() Tells if a year is a leap year. is_weekday() & is_weekday_c() Tells if a date is a weekday. jdn_to_date() & jdn_to_date_c() Converts a Julian day number to a date. month_length() Returns the usual length of a month. month_name() Returns "January", etc. rom_bios_date() Returns the ROM BIOS date. set_date_format_default() Sets up the default date format. set_system_date() Sets the system date. weekdays_in_date_range() & weekdays_in_date_range_c() Returns number of weekdays in time period. weekdays_in_month() & weekdays_in_month_c() Returns number of weekdays in given month. weekdays_in_year() & weekdays_in_year_c() Returns number of weekdays in given year. yeartoa() Converts year to string with commas. 3.2 Time functions Introduction get_system_time() Gets the system time. set_system_time Sets the system time. set_time_format_default() Sets default time format values. time_elapsed() Returns time elapsed. time_elapsed_this_decade() Returns time elapsed this decade. time_to_str() Converts a time to a string. time_valid() Reports if a time is valid. 3.3 String functions Introduction admissible_chars() & admissible_chars_f() Ascertains whether a string consists only of specified characters. atofp() Converts a string to a far pointer. capitalize() & capitalize_f() Capitalizes words in a string. char_at() & char_at_f() Returns index in a string of a byte. common() & common_f() Tells if two strings have a byte in common. double_char() & double_char_f() Ascertains whether a double character occurs in a string. elim_chars() & elim_chars_f() Eliminates characters from a string. elim_except() & elim_except_f() Eliminates all characters from a string except specified characters. elim_spaces() & elim_spaces_f() Eliminates spaces from a string. final_char() & final_char_f() Returns a pointer to the final byte of a string. final_null() & final_null_f() Returns a pointer to the final null of a string. is_string_of() & is_string_of_f() Ascertains if a string consists entirely of a specified character. lstrcpy() & lstrcpy_f() Limited string copy. ltrim() & ltrim_f() Left trims spaces from a string. ltrim_chr() & ltrim_chr_f() Left trims bytes from a string. make_null() & make_null_f() Makes a string into a null strng. num_occurrences() & num_occurrences_f() Counts the number of occurrences of a byte in a string. ordinal_suffix() Returns the ordinal suffix for a number. overlay_str() & overlay_str_f() Overlays one string on another. overlay_str_n() & overlay_str_n_f() Overlays a specified number of bytes from one string on another. pad_on_left() & pad_on_left_f() Pads a string on the left. pad_on_right() & pad_on_right_f() Pads a string on the right. precedes() & precedes_f() Ascertains if a specified character precedes another in a string. replace_char() & replace_char_f() Replaces a character in a string with another. replace_multiple_char() & replace_multiple_char_f() Replaces multiple characters in a string with others. rtrim() & rtrim_f() Right trims spaces from a string. rtrim_chr() & rtrim_chr_f() Right trims bytes from a string. skip_chars() & skip_chars_f() Skips specified characters in a string. sltoa_commas() Converts a signed long to a string with commas. spaces() & spaces_f() Makes a string of spaces. strcat_f() Concatenates two far strings. strchr_f() Returns a far pointer to a specified byte in a far string. strchr_n() & strchr_n_f() Returns a pointer to the nth occurrence of a byte in a string. strcmp_f() Compares two far strings. strcpy_f() Copies a far string. string() & string_f() Makes a string of specified bytes. strip_number() & strip_number_f() Strips a number string of extraneous characters. strlen_f() Returns the length of a far string. strlwr_f() Converts a far string to lower case. strrchr_f() Returns a pointer to the last occurrence of a specified character in a far string. strrchr_n() & strrchr_n_f() Returns a pointer to the nth-last occurrence of a specified character in a string. strset_f() Sets a far string to a byte value. strupr_f() Converts a far string to upper case. str_trunc() & str_trunc_f() Truncates a string to a given length. substr() & substr_f() Copies a substring. substr_at() & substr_at_f() Ascertains the position of a string in another string. trim() & trim_f() Trims leading and trailing spaces. trim_chr() & trim_chr_f() Trims leading and trailing bytes. tstrcpy() & tstrcpy_f() Terminated string copy. ultoa_commas() Converts an unsigned long to a string with commas. 3.4 Disk functions Introduction bios_disk_present() Checks whether a disk is present in a given drive. bios_disk_read() & bios_disk_read_f() Reads data from a disk. bios_disk_reset() Resets the disk controller. bios_disk_status() Returns disk operation status code. bios_disk_verify() Verifies data on a disk. bios_disk_write() & bios_disk_write_f() Writes data to a disk. disk_free_space() Ascertains free space on a disk. disk_type() Ascertains type of disk in a specified drive. drive_type() Ascertains type of disk drive. get_disk_free() Returns information about free space on a disk. get_drive() Gets the current drive. get_drive_parameter_block() Reads the drive parameter block data for a given drive. high_drive() Returns highest valid drive letter. last_drive_used() Checks whether first floppy drive last accessed as A: or as B: num_floppy_drives() Number of floppy disk drives. num_hard_drives() Number of hard disk drives. set_drive() Sets the current drive. valid_drive() Checks if a drive letter is valid. 3.5 Directory functions Introduction create_path() Creates a subdirectory path. create_subdirectory() & create_subdirectory_f() Creates a subdirectory. file_path() & file_path_f() Gets info on path and file. get_directory() & get_directory_f() Gets the current directory. make_path() & make_path_f() Composes a path. normalize_path() & normalize_path_f() Converts path to normal form. same_path() & same_path_f() Ascertains if two paths are the same. set_directory() & set_directory_f() Sets the current directory. split_path() & split_path_f() Decomposes a path. 3.6 File functions Introduction atod_array() & atod_array_f() Reads double precision floating point values from a file into an array. atoi_array() & atoi_array_f() Reads integer values from a file into an array. construct_output_filenames() & construct_output_filenames_f() Converts a list of file names to another list of file names in accordance with file name patterns. delete_files() & delete_files_f() Deletes files satisfying a file path specification and an attribute specification. file_exists() & file_exists_f() Ascertains if a file exists. file_size() & file_size_f() Gets a file's size. file_type() Gets a file's type. get_fh_date_time() Gets the date and time stamps for a file opened with a particular file handle. get_file_date_time() Gets the date and time stamps for a file. get_input_output_files() Parses the command line and constructs a list of input files and a list of output files. make_file_name() Makes a file name conforming to a pattern. make_new_file_name() Makes a file name, not already in use, conforming to a pattern. num_lines_in_file() Counts the number of lines in a text file. num_matching_files() Gets the number of files matching a given file and attribute specification. open_new_buffered_file() Opens a new file for buffered I/O. open_new_unbuffered_file() Opens a new file for unbuffered I/O. overwrite_file() Overwrites a file. read_directory() & read_directory_f() Reads the contents of a subdirectory into an array. read_f() Reads from a file into a far memory buffer. save_values_in_exe() Saves values in an .EXE file. set_fh_date_time() Sets the date and time stamps for a file opened with a particular file handle. set_file_date_time() & set_file_date_time_f() Sets the date and time stamps for a file. write_f() Writes to a file from a far memory buffer. 3.7 Print spooler functions Introduction print_spool_cancel_all() Cancels all files in the print queue. print_spool_cancel_file() & print_spool_cancel_file_f() Cancels a file in the print queue. print_spool_end_hold() Ends a hold on the spooler. print_spool_hold() Suspends the print spooler. print_spool_install() Installs the print spooler. print_spool_status() Reports on status of the print spooler. print_spool_submit_file() & print_spool_submit_file_f() Submits a file to the print spooler. 3.8 Other printer functions Introduction eject_page() Ejects a page. num_printers() Returns the number of printers installed. printer_init() Initializes a parallel printer. printer_ready() Tests if a parallel printer is ready. print_char() Sends a byte to a parallel printer. print_file() Prints a text file with some formatting. print_screen() Dumps the screen to the printer. 3.9 Other functions Introduction dos_version() Reports DOS version. gets_n() Gets a limited string from the keyboard. input_redirected() Detects redirection of input. math_coprocessor() Reports presence of a math coprocessor. output_redirected() Detects redirection of output. reboot() Causes system reboot. swap() & swap_f() Swaps values of two variables. toolkit_version_number() Reports the library version number. Chapter 4: The Demonstration Programs (a) CALCONV (b) DATEFORM (c) NWEEKDAY (d) TIMEFORM (e) DSKPARAM (f) CURRDIR (g) SPLIT_P (h) DIR_ATTR (i) SETFDATE (j) COMPARE (k) NUMLINES (l) PR_SPOOL (m) ALL_DRVS (n) FINAL (o) TIMER (p) DISKTYPE (q) MAKE&DEL (r) SAVEVALS (s) FILETYPE (t) MCDEMO Appendix I: Memory Models Appendix II: The Julian and the Gregorian Calendars Appendix III: Listings of the Header Files (a) L_TYPEDF.H (b) L_AUXSTR.H (c) L_DATE.H (d) L_TIME.H (e) L_STR.H (f) L_DISK.H (g) L_DIR.H (h) L_FILE.H (i) L_PRINT.H (j) L_MISC.H Appendix IV: Index of Functions