X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=trunk%2Fsrc%2Flist.h;fp=trunk%2Fsrc%2Flist.h;h=54fbf282514a211939c4d0d829637c7390ec513b;hb=b19be7b6db9f737f9a9a22b3079abc774cc7583c;hp=0000000000000000000000000000000000000000;hpb=b19f912053682528d7efa15aa5641a1f055f3038;p=ppastats.git diff --git a/trunk/src/list.h b/trunk/src/list.h new file mode 100644 index 0000000..54fbf28 --- /dev/null +++ b/trunk/src/list.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2011 jeanfi@gmail.com + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _PPASTATS_LIST_H_ +#define _PPASTATS_LIST_H_ + +/* + * Convenience functions for manipulating null-terminated list of + * pointers. + */ + +/* Returns the number of items in the list. */ +int list_length(void **list); + +/* + * Adds item into a list. + * + * Returns a new allocated list containing all items. + */ +void **list_add(void **list, void *new_item); + +/* + * Appends all items of two lists. + * + * Returns a new allocated list containing all items. + */ +void **list_append_list(void **list1, void **list2); + +#endif