Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 3958)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 3960)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.225 2005-05-18 20:45:01 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.226 2005-05-18 23:07:18 price Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -440,7 +440,7 @@
 %
 \begin{verbatim}
-void *p_psAlloc(size_t size, char *file, int line);
-void *p_psRealloc(void *ptr, size_t size, char *file, int line);
-void p_psFree(void *ptr, char *file, int line);
+void *p_psAlloc(size_t size, const char *file, int line);
+void *p_psRealloc(void *ptr, size_t size, const char *file, int line);
+void p_psFree(void *ptr, const char *file, int line);
 \end{verbatim}
 %
@@ -694,6 +694,6 @@
 %
 \begin{verbatim}
-psReferenceCount psMemGetRefCounter(void *vptr);
-void *psMemIncrRefCounter(void *vptr);
+psReferenceCount psMemGetRefCounter(const void *vptr);
+void *psMemIncrRefCounter(const void *vptr);
 void *psMemDecrRefCounter(void *vptr);
 \end{verbatim}
@@ -819,5 +819,5 @@
 %
 \begin{verbatim}
-void psTrace(char *facil, int myLevel,...);
+void psTrace(const char *facil, int myLevel,...);
 \end{verbatim}
 % 
@@ -1215,5 +1215,5 @@
 
 \begin{verbatim}
-void psAbort(char *name, char *fmt,...);
+void psAbort(const char *name, const char *fmt,...);
 \end{verbatim}
 
@@ -1329,6 +1329,6 @@
 In addition, we specify two functions for working with \code{psScalar} data:
 \begin{verbatim}
-psScalar *psScalarAlloc (psC64 value, psElemType dataType);
-psScalar *psScalarCopy (psScalar *value);
+psScalar *psScalarAlloc(psC64 value, psElemType dataType);
+psScalar *psScalarCopy(const psScalar *value);
 \end{verbatim}
 The first creates a \code{psType}-ed structure from a constant value,
@@ -1432,5 +1432,5 @@
 
 \begin{verbatim}
-psVector *psVectorCopy(psVector *output, psVector *input, psElemType type);
+psVector *psVectorCopy(psVector *output, const psVector *input, psElemType type);
 \end{verbatim}
 
@@ -1565,5 +1565,5 @@
 
 \begin{verbatim}
-psArray *psArrayAdd(psArray *array, int delta, void *value);
+psArray *psArrayAdd(psArray *array, int delta, const void *value);
 \end{verbatim}
 
@@ -1575,5 +1575,5 @@
 
 \begin{verbatim}
-psBool psArrayRemove(psArray *array, psPtr value);
+psBool psArrayRemove(psArray *array, const psPtr value);
 \end{verbatim}
 
@@ -1584,6 +1584,6 @@
 
 \begin{verbatim}
-psBool psArraySet(psArray* in, psU32 position, void* value);
-void* psArrayGet(psArray* in, psU32 position);
+psBool psArraySet(psArray* in, psU32 position, const void* value);
+void* psArrayGet(const psArray* in, psU32 position);
 \end{verbatim}
 
@@ -1600,5 +1600,6 @@
 specification of a comparison function to specify how the objects on
 the list should be sorted.  The motivation is primarily to be able to
-iterate on a sorted list of keys from a hash.
+iterate on a sorted list of keys from a hash.  The \code{array} is
+sorted in-place.
 
 \subsection{Doubly-linked lists}
@@ -1640,5 +1641,5 @@
 
 \begin{verbatim}
-psList *psListAlloc(void *data);
+psList *psListAlloc(const void *data);
 \end{verbatim}
 Create a list.  This function may take a pointer to a data item, or it
@@ -1712,7 +1713,7 @@
 
 \begin{verbatim}
-bool psListAdd(psList *list, int location, void *data);
-bool psListAddAfter(psListIterator *iterator, void *data);
-bool psListAddBefore(psListIterator *iterator, void *data);
+bool psListAdd(psList *list, int location, const void *data);
+bool psListAddAfter(psListIterator *iterator, const void *data);
+bool psListAddBefore(psListIterator *iterator, const void *data);
 \end{verbatim}
 the first function, \code{psListAdd}, adds an entry to the \code{list}
@@ -1761,5 +1762,5 @@
 \begin{verbatim}
 bool psListRemove(psList *list, int location)
