Changeset 1111
- Timestamp:
- Jun 28, 2004, 10:36:37 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 added
- 7 edited
-
collections/Makefile (modified) (2 diffs)
-
collections/psCompare.c (added)
-
collections/psCompare.h (added)
-
collections/psList.c (modified) (3 diffs)
-
collections/psList.d (modified) (1 diff)
-
collections/psList.h (modified) (3 diffs)
-
math/psCompare.c (added)
-
math/psCompare.h (added)
-
sysUtils/psHash.d (modified) (1 diff)
-
types/psList.c (modified) (3 diffs)
-
types/psList.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/Makefile
r1061 r1111 3 3 ## Makefile: collections 4 4 ## 5 ## $Revision: 1.2 1$ $Name: not supported by cvs2svn $6 ## $Date: 2004-06- 18 23:36:27 $5 ## $Revision: 1.22 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-06-28 20:36:37 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 psImage.o \ 36 36 psList.o \ 37 psScalar.o 37 psScalar.o \ 38 psCompare.o 38 39 39 40 # Define PHONY target "all" which will make all the necessary items -
trunk/psLib/src/collections/psList.c
r1073 r1111 1 1 /** @file psList.c 2 2 * @brief Support for doubly linked lists 3 * @ingroup DataContainers3 * @ingroup LinkedList 4 4 * 5 5 * @author Robert Lupton, Princeton University 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-2 3 23:00:15$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-28 20:36:37 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 426 426 arr->n = list->size; 427 427 428 429 428 ptr = list->head; 430 429 n = list->size; … … 459 458 return list; 460 459 } 460 461 462 psList* psListSort(psList* list, psCompareFcn compare) 463 { 464 psVector* vector; 465 if (list == NULL) { 466 return NULL; 467 } 468 469 // convert to indexable vector for use by qsort. 470 vector = psListToVector(list); 471 psFree(list); 472 473 qsort(vector->data.V, vector->n, sizeof(void*), 474 (int(*)(const void *, const void *))compare); 475 476 // convert back to linked list 477 list = psVectorToList(vector); 478 479 return list; 480 } -
trunk/psLib/src/collections/psList.d
r986 r1111 1 1 psList.o psList.d : psList.c ../sysUtils/psError.h ../sysUtils/psAbort.h \ 2 ../sysUtils/psMemory.h psList.h ps Vector.h psType.h \2 ../sysUtils/psMemory.h psList.h psCompare.h psVector.h psType.h \ 3 3 ../sysUtils/psTrace.h ../sysUtils/psLogMsg.h -
trunk/psLib/src/collections/psList.h
r1073 r1111 10 10 * @ingroup LinkedList 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-06-2 3 23:00:15$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-28 20:36:37 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 18 18 #include <pthread.h> // we need a mutex to make this stuff thread safe. 19 19 20 #include "psCompare.h" 20 21 #include "psVector.h" 21 22 … … 181 182 ); 182 183 184 psList* psListSort(psList* list, psCompareFcn compare); 185 183 186 /// @} End of DataGroup Functions 184 187 185 188 #endif 189 -
trunk/psLib/src/sysUtils/psHash.d
r1073 r1111 1 1 psHash.o psHash.d : psHash.c psHash.h ../collections/psList.h \ 2 ../collections/ps Vector.h ../collections/psType.h psMemory.h psString.h \3 psTrace.h psAbort.h2 ../collections/psCompare.h ../collections/psVector.h \ 3 ../collections/psType.h psMemory.h psString.h psTrace.h psAbort.h -
trunk/psLib/src/types/psList.c
r1073 r1111 1 1 /** @file psList.c 2 2 * @brief Support for doubly linked lists 3 * @ingroup DataContainers3 * @ingroup LinkedList 4 4 * 5 5 * @author Robert Lupton, Princeton University 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-2 3 23:00:15$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-28 20:36:37 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 426 426 arr->n = list->size; 427 427 428 429 428 ptr = list->head; 430 429 n = list->size; … … 459 458 return list; 460 459 } 460 461 462 psList* psListSort(psList* list, psCompareFcn compare) 463 { 464 psVector* vector; 465 if (list == NULL) { 466 return NULL; 467 } 468 469 // convert to indexable vector for use by qsort. 470 vector = psListToVector(list); 471 psFree(list); 472 473 qsort(vector->data.V, vector->n, sizeof(void*), 474 (int(*)(const void *, const void *))compare); 475 476 // convert back to linked list 477 list = psVectorToList(vector); 478 479 return list; 480 } -
trunk/psLib/src/types/psList.h
r1073 r1111 10 10 * @ingroup LinkedList 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-06-2 3 23:00:15$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-28 20:36:37 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 18 18 #include <pthread.h> // we need a mutex to make this stuff thread safe. 19 19 20 #include "psCompare.h" 20 21 #include "psVector.h" 21 22 … … 181 182 ); 182 183 184 psList* psListSort(psList* list, psCompareFcn compare); 185 183 186 /// @} End of DataGroup Functions 184 187 185 188 #endif 189
Note:
See TracChangeset
for help on using the changeset viewer.
