IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11709


Ignore:
Timestamp:
Feb 8, 2007, 11:44:00 AM (19 years ago)
Author:
jhoblitt
Message:

change psHashAlloc() to pass in file/lineno/func
whitespace fixes

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

Legend:

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

    r11668 r11709  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2007-02-06 21:36:09 $
     14*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2007-02-08 21:44:00 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    137137    The new hash table.
    138138 *****************************************************************************/
    139 psHash* psHashAlloc(long nalloc)        // initial number of buckets
     139psHash* p_psHashAlloc(const char *file,
     140                      unsigned int lineno,
     141                      const char *func,
     142                      long nalloc)        // initial number of buckets
    140143{
    141144    if (nalloc < 0)
     
    148151
    149152    // Create the new hash table.
    150     psHash* table = psAlloc(sizeof(psHash));
     153    psHash* table = p_psAlloc(file, lineno, func, sizeof(psHash));
    151154
    152155    psMemSetDeallocator(table, (psFreeFunc) hashFree);
     
    167170    return table;
    168171}
     172
    169173
    170174bool psMemCheckHash(psPtr ptr)
  • trunk/psLib/src/types/psHash.h

    r11248 r11709  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2007-01-23 22:47:23 $
     13 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2007-02-08 21:44:00 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3434psHashBucket;
    3535
     36
    3637//typedef struct HashTable psHash; ///< Opaque type for a hash table
    3738
     
    4546psHash;
    4647
     48
    4749/** Checks the type of a particular pointer.
    4850 *
    49  *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     51 *  Uses the appropriate deallocation function in psMemBlock to check the ptr
     52 *  datatype.
    5053 *
    5154 *  @return bool:       True if the pointer matches a psHash structure, false otherwise.
     
    5356bool psMemCheckHash(
    5457    psPtr ptr                          ///< the pointer whose type to check
    55 )
    56 ;
     58);
     59
    5760
    5861/// Allocate hash buckets in table.
     62#ifdef DOXYGEN
    5963psHash* psHashAlloc(
    6064    long nalloc                        ///< The number of buckets to allocate.
    6165);
     66#else // ifdef DOXYGEN
     67psHash* p_psHashAlloc(
     68    const char *file,                   ///< File of caller
     69    unsigned int lineno,                ///< Line number of caller
     70    const char *func,                   ///< Function name of caller
     71    long nalloc                        ///< The number of buckets to allocate.
     72);
     73#define psHashAlloc(nalloc) \
     74      p_psHashAlloc(__FILE__, __LINE__, __func__, nalloc)
     75#endif // ifdef DOXYGEN
     76
     77
    6278
    6379/// Insert entry into table.
     
    6884);
    6985
     86
    7087/// Lookup key in table.
    7188psPtr psHashLookup(
     
    7390    const char *key                    ///< The key to lookup.
    7491);
     92
    7593
    7694/// Remove key from table.
     
    8098);
    8199
     100
    82101/// List all keys in table.
    83102psList* psHashKeyList(
    84103    const psHash* hash                 ///< The table to list keys from..
    85104);
     105
    86106
    87107/** Create a psArray from a psHash contents.
     
    93113);
    94114
     115
    95116/// @} End of DataContainer Functions
    96117#endif // #ifndef PS_HASH_H
Note: See TracChangeset for help on using the changeset viewer.