/* *********************************************************
 * *                                                       * 
 * *                Configuration Library                  * 
 * *  ANT_LOAD - Load Antenna (RCP) Information From file  * 
 * *                                                       * 
 * *********************************************************
 * File: libs/config/ant_load.c
 *
 *         COPYRIGHT (c) 1988, 1989, 1994, 1997, 1999, 2000  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 old values from the antenna file. 
 */
MESSAGE ant_load_setup
( const char *sRemoteHostname_a, 
  volatile struct ant_manual_setup *pAntSetup_a )
{
  memset( (void *)pAntSetup_a, 0, sizeof(struct ant_manual_setup) ) ;

  return( lim_loadFile( sRemoteHostname_a, "setup_ant.conf", "ant_manual_setup",
			pAntSetup_a, setup_limits ) ) ;
}

/* =================================================================== 
 * This subroutine writes new values to the antenna file. 
 */
MESSAGE ant_save_setup
( const char *sRemoteHostname_a, 
  volatile const struct ant_manual_setup *pAntSetup_a )
{
  struct ant_manual_setup AntSetup = *pAntSetup_a ;

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

  return( lim_saveFile( sRemoteHostname_a, "setup_ant.conf", "ant_manual_setup",
			&AntSetup, setup_limits ) ) ;
}
