STD_CODE.C
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
|
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 OLM to display the program report file
for the user.
|
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( UINT total , UINT count )
|
Remarks
|
A Q & D because MSC is unforgiving about divides by zero.
|
Function
|
direct_disk_read_fe
|
Include file
|
STD_CODE.H
|
Prototype
|
int direct_disk_read_fe(
char *buff , int drive , int start_sector , int num_of_sectors )
|
Remarks
|
Front-end the the Int 25h direct_disk_read. The front-end supports
status checking, read retrys & device resets.
This is the Microsoft version.
|
Function
|
direct_disk_read_fe
|
Include file
|
STD_CODE.H
|
Prototype
|
int direct_disk_read_fe(
char *buff , int drive , int start_sector , int num_of_sectors )
|
Remarks
|
And this is the TurboC version.
|
Function
|
init_scrolled_region
|
Include file
|
STD_CODE.H
|
Prototype
|
void init_scrolled_region( int l_row , int l_col , int r_row , int r_col )
|
Remarks
|
Initialize the module static scroll variables. The region is defined by
the upper left & lower right corners.
|
Function
|
update_scrolled_region
|
Include file
|
STD_CODE.H
|
Prototype
|
void update_scrolled_region( char *str )
|
Remarks
|
Dump the user string into the previous init-ed scrolled region and
scroll it if necessary.
|
Function
|
advance_scrolled_region
|
Include file
|
STD_CODE.H
|
Prototype
|
void advance_scrolled_region( void )
|
Remarks
|
Advance the scroll_ptr through the scrolled region and scroll data out up
the top.
|
Function
|
loop_opt
|
Include file
|
STD_CODE.H
|
Prototype
|
#pragma loop_opt( off )
|
Remarks
|
|
Function
|
millisecond_delay
|
Include file
|
STD_CODE.H
|
Prototype
|
void millisecond_delay( UINT delay )
|
Remarks
|
A QND cpu timewaster.
|
Function
|
loop_opt
|
Include file
|
STD_CODE.H
|
Prototype
|
#pragma loop_opt( on )
|
Remarks
|
|
Table of Contents
Function Index
generated on 08 February 1998 - 14:42:11
© 1998 Tierra del Fuego Ltd.
|