-bool psListRemoveData(psList *list, void *data);
+bool psListRemoveData(psList *list, const void *data);
 \end{verbatim}
 A data item may be removed from the list with these functions.  For
@@ -1779,6 +1780,6 @@
 
 \begin{verbatim}
-psArray *psListToArray(psList *list);
-psList  *psArrayToList(psArray *array);
+psArray *psListToArray(const psList *list);
+psList  *psArrayToList(const psArray *array);
 \end{verbatim}
 These two functions are available to convert between the
@@ -1793,5 +1794,6 @@
 specification of a comparison function to specify how the objects on
 the list should be sorted.  The motivation is primarily to be able to
-iterate on a sorted list of keys from a hash.
+iterate on a sorted list of keys from a hash.  The \code{list} is
+sorted in-place.
 
 \subsection{Hash Tables}
@@ -1851,5 +1853,5 @@
 A data item may be added to the hash table with the function:
 \begin{verbatim}
-bool psHashAdd(psHash *table, const char *key, void *data);
+bool psHashAdd(psHash *table, const char *key, const void *data);
 \end{verbatim}
 In this function, the value of the string \code{key} is used to
@@ -1862,5 +1864,5 @@
 The data associated with a given key may be found with the function:
 \begin{verbatim}
-void *psHashLookup(psHash *table, const char *key);
+void *psHashLookup(const psHash *table, const char *key);
 \end{verbatim}
 which returns the data value pointed to by the element associated with
@@ -1875,5 +1877,5 @@
 The function
 \begin{verbatim}
-psList *psHashKeyList(psHash *table);
+psList *psHashKeyList(const psHash *table);
 \end{verbatim}
 returns the complete list of defined keys associated with the
@@ -1881,5 +1883,5 @@
 
 \begin{verbatim}
-psArray *psHashToArray(psHash *hash);
+psArray *psHashToArray(const psHash *hash);
 \end{verbatim}
 This function places the data in a \code{psHash} into a \code{psArray}
@@ -2058,6 +2060,6 @@
 psBitSet *psBitSetSet(psBitSet *myBits, int bit);
 psBitSet* psBitSetClear(psBitSet* inBits, int bit);
-psBitSet *psBitSetOp(psBitSet *outBits, const psBitSet *inBits1, char *operator, const psBitSet *inBits2);
-psBitSet *psBitSetNot(psBitSet *out, psBitSet *in);
+psBitSet *psBitSetOp(psBitSet *outBits, const psBitSet *inBits1, const char *operator, const psBitSet *inBits2);
+psBitSet *psBitSetNot(psBitSet *out, const psBitSet *in);
 bool psBitSetTest(const psBitSet *checkBits, int bit);
 char *psBitSetToString(const pBitSet* bits);
