/* --------------------------------------------------------------------- */ /* BEGIN COPYRIGHT AND LICENSE NOTICE */ /* --------------------------------------------------------------------- */ /* ** Copyright (c) 2008, 2009 by Richard Harter. ** ** Permission is hereby granted, free of charge, to any person ** obtaining a copy of this software and associated documentation ** files (the "Software"), to deal in the Software without ** restriction, including without limitation the rights to use, ** copy, modify, merge, publish, distribute, sublicense, and/or ** sell copies of the Software, and to permit persons to whom the ** Software is furnished to do so, subject to the following ** conditions: ** ** The above copyright notice and this permission notice shall be ** included in copies of this software and in copies of substantial ** portions, whether or not the software has been modified. ** ** Derivative works shall include a notice that the software is a ** modified version of the copyrighted software. ** ** There is no guarantee that this software is useful for anything ** or that it is any way correct or of value. The author disclaims ** any responsibility for the consequences of using this software. ** */ /* --------------------------------------------------------------------- */ /* END COPYRIGHT AND LICENSE NOTICE */ /* --------------------------------------------------------------------- */ #ifndef HAVE_LISTPKG_H #define HAVE_LISTPKG_H typedef struct listhdr_s listhdr_s; typedef struct listnode_s listnode_s; struct listnode_s { listnode_s * link; void * data; }; struct listhdr_s { listnode_s * first; listnode_s * last; }; /* ---------------- prototypes --------------------- */ listhdr_s merge_two_lists (listhdr_s * list1, listhdr_s * list2); listhdr_s prepend_to_list (listhdr_s list , void * data); void append_to_list (listhdr_s * list , void * data); void * pop_from_list (listhdr_s * ); listhdr_s split_list_before_node (listhdr_s * list, listnode_s * dnode); listhdr_s split_list_after_node (listhdr_s * list, listnode_s * dnode); void delete_list (listhdr_s * list); listhdr_s transfer_list (listhdr_s * list); #endif