IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2004, 10:21:29 AM (22 years ago)
Author:
eugene
Message:

mods to psMetadataType, psType, and psMetadataParseConfig

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibSDRS.tex

    r2007 r2008  
    1 %%% $Id: psLibSDRS.tex,v 1.129 2004-10-07 19:55:20 eugene Exp $
     1%%% $Id: psLibSDRS.tex,v 1.130 2004-10-07 20:21:29 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    12321232    PS_TYPE_C32,                        ///< Complex numbers consisting of floats
    12331233    PS_TYPE_C64,                        ///< Complex numbers consisting of doubles
    1234     PS_TYPE_STR,                        ///< String
    1235     PS_TYPE_BOOL,                       ///< Boolean
    1236     PS_TYPE_OTHER                       ///< Not supported for arithmetic
    12371234} psElemType;
    12381235\end{verbatim}
     
    12591256        psC64 C64;                      ///< double complex value entry
    12601257    } data;
    1261 } p_psScalar;
     1258} psScalar;
    12621259\end{verbatim}
    12631260
     
    36173614        psF32 F32;                      ///< floating value
    36183615        psF64 F64;                      ///< double value
    3619         void *void;                     ///< other type
     3616        void *data;                     ///< other type
    36203617    } data;                             ///< value of metadata
    36213618    char *comment;                      ///< optional comment ("", not NULL)
     
    36403637    PS_META_F32,                        ///< float (.F32)
    36413638    PS_META_F64,                        ///< double (.F64)
    3642     PS_META_STR,                        ///< string (.void)
    3643     PS_META_IMG,                        ///< image (.void)
    3644     PS_META_JPEG,                       ///< JPEG (.void)
    3645     PS_META_PNG,                        ///< PNG (.void)
    3646     PS_META_ASTROM,                     ///< astrometric coefficients (.void)
    3647     PS_META_UNKNOWN,                    ///< other (.void)
     3639    PS_META_STR,                        ///< string (.data)
     3640    PS_META_MATH,                       ///< psScalar, psVector, psImage (.data)
     3641    PS_META_JPEG,                       ///< JPEG (.data)
     3642    PS_META_PNG,                        ///< PNG (.data)
     3643    PS_META_ASTROM,                     ///< astrometric coefficients (.data)
     3644    PS_META_UNKNOWN,                    ///< other (.data)
    36483645    PS_META_NTYPE                       ///< Number of types; must be last
    36493646} psMetadataType;
     
    38263823
    38273824\begin{verbatim}
    3828 int psMetadataParseConfig(psMetadata *md, const char *filename, bool overwrite);
     3825psMetadata *psMetadataParseConfig(psMetadata *md, int *nFail, const char *filename, bool overwrite);
    38293826\end{verbatim}
    38303827
     
    38323829file, \code{filename}, \code{psMetadataParseConfig} shall parse the
    38333830configuration file, placing the contained key/type/value/comment quads
    3834 into the metadata, and returning the number of lines that failed to
    3835 parse.  Multiple specifications of a key that haven't been declared
    3836 (see below) are overwritten if and only if \code{overwrite} is
    3837 \code{true}.
    3838 
    3839 If the metadata container is \code{NULL}, it shall be allocated.  If
    3840 the file specified by \code{filename} is not readable, then the
    3841 function shall generate an error and return \code{-1}.
     3831into the metadata, and returning a pointer to the metadata structure.
     3832The number of lines that failed to parse is returned in \code{nFail}.
     3833Multiple specifications of a key that haven't been declared (see
     3834below) are overwritten if and only if \code{overwrite} is \code{true}.
     3835If the metadata container is \code{NULL}, it shall be allocated. 
     3836
     3837On error, the function shall return \code{NULL}.
    38423838
    38433839The configuration file shall consist of plain text with
     
    38933889by specifying the key at the start of the line (possibly preceded by
    38943890whitespace) and specifying the type as a ``multiple symbol'', which we
    3895 choose to be an asterisk, \code{*}.  Everything else on the line shall
    3896 be ignored.  A warning shall be produced when a key which has not been
     3891choose to be an asterisk, \code{*}.  No other data may be provided on
     3892this line, though a comment, preceeded by the comment marker, is
     3893valid.  A warning shall be produced when a key which has not been
    38973894specified to be non-unique is repeated; in this case, the former value
    38983895shall be overwritten if \code{overwrite} is \code{true}, otherwise the
     
    39043901(including those that were ignored because \code{overwrite} is
    39053902\code{false}, and any other parsing problems, but not including blank
    3906 lines and comment lines) shall be returned by the function.
     3903lines and comment lines) shall be returned by the function in the
     3904argument \code{nFail}.
    39073905
    39083906Here are some examples of lines of a valid configuration file:
     
    39173915@primes U8  2,3 5 7,11,13 17 #   These are prime numbers
    39183916
    3919 comment * The rest of this line is ignored, but `comment' is set to be non-unique
     3917comment * # This is a comment in the ITEM_SET item
    39203918comment STR This
    39213919comment STR     is
Note: See TracChangeset for help on using the changeset viewer.