
#ifdef GCCOMMON_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

#define  GC_DRAW   1
#define  GC_ERASE  2

#ifdef SIGMET_DSP_LIB_H
#ifdef SIGMET_SETUP_H

EXTERN SINT2  idsp;
EXTERN Dsp    *pdsp;
EXTERN SINT4  isample_size;
EXTERN SINT2  ldspused;
EXTERN SINT2  ldid_something;

EXTERN UINT2 imask_com[8192];
EXTERN FLT4  foverlap, fdifference, fvrc;
EXTERN FLT4  fnoise[2];
EXTERN FLT4  fthresh[2];
EXTERN SINT4 icumvalid[2];
EXTERN SINT4 itestvalid[2];
EXTERN FLT4  filecurve[IANALOG_GCAL_SIZE];
EXTERN FLT4  fcumcurve[IANALOG_GCAL_SIZE];
EXTERN FLT4  ftstgaincurve[IANALOG_GCAL_SIZE];

#endif
#endif

#undef EXTERN

/* Function Prototypes
 */
void gcInitData( void ) ;
MESSAGE gcSaveData( void ) ;

#ifdef SIGMET_DSP_LIB_H
MESSAGE gain_sample_
(Dsp *dsp_a, SINT4 isample_size_a, FLT4 fgain_a, 
 FLT4 *fpower_a, FLT4 fnoise_a[], SINT2 ldsp_used_a, SINT2 lnoise_a) ;

MESSAGE gain_trial
(Dsp *dsp_a, SINT4 isample_size_a, FLT4 fout_a[],
 FLT4 fthresh_a[], FLT4 fnoise_a[], SINT2 ldsp_used_a) ;
#endif

void gain_noisesum_
(SINT4 ibin_count_a, SINT4 isample_size_a, 
 SINT2 *iseries_a, FLT4 fnoise_a[]) ;

void gain_powersum
(SINT4 ibin_count_a, SINT4 isample_size_a,
 SINT2 *iseries_a, FLT4 *fco_a, FLT4 fdc_a[]) ;

void comp
(FLT4 fcum_a[], SINT4 icum_a[], FLT4 fnew_a[], 
 SINT4 inew_a[], FLT4 *foverlap_a, FLT4 *fdiff_a, FLT4 *fmax_a) ;

void gain_merge
(FLT4 rnw_a[], SINT4 inw_a[], FLT4 fcum_a[],
 SINT4 icum_a[], FLT4 fdif_a, SINT4 isize_a) ;

void gain_validate_
(FLT4 fdata_a[], SINT4 isize_a, SINT4 ivalid_a[],
 FLT4 fthresh_a[]) ;

void smooth(FLT4 fdata_a[]) ;

void interpol(FLT4 ray_arg[], SINT4 ilen_arg) ;
