DUMP_CDT module routines

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

DUMP_CDT.C - Dump Commodity data

A Q & D to dump CSI & Computrac master and data files to stdout to see what I've got.

Function main
Include file DUMP_CDT.H
Prototype void main( int argc , char **argv )
Remarks Program entry point: expected command line input examples - DUMP_CDT // dump master file in current directory DUMP_CDT a_directory_path // dump master file in given directory DUMP_CDT a_ticker_str // dump ticker data file in the current dir DUMP_CDT dir_path ticker_str // dump ticker data file in given dir

Function cntl_c_handler
Include file DUMP_CDT.H
Prototype void cntl_c_handler( void )
Remarks Catch Cntl C so we can exit via exit() and get a full file flush and close on any open files as well as any local rundown.

Function math_exception_handler
Include file DUMP_CDT.H
Prototype void math_exception_handler( int status_word , int error_type )
Remarks Catch math errors so we can exit via exit() and get a full file flush and close on any open files as well as any local rundown.

Function local_exit
Include file DUMP_CDT.H
Prototype void local_exit( int exit_code )
Remarks Master program exit catcher. All fatal library errors will also come here.

Function set_cmd_line_flags
Include file DUMP_CDT.H
Prototype void set_cmd_line_flags( void )
Remarks Do a sanity test on the user inputed cmd line args.

Function set_f_scaler
Include file DUMP_CDT.H
Prototype void set_f_scaler( void )
Remarks Convert the user scale factor into a float multiplier to use.

Function set_database_flags
Include file DUMP_CDT.H
Prototype void set_database_flags( void )
Remarks Check the current directory and see what kind of master files we find.

Function dump_the_master_file
Include file DUMP_CDT.H
Prototype void dump_the_master_file( char *ticker )
Remarks Called here with a unfindable ticker string "TDF_LTD!" and with the GLOBAL var log_master_2_output_device set to TRUE so the standard library look-up routine lookup_data_file_num( ticker ) will dump all entries in the master file.

Function process_one_data_file
Include file DUMP_CDT.H
Prototype void process_one_data_file( char *ticker_str )
Remarks Read, process (bond conversion &| weekly/monthly compression &| scaling) and output the requested data file.

Function dump_the_data_file_header
Include file DUMP_CDT.H
Prototype void dump_the_data_file_header( char *ticker )
Remarks Dump the CSI or Computrac data file header information, then the output banner line to the output_device in preparation for dumping the data file's data.

Function dump_cpt_data_file_header
Include file DUMP_CDT.H
Prototype void dump_cpt_data_file_header( char *ticker )
Remarks Dump the Computrac/Metastock data file header information.

Function dump_csi_data_file_header
Include file DUMP_CDT.H
Prototype void dump_csi_data_file_header( char *ticker )
Remarks Dump the CSI data file header information.

Function print_data_struct_compact
Include file DUMP_CDT.H
Prototype void print_data_struct_compact( DATA_REC *data_ptr )
Remarks Dump a DATA_REC out to a single line on the output_device.

Function scale_data_rec
Include file DUMP_CDT.H
Prototype void scale_data_rec( DATA_REC *data_ptr )
Remarks Scale all the price fields in the caller's DATA_REC by muliplying them by the user f_scaler value.

Function init_compress_data_struct
Include file DUMP_CDT.H
Prototype void init_compress_data_struct( DATA_REC *data_ptr )
Remarks Initialize all the fields in the DATA_REC that we use for compression caching.

Function add_2_compress_data_struct
Include file DUMP_CDT.H
Prototype void add_2_compress_data_struct( DATA_REC *cmp_data_ptr , DATA_REC *cur_rec_ptr )
Remarks Update the compression structure with the current DATA_REC.

Function calc_mth_idx
Include file DUMP_CDT.H
Prototype int calc_mth_idx( float date )
Remarks Strip the month from a YYMMDD float date and return it as a int.

Function calc_day_of_week_index
Include file DUMP_CDT.H
Prototype int calc_day_of_week_index( float date )
Remarks Get a day of the week index from a YYMMDD float date.

Function compress_day_to_week_or_month
Include file DUMP_CDT.H
Prototype void compress_day_to_week_or_month( DATA_REC *cmp_data_ptr , DATA_REC *cur_rec_ptr )
Remarks Compress the daily data into the user requested size and hit the compress_flush flag when needed.

Function chk_if_1st_arg_is_a_db_path
Include file DUMP_CDT.H
Prototype int chk_if_1st_arg_is_a_db_path( int argc , char *argv[] )
Remarks Check if the first user command line argument is a database path string. If it is, clone it to the GLOBAL var data_path.

Table of Contents Function Index

generated on 08 February 1998 - 14:44:15
© 1998 Tierra del Fuego Ltd.