awips2/ncep/gov.noaa.nws.ncep.viz.tools/AODTLIB/odtgshistory.c
root 9f19e3f712 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 64fa9254b946eae7e61bbc3f513b7c3696c4f54f
2012-01-06 08:55:05 -06:00

60 lines
1.7 KiB
C

/* include file containing all AODT library global variables */
#include "../inc/odtlib.h"
/* include file containing all AODT library variable definitions */
#include "../inc/odtlibdefs-x.h"
/* AODT library function */
extern int aodtv64_readhistoryfile(void);
int aodtv64_gethistoryfile( char *outchar )
/* return history file name to application from AODT library
Inputs : none
Outputs: AODT library history file name
Return : -1 : error reading history file
0 : o.k.
*/
{
int iret;
/* check for valid history file name */
if(strlen(hfile_v64)>0) {
/* set history file name to return variable */
/* memcpy(outchar,hfile_v64,strlen(hfile_v64)); */
strcpy(outchar,hfile_v64);
outchar[strlen(hfile_v64)]='\0'; /* added by CDB */
iret=0;
} else {
iret=-1;
}
return iret;
}
int aodtv64_sethistoryfile( char *inchar )
/* set history file name in AODT library and read history file into AODT library memory
Inputs : history file name
Outputs: none
Return : -1 : error reading history file
11: successful read of history file
*/
{
int iok,iret;
/* assign history file name to AODT library variable */
//printf("NATIVE...000000000000000\n");
strcpy(hfile_v64,inchar);
//printf("NATIVE1111.aodtv64_sethistoryfile...hfile_v64=%s\n", hfile_v64);
hfile_v64[strlen(inchar)]='\0'; /* added by CDB */
//printf("NATIVE222222222...aodtv64_sethistoryfile...hfile_v64=%s\n", hfile_v64);
/* read history file into AODT memory
function will return negative for error, or
positive value for number of successful records read */
iok=aodtv64_readhistoryfile();
/* set return error code */
iret=iok;
if(iok>=0) iret=11;
return iret;
}