IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9578


Ignore:
Timestamp:
Oct 13, 2006, 5:50:28 PM (20 years ago)
Author:
Paul Price
Message:

Adding assertions for metadata and string.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psString.h

    r8610 r9578  
    1414 *  @author David Robbins, MHPCC
    1515 *
    16  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2006-08-26 00:32:39 $
     16 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2006-10-14 03:50:28 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    136136) __attribute__((format(printf, 2, 3)));
    137137# else // __GNUC__
     138
    138139    ssize_t psStringPrepend(
    139140        char **dest,                        ///< existing string
     
    206207);
    207208
     209
     210#define PS_ASSERT_STRING_NON_EMPTY(NAME, RVAL) \
     211if (!(NAME) || strlen(NAME) == 0) { \
     212    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
     213            "Error: String %s is NULL or empty.", \
     214            #NAME); \
     215    return(RVAL); \
     216}
     217
     218
    208219/** @} */// Doxygen - End of SystemGroup Functions
    209220
  • trunk/psLib/src/types/psMetadata.h

    r9549 r9578  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.90 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2006-10-13 22:42:28 $
     13*  @version $Revision: 1.91 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2006-10-14 03:50:28 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11891189
    11901190
     1191/// Assert on metadata with extant hash and list components
     1192#define PS_ASSERT_METADATA_NON_NULL(NAME, RVAL) \
     1193if (!(NAME) || !(NAME)->hash || !(NAME)->list) { \
     1194    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
     1195            "Error: Metadata %s or one of its components is NULL.", \
     1196            #NAME); \
     1197    return(RVAL); \
     1198}
     1199
     1200
    11911201/// @}
    11921202
Note: See TracChangeset for help on using the changeset viewer.