/*  @file pmConfigMask.h
 *  @brief Mask configuration functions
 *
 *  @author Paul Price, IfA
 *
 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2008-07-15 20:25:00 $
 *  Copyright 2007 Institute for Astronomy, University of Hawaii
 */

#ifndef PM_CONFIG_MASK_H
#define PM_CONFIG_MASK_H

#include <pslib.h>
#include <pmConfig.h>

#define PM_MASKS_RECIPE "MASKS"

/// @addtogroup Config Configuration System
/// @{

/// Return a mask value given a list of symbolic names
///
/// The mask values are derived from the MASKS recipe
psMaskType pmConfigMaskGet(const char *masks, ///< List of symbolic names, space/comma delimited
                        const pmConfig *config ///< Configuration
                        );

bool pmConfigMaskSet(const pmConfig *config, const char *maskName, psMaskType maskValue);

// replace the named masks in the recipe with values in the header:
// replace only the names in the header in the recipe
bool pmConfigMaskReadHeader (pmConfig *config, psMetadata *header);

// write the named mask bits to the header
bool pmConfigMaskWriteHeader (pmConfig *config, psMetadata *header);

bool pmConfigMaskSetBits (psMaskType *outMaskValue, psMaskType *outMarkValue, pmConfig *config);

#endif