@@ -2809,5 +2811,5 @@
 
 psVector *psImageSlice(psVector *out, 
-                       psVector *coords, 
+                       const psVector *coords, 
                        const psImage *input,
                        const psImage *mask, 
@@ -3263,6 +3265,6 @@
 
 \begin{verbatim}
-psType *psBinaryOp (void *out, void *in1, char *op, void *in2);
-psType *psUnaryOp (void *out, void *in, char *op);
+psType *psBinaryOp(void *out, const void *in1, const char *op, const void *in2);
+psType *psUnaryOp(void *out, const void *in, const char *op);
 \end{verbatim}
 These functions determine the type of the operands on the basis of
@@ -3414,5 +3416,5 @@
 types \code{psF32, psF64}.  Input and output data types should match.
 \begin{verbatim}
-psImage *psMatrixEigenvectors(psImage *out, psImage *in);
+psImage *psMatrixEigenvectors(psImage *out, const psImage *in);
 \end{verbatim}
 \tbd{Should this return an array of vectors?  Specified here as
@@ -3443,5 +3445,5 @@
 psVector *psVectorReal(psVector *out, const psVector *in);
 psVector *psVectorImaginary(psVector *out, const psVector *in);
-psVector *psVectorComplex(psVector *out, psVector *real, psVector *imag);
+psVector *psVectorComplex(psVector *out, const psVector *real, const psVector *imag);
 psVector *psVectorConjugate(psVector *out, const psVector *in);
 psVector *psVectorPowerSpectrum(psVector *out, const psVector *in);
@@ -3503,5 +3505,5 @@
 psImage *psImageReal(psImage *out, const psImage *in);
 psImage *psImageImaginary(psImage *out, const psImage *in);
-psImage *psImageComplex(psImage *out, psImage *real, const psImage *imag);
+psImage *psImageComplex(psImage *out, const psImage *real, const psImage *imag);
 psImage *psImageConjugate(psImage *out, const psImage *in);
 psImage *psImagePowerSpectrum(psImage *out, const psImage *in);
@@ -3915,5 +3917,5 @@
 
 \begin{verbatim}
-bool psMetadataAddItem(psMetadata *md, psMetadataItem *item, int location, int mode);
+bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, int location, int mode);
 bool psMetadataAdd(psMetadata *md, int location, const char *name, int format, const char *comment, ...);
 bool psMetadataAddV(psMetadata *md, int location, const char *name, int format, const char *comment,
@@ -4029,17 +4031,19 @@
 psBool psMetadataAddF64(psMetadata* md, psS32 location, const char* name, const char* comment, psF64 value);
 psBool psMetadataAddList(psMetadata* md, psS32 location, const char* name, const char* comment,
-                         psList* value);
+                         const psList* value);
 psBool psMetadataAddStr(psMetadata* md, psS32 location, const char* name, const char* comment,
                         const char* value);
 psBool psMetadataAddVector(psMetadata* md, psS32 location, const char* name, const char* comment,
-                           psVector* value);
+                           const psVector* value);
 psBool psMetadataAddImage(psMetadata* md, psS32 location, const char* name, const char* comment,
-                          psImage* value);
+                          const psImage* value);
 psBool psMetadataAddHash(psMetadata* md, psS32 location, const char* name, const char* comment,
-                         psHash* value);
+                         const psHash* value);
 psBool psMetadataAddLookupTable(psMetadata* md, psS32 location, const char* name, const char* comment,
-                                psLookupTable* value);
+                                const psLookupTable* value);
 psBool psMetadataAddUnknown(psMetadata* md, psS32 location, const char* name, const char* comment,
-                            psPtr value);
+                            const psPtr value);
+psBool psMetadataAddMetadata(psMetadata* md, psS32 location, const char* name, const char* comment,
+                             const psMetadata* value);
 \end{verbatim}
 
@@ -4478,5 +4482,5 @@
 
 \begin{verbatim}
-    bool psDBCreateTable(psDB *dbh, const char *tableName, psMetadata *md);
+    bool psDBCreateTable(psDB *dbh, const char *tableName, const psMetadata *md);
 \end{verbatim}
 
@@ -4544,5 +4548,5 @@
 
 \begin{verbatim}
-    bool psDBInsertOneRow(psDB *dbh, const char *tableName, psMetadata *row);
+    bool psDBInsertOneRow(psDB *dbh, const char *tableName, const psMetadata *row);
 \end{verbatim}
 
@@ -4552,5 +4556,5 @@
 
 \begin{verbatim}
-    bool psDBInsertRows(psDB *dbh, const char *tableName, psArray *rowSet);
+    bool psDBInsertRows(psDB *dbh, const char *tableName, const psArray *rowSet);
 \end{verbatim}
 
@@ -4573,5 +4577,5 @@
 
 \begin{verbatim}
-    psS64 psDBUpdateRows(psDB *dbh, const char *tableName, psMetadata *where, psMetadata *values);
+psS64 psDBUpdateRows(psDB *dbh, const char *tableName, const psMetadata *where, const psMetadata *values);
 \end{verbatim}
 
@@ -4584,5 +4588,5 @@
 
 \begin{verbatim}
-    psS64 psDBDeleteRows(psDB *dbh, const char *tableName, psMetadata *where);
+    psS64 psDBDeleteRows(psDB *dbh, const char *tableName, const psMetadata *where);
 \end{verbatim}
 
@@ -4657,6 +4661,6 @@
 
 \begin{verbatim}
-char *psFitsGetExtName(const psFits* fits);
-bool psFitsSetExtName(const psFits* fits, const char* name);
+char *psFitsGetExtName(psFits* fits);
+bool psFitsSetExtName(psFits* fits, const char* name);
 \end{verbatim}
 
@@ -4670,5 +4674,5 @@
 
 \begin{verbatim}
-psMetadata *psFitsReadHeader(psMetadata *out, const psFits *fits);
+psMetadata *psFitsReadHeader(psMetadata *out, psFits *fits);
 \end{verbatim}
 Read header data into a \code{psMetadata} structure.  The data is read
