Add generic iterators and a linked-list data structure to libsepol
PATCH 1/1 Add generic iterators and a linked-list data structure to libsepol
Add a generic iterator data structure and a linked-list implementation based that uses the iterators to libsepol. Includes test cases for the linked-list implementation.
libsepol/include/sepol/errcodes.h +3 -0
@@ -22,4 +22,7 @@#define SEPOL_EEXIST -EEXIST#define SEPOL_ENOENT -ENOENT +/* Custom error codes */ +#define SEPOL_ITERSTOP -500 +#endif
libsepol/include/sepol/iter.h new file +239 -0
239 lines not on this page · raw message
libsepol/include/sepol/list.h new file +232 -0
232 lines not on this page · raw message
libsepol/src/iter.c new file +186 -0
186 lines not on this page · raw message
libsepol/src/list.c new file +422 -0
422 lines not on this page · raw message
libsepol/tests/libsepol-tests.c +2 -0
@@ -22,6 +22,7 @@#include "test-linker.h" #include "test-expander.h" #include "test-deps.h" +#include "test-list.h" #include <CUnit/Basic.h> #include <CUnit/Console.h>
@@ -61,6 +62,7 @@ static int do_tests(int interactive, intDECLARE_SUITE (linker);DECLARE_SUITE (expander);DECLARE_SUITE (deps); +DECLARE_SUITE (list);if (verbose)CU_basic_set_mode (CU_BRM_VERBOSE );
libsepol/tests/test-list.c new file +373 -0
373 lines not on this page · raw message
libsepol/tests/test-list.h new file +12 -0
@@ -0,0 +1,12 @@ +/* Author : Karl MacMillan <[email protected]> */ + +#ifndef __test_list_h__ +#define __test_list_h__ + +#include <CUnit/Basic.h> + +int list_test_init (void ); +int list_test_cleanup (void ); +int list_add_tests (CU_pSuite suite); + +#endif
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 6 lines · Karl MacMillan
Add a generic iterator data structure and a linked-list implementation based that uses the iterators to libsepol. Includes test cases for the linked-list implementation.
Signed-off-by Karl MacMillan <[email protected]>
Actually - this patch is missing extern on most of the function definitions. Updated patch coming.
Karl
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.