STD_CODE module routines - WIN32

Company Information Software Products TDF Market Reports Download Area take me Home

STD_CODE.C - STanDard CODE routines

This module is the home for all user-interface, standard product routines.

Function my_fprintf
Include file STD_CODE.H
Prototype void my_fprintf( char *out_str , int start_col )
Remarks Hook back to here for all product output, this gives us the chance to play with the output before dumping to the output_device (out_str is expected to be ready to go).

Function expand_tabs_in_str_2_spaces
Include file STD_CODE.H
Prototype void expand_tabs_in_str_2_spaces( int tab , int start_col , char *src , char *dest )
Remarks Remove hardware tabs and replace/expand to spaces for consistent displays.

Function _strtime
Include file STD_CODE.H
Prototype void _strtime( char *time_buff )
Remarks These are useful little Microsoft routines that TURBOC didn't support. Warning - you will probably need to define the environment variable TZ (for Time Zone). Look up the routine tzset() in your C manual for more info.

Function _strdate
Include file STD_CODE.H
Prototype void _strdate( char *date_buff )
Remarks These are useful little Microsoft routines that TURBOC didn't support.

Function dump_copyright_notices
Include file STD_CODE.H
Prototype void dump_copyright_notices( char *begin_str )
Remarks Build and dump a copyright banner with a date string in column 72 to the output_device (& maybe stdout). If you write a program for distribution you MUST change this banner to your name or company name.

Function compress_cmd_ln
Include file STD_CODE.H
Prototype void compress_cmd_ln( char *cmd_ln )
Remarks Take the raw MSDOS user command line and grab the program_path and the target_drive from the 1st argument. If the user cmd_ln is longer than 70 characters, copy and drop the program_path from the cmd_ln.

Function get_drive_num_from_str
Include file STD_CODE.H
Prototype int get_drive_num_from_str( char *program_path_str )
Remarks Grab the drive code off from a program_path and return as number for BIOS calls.

Function display_last_W32_error
Include file STD_CODE.H
Prototype void display_last_W32_error( void )
Remarks Throw up a MessageBox with the last WIN32 error.

Function report_fatal_error
Include file STD_CODE.H
Prototype void report_fatal_error( char *err_str )
Remarks Abandon all hope - ye who enter here , Thou shall never return (will hook back to the main programs local_exit()).

Function rpt_debug_msg
Include file STD_CODE.H
Prototype void rpt_debug_msg( char *msg )
Remarks Dump a trace message to stderr if debug_flag set.

Function rpt_msg_n_status
Include file STD_CODE.H
Prototype void rpt_msg_n_status( char *msg , int status )
Remarks Dump a trace message with status value to stderr if debug_flag set.

Function dspy_compile_version
Include file STD_CODE.H
Prototype void dspy_compile_version( int exit_code )
Remarks Report program name & version, which compiler & compile date/time.

Function dump_banner_2_output_device
Include file STD_CODE.H
Prototype void dump_banner_2_output_device( char *comment )
Remarks Dump a banner comment with a timestamp to output_device (& maybe stdout). Also dump program version & compile info, suitable as exit rundown.

Function echo_2_stdout_if_necessary
Include file STD_CODE.H
Prototype void echo_2_stdout_if_necessary( char *important_msg )
Remarks Dump a important msg to the output_device and force to stdout also if output_device != stdout.

Function chk_if_we_are_superuser
Include file STD_CODE.H
Prototype int chk_if_we_are_superuser( void )
Remarks This routine shows a way to allow run-time program privileges in MSDOS which doesn't directly support process privileges. This could be used to remotely turn-on maintenance or debug modes in programs on a customer's box.

Function cmd_ln_args_2_str
Include file STD_CODE.H
Prototype void cmd_ln_args_2_str( char *str , int argc , char **argv )
Remarks Concatenate the program command line arguments into a single string.

Function dump_cmd_ln_2_output_device
Include file STD_CODE.H
Prototype void dump_cmd_ln_2_output_device( char *str )
Remarks A simple add a \n and flush.

Function dump_TS_cmd_ln_2_output_device
Include file STD_CODE.H
Prototype void dump_TS_cmd_ln_2_output_device( char *str )
Remarks Build a nice banner string with a time stamp in column 72.

Function chk_if_help_was_requested
Include file STD_CODE.H
Prototype void chk_if_help_was_requested( void )
Remarks If the help_flag is set - use OLM to display the program's doc file.

Function dspy_video_buffered_data
Include file STD_CODE.H
Prototype void dspy_video_buffered_data( void )
Remarks If buffer_video_output is set - use a TTYWIN to display the program report file for the user.

Function run_modal_loop_on_window
Include file STD_CODE.H
Prototype void run_modal_loop_on_window( HWND hTTYWin )
Remarks Run a modal loop with full msg dispatch on the user's window.

Function my_tmpnam
Include file STD_CODE.H
Prototype void my_tmpnam( char *file_path , char *file_extension , char *valid_tmpnam )
Remarks A wrapped routine for tmpnam with extra's. Will build a full final path file name and verify that the new file doesn't exist. Also include the period in the passed in file_extension string (if you want one).

Function olm_a_file
Include file STD_CODE.H
Prototype void olm_a_file( char *file_name )
Remarks A simple wrapped routine for OLM file viewing from inside a program.

Function string_copy
Include file STD_CODE.H
Prototype char * string_copy( char *str )
Remarks This a functional clone of the normal C library function strdup, except this one uses the wrapped version of calloc().

Function calc_avg
Include file STD_CODE.H
Prototype float calc_avg( float total , int divisor )
Remarks A Q & D because MSC is unforgiving about divides by zero.

Function calc_percentage
Include file STD_CODE.H
Prototype float calc_percentage( int total , int count )
Remarks A Q & D because MSC is unforgiving about divides by zero.

Table of Contents Function Index

generated on 22 September 1998 - 12:55:40
© 1998 Tierra del Fuego Ltd.