/*  @file pmConfigMask.h
 *  @brief Mask configuration functions
 *
 *  @author Paul Price, IfA
 *
 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2008-07-17 20:37:20 $
 *  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, const psMetadata *header);

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

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

#endif
