Changeset 3165 for trunk/psLib/src/collections
- Timestamp:
- Feb 8, 2005, 3:04:01 PM (21 years ago)
- Location:
- trunk/psLib/src/collections
- Files:
-
- 4 edited
-
psArray.c (modified) (2 diffs)
-
psArray.h (modified) (2 diffs)
-
psCollectionsErrors.dat (modified) (1 diff)
-
psCollectionsErrors.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psArray.c
r3115 r3165 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02-0 3 00:54:10$11 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-09 01:04:01 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 157 157 return in; 158 158 } 159 160 /// Set an element in the array. 161 psBool psArraySet(psArray* in, ///< input array to set element in 162 psU32 position, ///< the element position to set 163 void* value) ///< the value to set it to 164 { 165 if (in == NULL) 166 { 167 psError(PS_ERR_BAD_PARAMETER_NULL, true, 168 PS_ERRORTEXT_psArray_ARRAY_NULL); 169 return false; 170 } 171 172 if (position >= in->nalloc) 173 { 174 psError(PS_ERR_BAD_PARAMETER_NULL, true, 175 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC, 176 position, in->nalloc); 177 return false; 178 } 179 180 psFree(in->data[position]); 181 in->data[position] = value; 182 183 return true; 184 } 185 186 /// Get an element in the array. 187 void* psArrayGet(psArray* in, psU32 position ) 188 { 189 if (in == NULL) { 190 psError(PS_ERR_BAD_PARAMETER_NULL, true, 191 PS_ERRORTEXT_psArray_ARRAY_NULL); 192 return NULL; 193 } 194 195 if (position >= in->nalloc) { 196 psError(PS_ERR_BAD_PARAMETER_NULL, true, 197 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC, 198 position, in->nalloc); 199 return NULL; 200 } 201 202 return in->data[position]; 203 } 204 205 206 207 -
trunk/psLib/src/collections/psArray.h
r3115 r3165 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-02-0 3 00:54:10$14 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-02-09 01:04:01 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 126 126 ); 127 127 128 /** Set an element in the array. If the current element is non-NULL, the old 129 * element is freed. 130 * 131 * @return psBool TRUE if the element was set successfully, otherwise FALSE 132 */ 133 psBool psArraySet( 134 psArray* in, ///< input array to set element in 135 psU32 position, ///< the element position to set 136 void* value ///< the value to set it to 137 ); 138 139 /** Get an element from the array. 140 * 141 * @return void* the element at given position. 142 */ 143 void* psArrayGet( 144 psArray* in, ///< input array to get element from 145 psU32 position ///< the element position to get 146 ); 147 128 148 /// @} 129 149 -
trunk/psLib/src/collections/psCollectionsErrors.dat
r3107 r3165 10 10 psArray_REALLOC_NULL psArrayRealloc must be given a non-NULL psArray to resize. 11 11 psArray_ARRAY_NULL Specified psArray can not be NULL. 12 psArray_POSITION_BEYOND_NALLOC Specified position, %d, is greater than the allocated size of the array, %d. 12 13 # 13 14 psVector_REALLOC_NULL psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown. -
trunk/psLib/src/collections/psCollectionsErrors.h
r3107 r3165 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02-0 2 20:21:48$9 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-09 01:04:01 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #define PS_ERRORTEXT_psArray_REALLOC_NULL "psArrayRealloc must be given a non-NULL psArray to resize." 33 33 #define PS_ERRORTEXT_psArray_ARRAY_NULL "Specified psArray can not be NULL." 34 #define PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC "Specified position, %d, is greater than the allocated size of the array, %d." 34 35 #define PS_ERRORTEXT_psVector_REALLOC_NULL "psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown." 35 36 #define PS_ERRORTEXT_psVector_NOT_A_VECTOR "The input psVector must have a vector dimension type."
Note:
See TracChangeset
for help on using the changeset viewer.
