1 /* 2 * Check: a unit test framework for C 3 * Copyright (C) 2001, 2002 Arien Malec 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 18 * MA 02110-1301, USA. 19 */ 20 21 #ifndef CHECK_LIST_H 22 #define CHECK_LIST_H 23 24 #include <stdbool.h> 25 26 typedef struct List List; 27 28 /* Create an empty list */ 29 List *check_list_create (void); 30 31 /* Is list at end? */ 32 int check_list_at_end (List * lp); 33 34 /* Position list at front */ 35 void check_list_front (List * lp); 36 37 /* Add a value to the front of the list, 38 positioning newly added value as current value. 39 More expensive than list_add_end, as it uses memmove. */ 40 void check_list_add_front (List * lp, void *val); 41 42 /* Add a value to the end of the list, 43 positioning newly added value as current value */ 44 void check_list_add_end (List * lp, void *val); 45 46 /* Give the value of the current node */ 47 void *check_list_val (List * lp); 48 49 /* Position the list at the next node */ 50 void check_list_advance (List * lp); 51 52 /* Free a list, but don't free values */ 53 void check_list_free (List * lp); 54 55 void check_list_apply (List * lp, void (*fp) (void *)); 56 57 /* Return true if the list contains the value, false otherwise */ 58 bool check_list_contains (List * lp, void *val); 59 60 61 #endif /* CHECK_LIST_H */ 62