// $Id: pdinrs_set_output.h,v 1.2 2005/03/19 03:32:34 pdi Exp $
//*****************************************************************************/
// Copyright 1998-2022 Stonie R. Cooper, Licensed under the auspices of GPLv3,
// See top-level copyright disclaimer (COPYRIGHT) and license (LICENSE)
//                    Marietta, Georgia.
// File:            pdinrs_set_output.h
// Author:          Stonie R. Cooper, Science Officer, PDI
// Documentation:   NA
// Revision Record: (as follows)
//         Rewritten: 20050114 by Stonie R. Cooper
//                  Established initial file for pdinrs_set_output.h
// Dependencies: pdinrs_set_output.c pdinrs.h
//*****************************************************************************/

#ifndef PDINRS_SET_OUTPUT_H
#define PDINRS_SET_OUTPUT_H

#include <pdinrs_grib2.h>
#include <sys/time.h>
#include <unistd.h>

typedef struct
{
  char dataType[13];
  char parmTableVersion[13];
  char centerID[13];
  char generatingProcess[13];
  char gridID[13];
  char GDSorBMS[13];
  char parameter[13];
  char levelIndicator[13];
  char levelOne[13];
  char levelTwo[13];
  char year[13];
  char month[13];
  char day[13];
  char hour[13];
  char minute[13];
  char forecastTimeUnit[13];
  char periodOne[13];
  char periodTwo[13];
  char timeRangeIndicator[13];
  char numberInAverage[13];
  char numberMissing[13];
  char subCenterID[13];
  char decimalScaleD[13];
} gribHeaderType;

typedef struct
{
  int index;
  int tableSize;
  int maxTableSize;
  grib2TableType g2Tbl[MAXG2TABLESIZE];
} localG2TableType;

char getModelName(const unsigned char *frame, const char *wmo, char *modelName, gribHeaderType *gribStuff, unsigned short int frameSize, char *g2Dir, localG2TableType *g2t);

char *set_output(char *path, 
		char *wmo, char *pil, char *ccbh, char *nth,
		unsigned int sequence_number, unsigned int product_number, unsigned int original_product_number,
		const char *label, unsigned char *frame, unsigned short int frameSize, char *grib2Dir, localG2TableType *g2);

#endif
