00001 /** @file psCompare.h 00002 * @brief Comparison functions for sorting routines 00003 * 00004 * @author Robert Daniel DeSonia, MHPCC 00005 * 00006 * @ingroup Compare 00007 * 00008 * @version $Revision: 1.1.1.1 $ $Name: $ 00009 * @date $Date: 2005/09/14 20:42:48 $ 00010 * 00011 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00012 */ 00013 00014 #ifndef PS_COMPARE_H 00015 #define PS_COMPARE_H 00016 00017 #include "psType.h" 00018 00019 /** @addtogroup Compare 00020 * @{ 00021 */ 00022 00023 /** A comparison function for sorting elements that are pointers to data, 00024 * e.g., for psList of pointers to numeric values. 00025 * 00026 * @return int an integer less than, equal to, or greater than zero if 00027 * the first argument is considered to be respectively less 00028 * than, equal to, or greater than the second. 00029 */ 00030 typedef int (*psComparePtrFunc) ( 00031 const void **a, ///< first comparison target 00032 const void **b ///< second comparison target 00033 ); 00034 00035 /** A comparison function for sorting. 00036 * 00037 * @return int an integer less than, equal to, or greater than zero if 00038 * the first argument is considered to be respectively less 00039 * than, equal to, or greater than the second. 00040 */ 00041 typedef int (*psCompareFcn) ( 00042 const void *a, ///< first comparison target 00043 const void *b ///< second comparison target 00044 ); 00045 00046 /** Compare function of psS8 data. For use with psListSort. 00047 * 00048 * @return int an integer less than, equal to, or greater than zero if 00049 * the first argument is considered to be respectively less 00050 * than, equal to, or greater than the second. 00051 */ 00052 int psCompareS8Ptr( 00053 const void **a, ///< first comparison target 00054 const void **b ///< second comparison target 00055 ); 00056 00057 /** Compare function of psS16 data. For use with psListSort. 00058 * 00059 * @return int an integer less than, equal to, or greater than zero if 00060 * the first argument is considered to be respectively less 00061 * than, equal to, or greater than the second. 00062 */ 00063 int psCompareS16Ptr( 00064 const void **a, ///< first comparison target 00065 const void **b ///< second comparison target 00066 ); 00067 00068 /** Compare function of psS32 data. For use with psListSort. 00069 * 00070 * @return int an integer less than, equal to, or greater than zero if 00071 * the first argument is considered to be respectively less 00072 * than, equal to, or greater than the second. 00073 */ 00074 int psCompareS32Ptr( 00075 const void **a, ///< first comparison target 00076 const void **b ///< second comparison target 00077 ); 00078 00079 /** Compare function of psS64 data. For use with psListSort. 00080 * 00081 * @return int an integer less than, equal to, or greater than zero if 00082 * the first argument is considered to be respectively less 00083 * than, equal to, or greater than the second. 00084 */ 00085 int psCompareS64Ptr( 00086 const void **a, ///< first comparison target 00087 const void **b ///< second comparison target 00088 ); 00089 00090 /** Compare function of psU8 data. For use with psListSort. 00091 * 00092 * @return int an integer less than, equal to, or greater than zero if 00093 * the first argument is considered to be respectively less 00094 * than, equal to, or greater than the second. 00095 */ 00096 int psCompareU8Ptr( 00097 const void **a, ///< first comparison target 00098 const void **b ///< second comparison target 00099 ); 00100 00101 /** Compare function of psU16 data. For use with psListSort. 00102 * 00103 * @return int an integer less than, equal to, or greater than zero if 00104 * the first argument is considered to be respectively less 00105 * than, equal to, or greater than the second. 00106 */ 00107 int psCompareU16Ptr( 00108 const void **a, ///< first comparison target 00109 const void **b ///< second comparison target 00110 ); 00111 00112 /** Compare function of psU32 data. For use with psListSort. 00113 * 00114 * @return int an integer less than, equal to, or greater than zero if 00115 * the first argument is considered to be respectively less 00116 * than, equal to, or greater than the second. 00117 */ 00118 int psCompareU32Ptr( 00119 const void **a, ///< first comparison target 00120 const void **b ///< second comparison target 00121 ); 00122 00123 /** Compare function of psU64 data. For use with psListSort. 00124 * 00125 * @return int an integer less than, equal to, or greater than zero if 00126 * the first argument is considered to be respectively less 00127 * than, equal to, or greater than the second. 00128 */ 00129 int psCompareU64Ptr( 00130 const void **a, ///< first comparison target 00131 const void **b ///< second comparison target 00132 ); 00133 00134 /** Compare function of psF32 data. For use with psListSort. 00135 * 00136 * @return int an integer less than, equal to, or greater than zero if 00137 * the first argument is considered to be respectively less 00138 * than, equal to, or greater than the second. 00139 */ 00140 int psCompareF32Ptr( 00141 const void **a, ///< first comparison target 00142 const void **b ///< second comparison target 00143 ); 00144 00145 /** Compare function of psF64 data. For use with psListSort. 00146 * 00147 * @return int an integer less than, equal to, or greater than zero if 00148 * the first argument is considered to be respectively less 00149 * than, equal to, or greater than the second. 00150 */ 00151 int psCompareF64Ptr( 00152 const void **a, ///< first comparison target 00153 const void **b ///< second comparison target 00154 ); 00155 00156 /** Compare function of psS8 data. For use with psListSort for descending ordering. 00157 * 00158 * @return int an integer less than, equal to, or greater than zero if 00159 * the first argument is considered to be respectively greater 00160 * than, equal to, or less than the second. 00161 */ 00162 int psCompareDescendingS8Ptr( 00163 const void **a, ///< first comparison target 00164 const void **b ///< second comparison target 00165 ); 00166 00167 /** Compare function of psS16 data. For use with psListSort for descending ordering. 00168 * 00169 * @return int an integer less than, equal to, or greater than zero if 00170 * the first argument is considered to be respectively greater 00171 * than, equal to, or less than the second. 00172 */ 00173 int psCompareDescendingS16Ptr( 00174 const void **a, ///< first comparison target 00175 const void **b ///< second comparison target 00176 ); 00177 00178 /** Compare function of psS32 data. For use with psListSort for descending ordering. 00179 * 00180 * @return int an integer less than, equal to, or greater than zero if 00181 * the first argument is considered to be respectively greater 00182 * than, equal to, or less than the second. 00183 */ 00184 int psCompareDescendingS32Ptr( 00185 const void **a, ///< first comparison target 00186 const void **b ///< second comparison target 00187 ); 00188 00189 /** Compare function of psS64 data. For use with psListSort for descending ordering. 00190 * 00191 * @return int an integer less than, equal to, or greater than zero if 00192 * the first argument is considered to be respectively greater 00193 * than, equal to, or less than the second. 00194 */ 00195 int psCompareDescendingS64Ptr( 00196 const void **a, ///< first comparison target 00197 const void **b ///< second comparison target 00198 ); 00199 00200 /** Compare function of psU8 data. For use with psListSort for descending ordering. 00201 * 00202 * @return int an integer less than, equal to, or greater than zero if 00203 * the first argument is considered to be respectively greater 00204 * than, equal to, or less than the second. 00205 */ 00206 int psCompareDescendingU8Ptr( 00207 const void **a, ///< first comparison target 00208 const void **b ///< second comparison target 00209 ); 00210 00211 /** Compare function of psU16 data. For use with psListSort for descending ordering. 00212 * 00213 * @return int an integer less than, equal to, or greater than zero if 00214 * the first argument is considered to be respectively greater 00215 * than, equal to, or less than the second. 00216 */ 00217 int psCompareDescendingU16Ptr( 00218 const void **a, ///< first comparison target 00219 const void **b ///< second comparison target 00220 ); 00221 00222 /** Compare function of psU32 data. For use with psListSort for descending ordering. 00223 * 00224 * @return int an integer less than, equal to, or greater than zero if 00225 * the first argument is considered to be respectively greater 00226 * than, equal to, or lessg than the second. 00227 */ 00228 int psCompareDescendingU32Ptr( 00229 const void **a, ///< first comparison target 00230 const void **b ///< second comparison target 00231 ); 00232 00233 /** Compare function of psU64 data. For use with psListSort for descending ordering. 00234 * 00235 * @return int an integer less than, equal to, or greater than zero if 00236 * the first argument is considered to be respectively greater 00237 * than, equal to, or lessg than the second. 00238 */ 00239 int psCompareDescendingU64Ptr( 00240 const void **a, ///< first comparison target 00241 const void **b ///< second comparison target 00242 ); 00243 00244 /** Compare function of psF32 data. For use with psListSort for descending ordering. 00245 * 00246 * @return int an integer less than, equal to, or greater than zero if 00247 * the first argument is considered to be respectively greater 00248 * than, equal to, or lessg than the second. 00249 */ 00250 int psCompareDescendingF32Ptr( 00251 const void **a, ///< first comparison target 00252 const void **b ///< second comparison target 00253 ); 00254 00255 /** Compare function of psF64 data. For use with psListSort for descending ordering. 00256 * 00257 * @return int an integer less than, equal to, or greater than zero if 00258 * the first argument is considered to be respectively greater 00259 * than, equal to, or lessg than the second. 00260 */ 00261 int psCompareDescendingF64Ptr( 00262 const void **a, ///< first comparison target 00263 const void **b ///< second comparison target 00264 ); 00265 00266 /** Compare function of psS8 data. 00267 * 00268 * @return int an integer less than, equal to, or greater than zero if 00269 * the first argument is considered to be respectively less 00270 * than, equal to, or greater than the second. 00271 */ 00272 int psCompareS8( 00273 const void *a, ///< first comparison target 00274 const void *b ///< second comparison target 00275 ); 00276 00277 00278 /** Compare function of psS16 data. 00279 * 00280 * @return int an integer less than, equal to, or greater than zero if 00281 * the first argument is considered to be respectively less 00282 * than, equal to, or greater than the second. 00283 */ 00284 int psCompareS16( 00285 const void *a, ///< first comparison target 00286 const void *b ///< second comparison target 00287 ); 00288 00289 00290 /** Compare function of psS32 data. 00291 * 00292 * @return int an integer less than, equal to, or greater than zero if 00293 * the first argument is considered to be respectively less 00294 * than, equal to, or greater than the second. 00295 */ 00296 int psCompareS32( 00297 const void *a, ///< first comparison target 00298 const void *b ///< second comparison target 00299 ); 00300 00301 00302 /** Compare function of psS64 data. 00303 * 00304 * @return int an integer less than, equal to, or greater than zero if 00305 * the first argument is considered to be respectively less 00306 * than, equal to, or greater than the second. 00307 */ 00308 int psCompareS64( 00309 const void *a, ///< first comparison target 00310 const void *b ///< second comparison target 00311 ); 00312 00313 00314 /** Compare function of psU8 data. 00315 * 00316 * @return int an integer less than, equal to, or greater than zero if 00317 * the first argument is considered to be respectively less 00318 * than, equal to, or greater than the second. 00319 */ 00320 int psCompareU8( 00321 const void *a, ///< first comparison target 00322 const void *b ///< second comparison target 00323 ); 00324 00325 00326 /** Compare function of psU16 data. 00327 * 00328 * @return int an integer less than, equal to, or greater than zero if 00329 * the first argument is considered to be respectively less 00330 * than, equal to, or greater than the second. 00331 */ 00332 int psCompareU16( 00333 const void *a, ///< first comparison target 00334 const void *b ///< second comparison target 00335 ); 00336 00337 00338 /** Compare function of psU32 data. 00339 * 00340 * @return int an integer less than, equal to, or greater than zero if 00341 * the first argument is considered to be respectively less 00342 * than, equal to, or greater than the second. 00343 */ 00344 int psCompareU32( 00345 const void *a, ///< first comparison target 00346 const void *b ///< second comparison target 00347 ); 00348 00349 00350 /** Compare function of psU64 data. 00351 * 00352 * @return int an integer less than, equal to, or greater than zero if 00353 * the first argument is considered to be respectively less 00354 * than, equal to, or greater than the second. 00355 */ 00356 int psCompareU64( 00357 const void *a, ///< first comparison target 00358 const void *b ///< second comparison target 00359 ); 00360 00361 00362 /** Compare function of psF32 data. 00363 * 00364 * @return int an integer less than, equal to, or greater than zero if 00365 * the first argument is considered to be respectively less 00366 * than, equal to, or greater than the second. 00367 */ 00368 int psCompareF32( 00369 const void *a, ///< first comparison target 00370 const void *b ///< second comparison target 00371 ); 00372 00373 00374 /** Compare function of psF64 data. 00375 * 00376 * @return int an integer less than, equal to, or greater than zero if 00377 * the first argument is considered to be respectively less 00378 * than, equal to, or greater than the second. 00379 */ 00380 int psCompareF64( 00381 const void *a, ///< first comparison target 00382 const void *b ///< second comparison target 00383 ); 00384 00385 00386 /** Compare function of psS8 data. 00387 * 00388 * @return int an integer less than, equal to, or greater than zero if 00389 * the first argument is considered to be respectively greater 00390 * than, equal to, or less than the second. 00391 */ 00392 int psCompareDescendingS8( 00393 const void *a, ///< first comparison target 00394 const void *b ///< second comparison target 00395 ); 00396 00397 00398 /** Compare function of psS16 data. 00399 * 00400 * @return int an integer less than, equal to, or greater than zero if 00401 * the first argument is considered to be respectively greater 00402 * than, equal to, or less than the second. 00403 */ 00404 int psCompareDescendingS16( 00405 const void *a, ///< first comparison target 00406 const void *b ///< second comparison target 00407 ); 00408 00409 00410 /** Compare function of psS32 data. 00411 * 00412 * @return int an integer less than, equal to, or greater than zero if 00413 * the first argument is considered to be respectively greater 00414 * than, equal to, or less than the second. 00415 */ 00416 int psCompareDescendingS32( 00417 const void *a, ///< first comparison target 00418 const void *b ///< second comparison target 00419 ); 00420 00421 00422 /** Compare function of psS64 data. 00423 * 00424 * @return int an integer less than, equal to, or greater than zero if 00425 * the first argument is considered to be respectively greater 00426 * than, equal to, or less than the second. 00427 */ 00428 int psCompareDescendingS64( 00429 const void *a, ///< first comparison target 00430 const void *b ///< second comparison target 00431 ); 00432 00433 00434 /** Compare function of psU8 data. 00435 * 00436 * @return int an integer less than, equal to, or greater than zero if 00437 * the first argument is considered to be respectively greater 00438 * than, equal to, or less than the second. 00439 */ 00440 int psCompareDescendingU8( 00441 const void *a, ///< first comparison target 00442 const void *b ///< second comparison target 00443 ); 00444 00445 00446 /** Compare function of psU16 data. 00447 * 00448 * @return int an integer less than, equal to, or greater than zero if 00449 * the first argument is considered to be respectively greater 00450 * than, equal to, or less than the second. 00451 */ 00452 int psCompareDescendingU16( 00453 const void *a, ///< first comparison target 00454 const void *b ///< second comparison target 00455 ); 00456 00457 00458 /** Compare function of psU32 data. 00459 * 00460 * @return int an integer less than, equal to, or greater than zero if 00461 * the first argument is considered to be respectively greater 00462 * than, equal to, or less than the second. 00463 */ 00464 int psCompareDescendingU32( 00465 const void *a, ///< first comparison target 00466 const void *b ///< second comparison target 00467 ); 00468 00469 00470 /** Compare function of psU64 data. 00471 * 00472 * @return int an integer less than, equal to, or greater than zero if 00473 * the first argument is considered to be respectively greater 00474 * than, equal to, or less than the second. 00475 */ 00476 int psCompareDescendingU64( 00477 const void *a, ///< first comparison target 00478 const void *b ///< second comparison target 00479 ); 00480 00481 00482 /** Compare function of psF32 data. 00483 * 00484 * @return int an integer less than, equal to, or greater than zero if 00485 * the first argument is considered to be respectively greater 00486 * than, equal to, or less than the second. 00487 */ 00488 int psCompareDescendingF32( 00489 const void *a, ///< first comparison target 00490 const void *b ///< second comparison target 00491 ); 00492 00493 00494 /** Compare function of psF64 data. 00495 * 00496 * @return int an integer less than, equal to, or greater than zero if 00497 * the first argument is considered to be respectively greater 00498 * than, equal to, or less than the second. 00499 */ 00500 int psCompareDescendingF64( 00501 const void *a, ///< first comparison target 00502 const void *b ///< second comparison target 00503 ); 00504 00505 00506 /// @} 00507 00508 #endif // #ifndef PS_COMPARE_H
1.4.2