#include <stdio.h>
#include "grib.h"	/* all gribs structs */
#include "input.h"	/* GEOM+IN, DATA+INPUT, USER_INPUT */

#ifndef GRIB_FUNCS_H

/* check Compiler,  prototypes needed for ANSI-C */

/* 
#  02/21/01 atn: per Valerie Pastor/Louis Hambree
#  to access grib lib from C++ code (close curly bracket off at end) 
*/

/*
#ifdef  __cplusplus
extern "C" {
#endif
*/

#define PROTOTYPE_NEEDED 1
 int  makeMetcFile(GRIB_HDR  *gh1, char *metcPath,
     PDS_INPUT pds, struct grid_desc_sec gds, char *errmsg);
int regridto_minusY_plusX (float *buf, int numrow, int numcol,
    int *HorizFirst, int *xscan, int *yscan, char *errmsg);
int regridto_plusX_minusY (float *buf, int numrow, int numcol, 
    int *HorizFirst, int *xscan, int *yscan, char *errmsg);
char *identifyIJDir(int val);
int EastWestFlip_Jdir (float* buf1,int numrow,int numcol, char *errmsg) ;
int NorthSouthFlip_Jdir(float *buf1,int numrow,int numcol, char *errmsg);
int NorthSouthFlip_Idir(float *data,int numrow,int numcol, char *errmsg);
int EastWestFlip_Idir (float* data,int numrow,int numcol, char *errmsg) ;
int printIdir(float *arr,int ROWS,int COLS,int Xdir,int Ydir,char *errmsg) ;
int printJdir(float *arr,int ROWS,int COLS,int Ydir,int Xdir,char *errmsg) ;
int  make_esri_output(PDS_INPUT, grid_desc_sec, float *, char *);
void longto1char(long, unsigned char *);
void longto2char(long, unsigned char *);
void longto3char(long, unsigned char *);
void longto4char(long, unsigned char *);
int Expand_gribhdr (GRIB_HDR *, long, char *);
int prt_badmsg (GRIB_HDR  *gh, char *errmsg);
int make_grib_log (char *,char *,unsigned long,long,PDS_INPUT,
		grid_desc_sec,BDS_HEAD_INPUT,BMS_INPUT,float *,char *);
int FTP_getfile (char *,char *,char *);
int apply_bitmap (BMS_INPUT *,float **,float,BDS_HEAD_INPUT *,char *);
int create_inpLambert (GEOM_IN,void **,char *);
int create_inpLatlon (GEOM_IN,void **,char *);
void create_inpPDS (DATA_INPUT,USER_INPUT,PDS_INPUT *);
int create_inpPolar  (GEOM_IN,void **,char *);
void display_gribhdr (GRIB_HDR *hdr);
void free_gribhdr (GRIB_HDR **);
void gbyte (char *,unsigned long *,unsigned long *,unsigned long);
void gbyte_quiet (char *,unsigned long *,unsigned long *,unsigned long);
int grib_dec (char *,PDS_INPUT *,grid_desc_sec *,BDS_HEAD_INPUT *,
		BMS_INPUT *,float **,char *);
int grib_enc (DATA_INPUT,USER_INPUT,GEOM_IN,float *,GRIB_HDR *,char *);
float grib_ibm_local(unsigned long ibm_float);
int grib_seek (char *,long *,int,GRIB_HDR *,char *);
int gribgetbds (char *,short,BMS_INPUT *,float **,BDS_HEAD_INPUT *,char *);
int gribgetbms (char *,BMS_INPUT *,int,unsigned long,char *);
int gribgetgds (char *,grid_desc_sec *,char *);
int gribgetpds (char *,PDS_INPUT *,char *);
int gribhdr2file (GRIB_HDR *,char *,char *);
int gribputbds (USER_INPUT,long,short,short,float *,BDS_HEAD_INPUT *,
		GRIB_HDR **,char *);
int gribputgds (GEOM_IN,GDS_HEAD_INPUT *,void **,GRIB_HDR **,char *);
int gribputpds(DATA_INPUT,USER_INPUT,PDS_INPUT *,GRIB_HDR**,char *);
void hdr_print (char *,unsigned char *,int );
void init_dec_struct (PDS_INPUT *,grid_desc_sec *,BMS_INPUT *,BDS_HEAD_INPUT *);
void init_enc_struct (DATA_INPUT *,GEOM_IN *,USER_INPUT *);
int init_gribhdr (GRIB_HDR **,char *);
void init_struct (void *, int);
int inp2Grib_Lambert (void **,LAMBERT *,long *,char *);
int inp2grib_Latlon (void **,LATLON *,long *,char *);
int inp2grib_PDS (PDS_INPUT *,PDS_GRIB **,char *);
int inp2grib_PolarSt (void **,POLAR  *,long *,char *);
int ld_dec_lookup (char *,char *);
int ld_enc_config (char *,USER_INPUT *,char *);
int ld_enc_ffinfo (char *, DATA_INPUT *,char *);
int ld_enc_geomfile (char *,GEOM_IN *,char *);
int ld_enc_ieeeff (char *,float *,int,char *);
int ld_enc_lookup (char *,char *);
int ld_grib_origctrs (char *,char *,char *);
unsigned long grib_local_ibm (double local_float);
void make_default_grbfn (DATA_INPUT,USER_INPUT,char *);
int map_lvl (char *,DATA_INPUT *,float *,float *,char *);
int map_parm (char *,DATA_INPUT *,float *,float *,char *);
int pack_spatial (long *,unsigned short *,float *,float *,
		unsigned char **,short,short,long *,char *);
void prt_inp_struct (PDS_INPUT *,grid_desc_sec *, BMS_INPUT *,
		struct BDS_HEAD_INPUT *,float **);
void upd_child_errmsg( const char *,char *); 

/* 2/21/00 atn: to close off open-curly bracket above */
/*
#ifdef  __cplusplus
 }
#endif
*/



#define GRIB_FUNCS_H
#endif
