/* *********************************************************
 * *                                                       * 
 * *                Configuration Library                  * 
 * *     RTDISP_LOAD - Load Rtdisp Information From file   * 
 * *                                                       * 
 * *********************************************************
 * File: libs/config/rtdisp_load.c
 *
 *                      COPYRIGHT (c) 2003  BY 
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.  
 * 
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED. 
 */     
#include <stdio.h>
#include <string.h>

#include "sigtypes.h"
#include "sigversion.h"
#include "setup.h"
#include "config_lib.h"

/* =================================================================== 
 * This subroutine reads the saved values from the setup file.
 */
MESSAGE RtdispLoadSetup
( const char *sRemoteHostname_a,
  volatile struct rtdisp_setup *pRtdispSetup_a )
{
  memset( (void *)pRtdispSetup_a, 0, sizeof(*pRtdispSetup_a) ) ;

  return( lim_loadFile( sRemoteHostname_a, "setup_rtdisp.conf", "rtdisp_setup",
			pRtdispSetup_a, setup_limits ) ) ;
}

/* =================================================================== 
 * This subroutine writes new values to the dsp file. 
 */
MESSAGE RtdispSaveSetup
( const char *sRemoteHostname_a, 
  volatile const struct rtdisp_setup *pSetup_a )
{
  struct rtdisp_setup Setup = *pSetup_a ;

  strncpy( Setup.sVersion, IRIS_VERSION, 8 ) ; Setup.sVersion[7] = '\0' ;

  return( lim_saveFile( sRemoteHostname_a, "setup_rtdisp.conf", "rtdisp_setup",
			&Setup, setup_limits ) ) ;
}

