/*****************************************************************************
*                                                                            *
*      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 scale_included
#define scale_included
#ifndef dbhost_included
#include "dbhost.h"            /* PROTOTYPE_ALLOWED */
#endif
#ifndef dbhost_included
#include "dbext.h"             /* FLOAT, etc. */
#endif
#if PROTOTYPE_ALLOWED
int SCALE_FLOAT_TO_BYTE  (BYTE byte_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_UBYTE (UBYTE ubyte_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_SHORT (SHORT short_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_USHORT(USHORT ushort_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_LONG  (LONG long_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_ULONG (ULONG ulong_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_FLOAT (FLOAT float2_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
int SCALE_FLOAT_TO_DOUBLE(DOUBLE double_array[], FLOAT float_array[],
                          FLOAT *scale, FLOAT *offset, unsigned int *nv,
                          unsigned int *nbad);
extern int (*scale[])(void *out_array, FLOAT in_array[], FLOAT *scale,
   FLOAT *offset, unsigned int *nv, unsigned int *nbad);
#else
int SCALE_FLOAT_TO_BYTE  ();
int SCALE_FLOAT_TO_UBYTE ();
int SCALE_FLOAT_TO_SHORT ();
int SCALE_FLOAT_TO_USHORT();
int SCALE_FLOAT_TO_LONG  ();
int SCALE_FLOAT_TO_ULONG ();
int SCALE_FLOAT_TO_FLOAT ();
int SCALE_FLOAT_TO_DOUBLE();
extern int (*scale[])();
#endif
#endif /* ifndef scale_included */

