IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2005, 1:07:18 PM (21 years ago)
Author:
Paul Price
Message:

Putting in const qualifiers.

File:
1 edited

Legend:

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

    r3958 r3960  
    1 %%% $Id: psLibSDRS.tex,v 1.225 2005-05-18 20:45:01 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.226 2005-05-18 23:07:18 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    440440%
    441441\begin{verbatim}
    442 void *p_psAlloc(size_t size, char *file, int line);
    443 void *p_psRealloc(void *ptr, size_t size, char *file, int line);
    444 void p_psFree(void *ptr, char *file, int line);
     442void *p_psAlloc(size_t size, const char *file, int line);
     443void *p_psRealloc(void *ptr, size_t size, const char *file, int line);
     444void p_psFree(void *ptr, const char *file, int line);
    445445\end{verbatim}
    446446%
     
    694694%
    695695\begin{verbatim}
    696 psReferenceCount psMemGetRefCounter(void *vptr);
    697 void *psMemIncrRefCounter(void *vptr);
     696psReferenceCount psMemGetRefCounter(const void *vptr);
     697void *psMemIncrRefCounter(const void *vptr);
    698698void *psMemDecrRefCounter(void *vptr);
    699699\end{verbatim}
     
    819819%
    820820\begin{verbatim}
    821 void psTrace(char *facil, int myLevel,...);
     821void psTrace(const char *facil, int myLevel,...);
    822822\end{verbatim}
    823823%
     
    12151215
    12161216\begin{verbatim}
    1217 void psAbort(char *name, char *fmt,...);
     1217void psAbort(const char *name, const char *fmt,...);
    12181218\end{verbatim}
    12191219
     
    13291329In addition, we specify two functions for working with \code{psScalar} data:
    13301330\begin{verbatim}
    1331 psScalar *psScalarAlloc (psC64 value, psElemType dataType);
    1332 psScalar *psScalarCopy (psScalar *value);
     1331psScalar *psScalarAlloc(psC64 value, psElemType dataType);
     1332psScalar *psScalarCopy(const psScalar *value);
    13331333\end{verbatim}
    13341334The first creates a \code{psType}-ed structure from a constant value,
     
    14321432
    14331433\begin{verbatim}
    1434 psVector *psVectorCopy(psVector *output, psVector *input, psElemType type);
     1434psVector *psVectorCopy(psVector *output, const psVector *input, psElemType type);
    14351435\end{verbatim}
    14361436
     
    15651565
    15661566\begin{verbatim}
    1567 psArray *psArrayAdd(psArray *array, int delta, void *value);
     1567psArray *psArrayAdd(psArray *array, int delta, const void *value);
    15681568\end{verbatim}
    15691569
     
    15751575
    15761576\begin{verbatim}
    1577 psBool psArrayRemove(psArray *array, psPtr value);
     1577psBool psArrayRemove(psArray *array, const psPtr value);
    15781578\end{verbatim}
    15791579
     
    15841584
    15851585\begin{verbatim}
    1586 psBool psArraySet(psArray* in, psU32 position, void* value);
    1587 void* psArrayGet(psArray* in, psU32 position);
     1586psBool psArraySet(psArray* in, psU32 position, const void* value);
     1587void* psArrayGet(const psArray* in, psU32 position);
    15881588\end{verbatim}
    15891589
     
    16001600specification of a comparison function to specify how the objects on
    16011601the list should be sorted.  The motivation is primarily to be able to
    1602 iterate on a sorted list of keys from a hash.
     1602iterate on a sorted list of keys from a hash.  The \code{array} is
     1603sorted in-place.
    16031604
    16041605\subsection{Doubly-linked lists}
     
    16401641
    16411642\begin{verbatim}
    1642 psList *psListAlloc(void *data);
     1643psList *psListAlloc(const void *data);
    16431644\end{verbatim}
    16441645Create a list.  This function may take a pointer to a data item, or it
     
    17121713
    17131714\begin{verbatim}
    1714 bool psListAdd(psList *list, int location, void *data);
    1715 bool psListAddAfter(psListIterator *iterator, void *data);
    1716 bool psListAddBefore(psListIterator *iterator, void *data);
     1715bool psListAdd(psList *list, int location, const void *data);
     1716bool psListAddAfter(psListIterator *iterator, const void *data);
     1717bool psListAddBefore(psListIterator *iterator, const void *data);
    17171718\end{verbatim}
    17181719the first function, \code{psListAdd}, adds an entry to the \code{list}
     
    17611762\begin{verbatim}
    17621763bool psListRemove(psList *list, int location)
    1763 bool psListRemoveData(psList *list, void *data);
     1764bool psListRemoveData(psList *list, const void *data);
    17641765\end{verbatim}
    17651766A data item may be removed from the list with these functions.  For
     
    17791780
    17801781\begin{verbatim}
    1781 psArray *psListToArray(psList *list);
    1782 psList  *psArrayToList(psArray *array);
     1782psArray *psListToArray(const psList *list);
     1783psList  *psArrayToList(const psArray *array);
    17831784\end{verbatim}
    17841785These two functions are available to convert between the
     
    17931794specification of a comparison function to specify how the objects on
    17941795the list should be sorted.  The motivation is primarily to be able to
    1795 iterate on a sorted list of keys from a hash.
     1796iterate on a sorted list of keys from a hash.  The \code{list} is
     1797sorted in-place.
    17961798
    17971799\subsection{Hash Tables}
     
    18511853A data item may be added to the hash table with the function:
    18521854\begin{verbatim}
    1853 bool psHashAdd(psHash *table, const char *key, void *data);
     1855bool psHashAdd(psHash *table, const char *key, const void *data);
    18541856\end{verbatim}
    18551857In this function, the value of the string \code{key} is used to
     
    18621864The data associated with a given key may be found with the function:
    18631865\begin{verbatim}
    1864 void *psHashLookup(psHash *table, const char *key);
     1866void *psHashLookup(const psHash *table, const char *key);
    18651867\end{verbatim}
    18661868which returns the data value pointed to by the element associated with
     
    18751877The function
    18761878\begin{verbatim}
    1877 psList *psHashKeyList(psHash *table);
     1879psList *psHashKeyList(const psHash *table);
    18781880\end{verbatim}
    18791881returns the complete list of defined keys associated with the
     
    18811883
    18821884\begin{verbatim}
    1883 psArray *psHashToArray(psHash *hash);
     1885psArray *psHashToArray(const psHash *hash);
    18841886\end{verbatim}
    18851887This function places the data in a \code{psHash} into a \code{psArray}
     
    20582060psBitSet *psBitSetSet(psBitSet *myBits, int bit);
    20592061psBitSet* psBitSetClear(psBitSet* inBits, int bit);
    2060 psBitSet *psBitSetOp(psBitSet *outBits, const psBitSet *inBits1, char *operator, const psBitSet *inBits2);
    2061 psBitSet *psBitSetNot(psBitSet *out, psBitSet *in);
     2062psBitSet *psBitSetOp(psBitSet *outBits, const psBitSet *inBits1, const char *operator, const psBitSet *inBits2);
     2063psBitSet *psBitSetNot(psBitSet *out, const psBitSet *in);
    20622064bool psBitSetTest(const psBitSet *checkBits, int bit);
    20632065char *psBitSetToString(const pBitSet* bits);
     
    28092811
    28102812psVector *psImageSlice(psVector *out,
    2811                        psVector *coords,
     2813                       const psVector *coords,
    28122814                       const psImage *input,
    28132815                       const psImage *mask,
     
    32633265
    32643266\begin{verbatim}
    3265 psType *psBinaryOp (void *out, void *in1, char *op, void *in2);
    3266 psType *psUnaryOp (void *out, void *in, char *op);
     3267psType *psBinaryOp(void *out, const void *in1, const char *op, const void *in2);
     3268psType *psUnaryOp(void *out, const void *in, const char *op);
    32673269\end{verbatim}
    32683270These functions determine the type of the operands on the basis of
     
    34143416types \code{psF32, psF64}.  Input and output data types should match.
    34153417\begin{verbatim}
    3416 psImage *psMatrixEigenvectors(psImage *out, psImage *in);
     3418psImage *psMatrixEigenvectors(psImage *out, const psImage *in);
    34173419\end{verbatim}
    34183420\tbd{Should this return an array of vectors?  Specified here as
     
    34433445psVector *psVectorReal(psVector *out, const psVector *in);
    34443446psVector *psVectorImaginary(psVector *out, const psVector *in);
    3445 psVector *psVectorComplex(psVector *out, psVector *real, psVector *imag);
     3447psVector *psVectorComplex(psVector *out, const psVector *real, const psVector *imag);
    34463448psVector *psVectorConjugate(psVector *out, const psVector *in);
    34473449psVector *psVectorPowerSpectrum(psVector *out, const psVector *in);
     
    35033505psImage *psImageReal(psImage *out, const psImage *in);
    35043506psImage *psImageImaginary(psImage *out, const psImage *in);
    3505 psImage *psImageComplex(psImage *out, psImage *real, const psImage *imag);
     3507psImage *psImageComplex(psImage *out, const psImage *real, const psImage *imag);
    35063508psImage *psImageConjugate(psImage *out, const psImage *in);
    35073509psImage *psImagePowerSpectrum(psImage *out, const psImage *in);
     
    39153917
    39163918\begin{verbatim}
    3917 bool psMetadataAddItem(psMetadata *md, psMetadataItem *item, int location, int mode);
     3919bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, int location, int mode);
    39183920bool psMetadataAdd(psMetadata *md, int location, const char *name, int format, const char *comment, ...);
    39193921bool psMetadataAddV(psMetadata *md, int location, const char *name, int format, const char *comment,
     
    40294031psBool psMetadataAddF64(psMetadata* md, psS32 location, const char* name, const char* comment, psF64 value);
    40304032psBool psMetadataAddList(psMetadata* md, psS32 location, const char* name, const char* comment,
    4031                          psList* value);
     4033                         const psList* value);
    40324034psBool psMetadataAddStr(psMetadata* md, psS32 location, const char* name, const char* comment,
    40334035                        const char* value);
    40344036psBool psMetadataAddVector(psMetadata* md, psS32 location, const char* name, const char* comment,
    4035                            psVector* value);
     4037                           const psVector* value);
    40364038psBool psMetadataAddImage(psMetadata* md, psS32 location, const char* name, const char* comment,
    4037                           psImage* value);
     4039                          const psImage* value);
    40384040psBool psMetadataAddHash(psMetadata* md, psS32 location, const char* name, const char* comment,
    4039                          psHash* value);
     4041                         const psHash* value);
    40404042psBool psMetadataAddLookupTable(psMetadata* md, psS32 location, const char* name, const char* comment,
    4041                                 psLookupTable* value);
     4043                                const psLookupTable* value);
    40424044psBool psMetadataAddUnknown(psMetadata* md, psS32 location, const char* name, const char* comment,
    4043                             psPtr value);
     4045                            const psPtr value);
     4046psBool psMetadataAddMetadata(psMetadata* md, psS32 location, const char* name, const char* comment,
     4047                             const psMetadata* value);
    40444048\end{verbatim}
    40454049
     
    44784482
    44794483\begin{verbatim}
    4480     bool psDBCreateTable(psDB *dbh, const char *tableName, psMetadata *md);
     4484    bool psDBCreateTable(psDB *dbh, const char *tableName, const psMetadata *md);
    44814485\end{verbatim}
    44824486
     
    45444548
    45454549\begin{verbatim}
    4546     bool psDBInsertOneRow(psDB *dbh, const char *tableName, psMetadata *row);
     4550    bool psDBInsertOneRow(psDB *dbh, const char *tableName, const psMetadata *row);
    45474551\end{verbatim}
    45484552
     
    45524556
    45534557\begin{verbatim}
    4554     bool psDBInsertRows(psDB *dbh, const char *tableName, psArray *rowSet);
     4558    bool psDBInsertRows(psDB *dbh, const char *tableName, const psArray *rowSet);
    45554559\end{verbatim}
    45564560
     
    45734577
    45744578\begin{verbatim}
    4575     psS64 psDBUpdateRows(psDB *dbh, const char *tableName, psMetadata *where, psMetadata *values);
     4579psS64 psDBUpdateRows(psDB *dbh, const char *tableName, const psMetadata *where, const psMetadata *values);
    45764580\end{verbatim}
    45774581
     
    45844588
    45854589\begin{verbatim}
    4586     psS64 psDBDeleteRows(psDB *dbh, const char *tableName, psMetadata *where);
     4590    psS64 psDBDeleteRows(psDB *dbh, const char *tableName, const psMetadata *where);
    45874591\end{verbatim}
    45884592
     
    46574661
    46584662\begin{verbatim}
    4659 char *psFitsGetExtName(const psFits* fits);
    4660 bool psFitsSetExtName(const psFits* fits, const char* name);
     4663char *psFitsGetExtName(psFits* fits);
     4664bool psFitsSetExtName(psFits* fits, const char* name);
    46614665\end{verbatim}
    46624666
     
    46704674
    46714675\begin{verbatim}
    4672 psMetadata *psFitsReadHeader(psMetadata *out, const psFits *fits);
     4676psMetadata *psFitsReadHeader(psMetadata *out, psFits *fits);
    46734677\end{verbatim}
    46744678Read header data into a \code{psMetadata} structure.  The data is read
     
    46904694
    46914695\begin{verbatim}
    4692 bool psFitsWriteHeader(psMetadata *output, const psFits *fits);
     4696bool psFitsWriteHeader(psMetadata *output, psFits *fits);
    46934697\end{verbatim}
    46944698Write metadata into the header of a FITS image file.  The header is
     
    47344738
    47354739\begin{verbatim}
    4736 bool psFitsWriteImage(psFits *fits, psMetadata *header, const psImage *input, int depth);
     4740bool psFitsWriteImage(psFits *fits, const psMetadata *header, const psImage *input, int depth);
    47374741\end{verbatim}
    47384742Create a new image based on the dimensions specified for the image and
     
    47754779
    47764780\begin{verbatim}
    4777 psArray *psFitsReadTableColumn (psFits *fits, char *colname);
     4781psArray *psFitsReadTableColumn (psFits *fits, const char *colname);
    47784782\end{verbatim}
    47794783This function reads a single column of the table in the extension
     
    47844788
    47854789\begin{verbatim}
    4786 psVector *psFitsReadTableColumnNum (psFits *fits, char *colname);
     4790psVector *psFitsReadTableColumnNum (psFits *fits, const char *colname);
    47874791\end{verbatim}
    47884792This function reads a single column of the table in the extension
     
    48114815
    48124816\begin{verbatim}
    4813 bool psFitsWriteTable(psFits* fits, psMetadata *header, psArray* table);
     4817bool psFitsWriteTable(psFits* fits, const psMetadata *header, const psArray* table);
    48144818\end{verbatim}
    48154819Accepts a \code{psArray} of \code{psMetadata} and writes it to the
     
    48184822
    48194823\begin{verbatim}
    4820 bool psFitsUpdateTable(psFits* fits, psMetadata* data, int row);
     4824bool psFitsUpdateTable(psFits* fits, const psMetadata* data, int row);
    48214825\end{verbatim}
    48224826Writes the \code{psMetadata} data to a FITS table at the specified row
     
    49154919
    49164920\begin{verbatim}
    4917 psF64 *psTimeToLMST(psTime *time, psF64 longitude);
     4921psF64 *psTimeToLMST(const psTime *time, psF64 longitude);
    49184922\end{verbatim}
    49194923
     
    54585462
    54595463\begin{verbatim}
    5460 psSphereRot *psSphereRotCombine(psSphereRot *out, psSphereRot *rot1, psSphereRot *rot2)
     5464psSphereRot *psSphereRotCombine(psSphereRot *out, const psSphereRot *rot1, const psSphereRot *rot2)
    54615465\end{verbatim}
    54625466
     
    54725476angular and 3-vector representations:
    54735477\begin{verbatim}
    5474 psSphere *psCubeToSphere(psCube *cube);
    5475 psCube *psSphereToCube(psSphere *sphere);
     5478psSphere *psCubeToSphere(const psCube *cube);
     5479psCube *psSphereToCube(const psSphere *sphere);
    54765480\end{verbatim}
    54775481
     
    55225526%
    55235527\begin{verbatim}
    5524 psSphereRot *psSphereRotICRSToEcliptic(psTime *time);
    5525 psSphereRot *psSphereRotEclipticToICRS(psTime *time);
     5528psSphereRot *psSphereRotICRSToEcliptic(const psTime *time);
     5529psSphereRot *psSphereRotEclipticToICRS(const psTime *time);
    55265530psSphereRot *psSphereRotICRSToGalactic(void);
    55275531psSphereRot *psSphereRotGalacticToICRS(void);
     
    55835587observer, represented as a speed and a direction:
    55845588\begin{verbatim}
    5585 psSphere *psAberration(psSphere *apparent, psSphere *actual, psSphere direction, double speed);
     5589psSphere *psAberration(psSphere *apparent, const psSphere *actual, const psSphere *direction, double speed);
    55865590\end{verbatim}
    55875591The \code{actual} and \code{apparent} positions are represented as
     
    56075611
    56085612\begin{verbatim}
    5609 double psEOC_ParallaxFactor(psSphere *coords, psTime *time);
     5613double psEOC_ParallaxFactor(const psSphere *coords, const psTime *time);
    56105614\end{verbatim}
    56115615Calculate the parallax factor for the given position and time.
Note: See TracChangeset for help on using the changeset viewer.