#include "dbinc.h"

#if (PROTOTYPE_ALLOWED)
char *add_block_file(FILE_NAME_TYPE fn_old_block);
int convert_block_file(char *infile, char *outfile);
int convert_block_hdr(void);
int convert_data_list(void);
int convert_profile_dir(void);
int convert_block_var_data(void);
int convert_profiles(void);
#else
char *add_block_file();
int convert_block_file();
int convert_block_hdr();
int convert_data_list();
int convert_profile_dir();
int convert_block_var_data();
int convert_profiles();
#endif

typedef struct
{
   CHAR  name[20],
         units[12];
   FLOAT offset,
         scale;
   UBYTE value_type,
         access_type;
   ULONG access_0,
         access_1;
} OLD_DATA_LIST_ENTRY_TYPE;

typedef struct
{
   LONG  ofs;
   ULONG time;
} OLD_PROFILE_DIR_0_ENTRY_TYPE;

typedef struct
{
   LONG  ofs;
   ULONG time;
   SHORT depth1,
         depth2;
   LONG  lon,
         lat;
} OLD_PROFILE_DIR_1_ENTRY_TYPE;

typedef struct
{
   LONG  ofs;
   ULONG time;
   SHORT depth1,
         depth2;
} OLD_PROFILE_DIR_2_ENTRY_TYPE;

typedef struct
{
   LONG  ofs;
   ULONG time;
   SHORT depth1,
         depth2;
   LONG  lon,
         lat;
} OLD_PROFILE_DIR_3_ENTRY_TYPE;

typedef struct
{
   USHORT ofs,
          nbytes;
} OLD_DATA_DIR_ENTRY_TYPE;
          
#define OLD_BLOCK_HDR_SIZE 160
#define OLD_DATA_LIST_ENTRY_SIZE sizeof(OLD_DATA_LIST_ENTRY_TYPE)
#define OLD_DATA_DIR_ENTRY_SIZE sizeof(OLD_DATA_DIR_ENTRY_TYPE)
