IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6500 for trunk/psLib/src/types


Ignore:
Timestamp:
Feb 27, 2006, 4:53:03 PM (20 years ago)
Author:
drobbin
Message:

Add Length functions/tests. Modified psPixelsAlloc to set n=0.

Location:
trunk/psLib/src/types
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psArray.c

    r6484 r6500  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-02-24 23:43:15 $
     11 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-02-28 02:53:03 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    241241    return psMemIncrRefCounter(array->data[position]);
    242242}
     243
     244long psArrayLength(const psArray *array)
     245{
     246    if ( !psMemCheckArray((psArray*)array) ) {
     247        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     248                "Error:  Specified array is not a valid psArray \n");
     249        return -1;
     250    }
     251    return (array->n);
     252}
     253
  • trunk/psLib/src/types/psArray.h

    r5530 r6500  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-11-16 23:06:35 $
     13 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2006-02-28 02:53:03 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    160160);
    161161
     162/** Get the number of elements in use from a specified psArray. (array.n)
     163 *
     164 *  @return long:       The number of elements in use.
     165 */
     166long psArrayLength(
     167    const psArray *array               ///< input psArray
     168);
     169
    162170/// @}
    163171
  • trunk/psLib/src/types/psList.c

    r6425 r6500  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-02-14 00:09:27 $
     8 *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-02-28 02:53:03 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    621621}
    622622
     623long psListLength(const psList *list)
     624{
     625    if ( !psMemCheckList((psList*)list) ) {
     626        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     627                "Error:  Specified list is not a valid psList \n");
     628        return -1;
     629    }
     630    return (list->n);
     631}
     632
     633
  • trunk/psLib/src/types/psList.h

    r6425 r6500  
    77 *  @ingroup LinkedList
    88 *
    9  *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-02-14 00:09:27 $
     9 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-02-28 02:53:03 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    232232);
    233233
     234/** Get the number of elements in use from a specified psList. (list.n)
     235 *
     236 *  @return long:       The number of elements in use.
     237 */
     238long psListLength(
     239    const psList *list                 ///< input psList
     240);
     241
     242
    234243/// @} End of DataGroup Functions
    235244
  • trunk/psLib/src/types/psPixels.c

    r5530 r6500  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-11-16 23:06:35 $
     9 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-02-28 02:53:03 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6565        out->data = NULL;
    6666    }
    67     out->n = nalloc;
     67    out->n = 0;
    6868    P_PSPIXELS_SET_NALLOC(out,nalloc);
    6969
     
    409409}
    410410
     411long psPixelsLength(const psPixels *pixels)
     412{
     413    if ( !psMemCheckPixels((psPixels*)pixels) ) {
     414        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     415                "Error:  Specified pixels is not a valid psPixels \n");
     416        return -1;
     417    }
     418    return (pixels->n);
     419}
     420
  • trunk/psLib/src/types/psPixels.h

    r6230 r6500  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-01-28 01:31:44 $
     9 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-02-28 02:53:03 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    185185);
    186186
     187/** Get the number of elements in use from a specified psPixels. (pixels.n)
     188 *
     189 *  @return long:       The number of elements in use.
     190 */
     191long psPixelsLength(
     192    const psPixels *pixels             ///< input psPixels
     193);
     194
    187195#endif // #ifndef PS_PIXELS_H
Note: See TracChangeset for help on using the changeset viewer.