@@ -4690,5 +4694,5 @@
 
 \begin{verbatim}
-bool psFitsWriteHeader(psMetadata *output, const psFits *fits);
+bool psFitsWriteHeader(psMetadata *output, psFits *fits);
 \end{verbatim}
 Write metadata into the header of a FITS image file.  The header is
@@ -4734,5 +4738,5 @@
 
 \begin{verbatim}
-bool psFitsWriteImage(psFits *fits, psMetadata *header, const psImage *input, int depth);
+bool psFitsWriteImage(psFits *fits, const psMetadata *header, const psImage *input, int depth);
 \end{verbatim}
 Create a new image based on the dimensions specified for the image and
@@ -4775,5 +4779,5 @@
 
 \begin{verbatim}
-psArray *psFitsReadTableColumn (psFits *fits, char *colname);
+psArray *psFitsReadTableColumn (psFits *fits, const char *colname);
 \end{verbatim}
 This function reads a single column of the table in the extension
@@ -4784,5 +4788,5 @@
 
 \begin{verbatim}
-psVector *psFitsReadTableColumnNum (psFits *fits, char *colname);
+psVector *psFitsReadTableColumnNum (psFits *fits, const char *colname);
 \end{verbatim}
 This function reads a single column of the table in the extension
@@ -4811,5 +4815,5 @@
 
 \begin{verbatim}
-bool psFitsWriteTable(psFits* fits, psMetadata *header, psArray* table); 
+bool psFitsWriteTable(psFits* fits, const psMetadata *header, const psArray* table); 
 \end{verbatim}
 Accepts a \code{psArray} of \code{psMetadata} and writes it to the
@@ -4818,5 +4822,5 @@
 
 \begin{verbatim}
-bool psFitsUpdateTable(psFits* fits, psMetadata* data, int row); 
+bool psFitsUpdateTable(psFits* fits, const psMetadata* data, int row); 
 \end{verbatim}
 Writes the \code{psMetadata} data to a FITS table at the specified row
@@ -4915,5 +4919,5 @@
 
 \begin{verbatim}
-psF64 *psTimeToLMST(psTime *time, psF64 longitude);
+psF64 *psTimeToLMST(const psTime *time, psF64 longitude);
 \end{verbatim}
 
@@ -5458,5 +5462,5 @@
 
 \begin{verbatim}
-psSphereRot *psSphereRotCombine(psSphereRot *out, psSphereRot *rot1, psSphereRot *rot2)
+psSphereRot *psSphereRotCombine(psSphereRot *out, const psSphereRot *rot1, const psSphereRot *rot2)
 \end{verbatim}
 
@@ -5472,6 +5476,6 @@
 angular and 3-vector representations:
 \begin{verbatim}
-psSphere *psCubeToSphere(psCube *cube);
-psCube *psSphereToCube(psSphere *sphere);
+psSphere *psCubeToSphere(const psCube *cube);
+psCube *psSphereToCube(const psSphere *sphere);
 \end{verbatim}
 
@@ -5522,6 +5526,6 @@
 %
 \begin{verbatim}
-psSphereRot *psSphereRotICRSToEcliptic(psTime *time);
-psSphereRot *psSphereRotEclipticToICRS(psTime *time);
+psSphereRot *psSphereRotICRSToEcliptic(const psTime *time);
+psSphereRot *psSphereRotEclipticToICRS(const psTime *time);
 psSphereRot *psSphereRotICRSToGalactic(void);
 psSphereRot *psSphereRotGalacticToICRS(void);
@@ -5583,5 +5587,5 @@
 observer, represented as a speed and a direction:
 \begin{verbatim}
-psSphere *psAberration(psSphere *apparent, psSphere *actual, psSphere direction, double speed);
+psSphere *psAberration(psSphere *apparent, const psSphere *actual, const psSphere *direction, double speed);
 \end{verbatim}
 The \code{actual} and \code{apparent} positions are represented as
@@ -5607,5 +5611,5 @@
 
 \begin{verbatim}
-double psEOC_ParallaxFactor(psSphere *coords, psTime *time);
+double psEOC_ParallaxFactor(const psSphere *coords, const psTime *time);
 \end{verbatim}
 Calculate the parallax factor for the given position and time.
