andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: /* andre@0: * pkix_list.h andre@0: * andre@0: * List Object Type Definition andre@0: * andre@0: */ andre@0: andre@0: #ifndef _PKIX_LIST_H andre@0: #define _PKIX_LIST_H andre@0: andre@0: #include "pkix_tools.h" andre@0: andre@0: #ifdef __cplusplus andre@0: extern "C" { andre@0: #endif andre@0: andre@0: typedef PKIX_Error * andre@0: (*PKIX_List_SortComparatorCallback)( andre@0: PKIX_PL_Object *obj1, andre@0: PKIX_PL_Object *obj2, andre@0: PKIX_Int32 *pResult, andre@0: void *plContext); andre@0: andre@0: struct PKIX_ListStruct { andre@0: PKIX_PL_Object *item; andre@0: PKIX_List *next; andre@0: PKIX_Boolean immutable; andre@0: PKIX_UInt32 length; andre@0: PKIX_Boolean isHeader; andre@0: }; andre@0: andre@0: /* see source file for function documentation */ andre@0: andre@0: PKIX_Error *pkix_List_RegisterSelf(void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_Contains( andre@0: PKIX_List *list, andre@0: PKIX_PL_Object *object, andre@0: PKIX_Boolean *pFound, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_Remove( andre@0: PKIX_List *list, andre@0: PKIX_PL_Object *target, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_MergeLists( andre@0: PKIX_List *firstList, andre@0: PKIX_List *secondList, andre@0: PKIX_List **pMergedList, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_AppendList( andre@0: PKIX_List *toList, andre@0: PKIX_List *fromList, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_AppendUnique( andre@0: PKIX_List *toList, andre@0: PKIX_List *fromList, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_RemoveItems( andre@0: PKIX_List *list, andre@0: PKIX_List *deleteList, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_QuickSort( andre@0: PKIX_List *fromList, andre@0: PKIX_List_SortComparatorCallback comparator, andre@0: PKIX_List **pSortedList, andre@0: void *plContext); andre@0: andre@0: PKIX_Error * andre@0: pkix_List_BubbleSort( andre@0: PKIX_List *fromList, andre@0: PKIX_List_SortComparatorCallback comparator, andre@0: PKIX_List **pSortedList, andre@0: void *plContext); andre@0: andre@0: #ifdef __cplusplus andre@0: } andre@0: #endif andre@0: andre@0: #endif /* _PKIX_LIST_H */