/*****************************************************************************
*                                                                            *
*      COMMON OCEANOGRAPHIC DATA ACCESS SYSTEM (CODAS)                       *
*                                                                            *
*      WRITTEN BY:  RAMON CABRERA, ERIC FIRING, and JULIE RANADA             *
*                   JOINT INSTITUTE FOR MARINE AND ATMOSPHERIC RESEARCH      *
*                   1000 POPE ROAD  MSB 404                                  *
*                   HONOLULU, HI 96822                                       *
*                                                                            *
*      VERSION:     3.00                                                     *
*                                                                            *
*      DATE:        APRIL 1989                                               *
*                                                                            *
*****************************************************************************/
/*

       FILE:   scale.h

               FLOATING POINT SUPPORT FUNCTIONS

*/
#ifndef dblscale_included
#define dblscale_included
#ifndef dbhost_included
#include "dbhost.h"            /* PROTOTYPE_ALLOWED */
#endif
#ifndef dbhost_included
#include "dbext.h"             /* FLOAT, etc. */
#endif
int SCALE_DOUBLE_TO_BYTE  (void *byte_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_UBYTE (void *ubyte_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_SHORT (void *short_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_USHORT(void *ushort_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_LONG  (void *long_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_ULONG (void *ulong_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_FLOAT (void *float2_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_DOUBLE_TO_DOUBLE(void *double_array, DOUBLE float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
extern int (*dblscale[])(void *out_array, DOUBLE in_array[], FLOAT *scale,
   FLOAT *offset, unsigned int *nv, unsigned int *nbad);

int dbl_struc(double *array, char *structure,
                              char *name,
                              STRUCT_DEF_HDR_TYPE *str_def);

#endif /* ifndef dblscale_included */

