home *** CD-ROM | disk | FTP | other *** search
- extern BYTE
-
- readf, /* flag for necessity of getting files from disk */
- pth_str [81], /* holds current path */
- r_buff [256], /* small buffer - misc tasks */
- f_buff [10241], /* large buffer - read/write records */
- files_loaded; /* number DATAMAGE files currently open */
-
- typedef struct /* structure holding field definitions */
- {
- BYTE name [27]; /* name of field */
- BYTE type; /* 0=date 1=string 2=numeric 3=dollar */
- BYTE length; /* length of field */
- BYTE spare; /* explained below */
- BYTE abs; /* absolute field number */
- WORD offset; /* offset of field in record */
- } fdef;
-
- /* definition of fdef.spare:
-
- switch (fdef.type)
- {
- case 0: defines date field format: 0=mm/dd/yy 1=dd/mm/yy
- case 1: defines index mode for string: 0=none 1=unique 2=normal 3=cross
- case 2: defines number of decimals to maintain in numeric field
- case 3: always 2, defines precision of dollar format field
- } */
-
- typedef struct /* structure holding loaded datafiles */
- {
- /* NOMINCLATURE */
-
- BYTE dir [51]; /* directory name holding file */
- BYTE des [41]; /* description of loaded file */
-
- /* NUMERIC DATA */
-
- DWORD rcd_len; /* length of record in bytes */
- WORD num_rcds; /* number of records in file */
- WORD num_flds; /* number of fields in file */
-
- /* array of far pointers to type fdef (defined above) */
-
- fdef far * key [200];
-
- /* data relating to idnexes and searches of same */
-
- BYTE indexes; /* holds number of indexed fields */
- BYTE indexed_fields [5]; /* holds numbers of indexed fields */
-
- BYTE unique_field; /* 1 = unique fields 2=no */
-
- BYTE cross_fields; /* number of cross-indexed fields */
- BYTE cross_cntr; /* number of cross-indexed fields selected */
-
- BYTE write_sw; /* 0=no write to file, 1=write record */
- DWORD rw_sw; /* 0=not ready for read
- 1=ready after (row * 7800) + col */
-
- BYTE i_case [5]; /* 1=ignore case/spacing in search 0=no */
- SWORD index_results [5]; /* holds index of record being checked */
- SWORD disk_index [5]; /* holds indexs read fron disk - buffer */
-
- /* LOAD INFORMATION */
-
- WORD sequence; /* file sequence# of record in buffer */
- WORD next_rcd; /* sequence of next record */
- WORD r_number; /* record number of record in buffer */
-
- BYTE m_name [53]; /* main datafile path/filename */
- BYTE i_name [53]; /* index file path/filename */
- BYTE c_name [53]; /* control file path/filename */
-
- /* FILE POINTERS TO THE THREE ASSOCIATED FILES */
-
- FILE * main; /* pointer for main datafile buffer */
- FILE * indx; /* pointer for index file buffer */
- FILE * ctrl; /* pointer for control file buffer */
-
- /* MARKER FILE INFORMATION */
-
- BYTE mkr_active; /* 0=process file, 1=process marker */
-
- FILE * marker; /* pointer for marker file buffer */
-
- WORD m_num_rcds; /* holds number of records in mkr */
-
- WORD m_next_rcd; /* holds next record seq in marker */
-
- BYTE m_rcd_len; /* holds record length in marker */
-
- BYTE b_levels; /* holds number of search levels */
-
- SBYTE bs_sw; /* binary search switch
- -10 = inactive
- -2 = search counter 2
- -1 = search counter 1
- 0 = search record numbers
- 1 = search disk data */
-
- BYTE asf [8] [3]; /* holds details of current binary order
-
- pos 0 = target field + 1
-
- pos 1 = format:
- 1 = nromal
- 2 = name
- 3 = string as numeric
-
- pos 2 = ignore case/spacing
- (not recorded - user selected)
- 0 = no, 1 = yes */
-
- BYTE counter_sw; /* 0= no counters in marker,
- 1= counter 1 in marker,
- 2= counter 2 in marker,
- 3= both */
-
- SBYTE c1_sw; /* -1= counter is inactive,
- 0-8=decimal precision,
- 9=no rounding */
-
- double c1_val; /* value of counter 1, if any */
-
- SBYTE c2_sw; /* as above */
-
- double c2_val; /* value of counter 2, if any */
-
- /* BUFFER */
-
- BYTE far * buff; /* buffer for this file */
- } file_info;
-
- extern file_info fi [];
-
- /* FUNCTIONS INCLUDED IN MAGEISAM.C */
-
- void far decoder ();
- SWORD far index_field (BYTE * target);
-
- void far set_field (BYTE, BYTE, BYTE, BYTE *);
- void far get_field (BYTE, WORD, BYTE, BYTE *);
- BYTE far read_field (BYTE, WORD, WORD, BYTE *);
- BYTE far write_field (BYTE, WORD, WORD, BYTE *);
-
- BYTE far index_MAGErecord (BYTE);
- BYTE far find_MAGErecord (BYTE, WORD, BYTE, WORD);
- BYTE far find_MAGErecord_nmbr (BYTE, WORD);
- BYTE far access_MAGE_record (BYTE, BYTE, BYTE);
-
- BYTE far write_MAGErcd (BYTE);
- BYTE far read_MAGErcd (BYTE, WORD);
- BYTE far read_next_rcd (BYTE, BYTE *);
-
- void far print_MAGE_record (BYTE);
-
- BYTE far search_MAGE_files (BYTE, BYTE);
- BYTE far vs_MAGE_recrd (BYTE, BYTE, BYTE *);
-
- BYTE far get_files (BYTE *, BYTE);
- BYTE far select_datafile ();
-
- BYTE far open_file (BYTE);
- void far close_file (BYTE);
-
- BYTE far ready_files (SBYTE);
- BYTE far get_next_rno (BYTE);
-
- BYTE far show_files (BYTE);
- BYTE far show_datafiles (BYTE);
- BYTE far show_fields (BYTE, BYTE);
- BYTE far show_menu ();
-
- void far fill_window (BYTE, SWORD *, SWORD *, BYTE);
- BYTE far work_window (BYTE, SWORD *, SWORD *, BYTE);
- void far window_line (BYTE, BYTE, BYTE, BYTE);
-
- WORD far get_curr_fno (BYTE, WORD);
-
- BYTE far read_next_rcd (BYTE, BYTE *);
- BYTE far get_cntr (BYTE, BYTE, double *, BYTE *);
- BYTE far load_marker (BYTE, BYTE *);
-
- void far ipt_box (BYTE, BYTE, BYTE, BYTE,
- BYTE, BYTE, BYTE *);
-
- WORD far minpt (BYTE, BYTE, BYTE *);
- /*-------------------------------------------------------------------------*/
-
-
-