/* ********************************************************
 * *                                                      * 
 * *                Configuration Library                 * 
 * *  COLOR_LOAD - Load IRIS Color Information From file  * 
 * *                                                      * 
 * ********************************************************
 * File: libs/config/color_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 site file. 
 */
MESSAGE color_load
( const char *sRemoteHostname_a,
  volatile struct color_setup *pColor_a )
{
  memset( (void *)pColor_a, 0, sizeof(struct color_setup) ) ;

  return( lim_loadFile( sRemoteHostname_a, "setup_color.conf", "color_setup",
			pColor_a, color_limits ) ) ;
}

/* =================================================================== 
 * This subroutine writes new values to the color file. 
 */
MESSAGE color_save
( const char *sRemoteHostname_a,
  volatile const struct color_setup *pColor_a )
{
  struct color_setup ColorSetup = *pColor_a ;

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

  return( lim_saveFile( sRemoteHostname_a, "setup_color.conf", "color_setup",
			&ColorSetup, color_limits ) ) ;
}
