X-Git-Url: https://git.wpitchoune.net/gitweb/?p=ptask-pkg-ubuntu.git;a=blobdiff_plain;f=src%2Flist.c;fp=src%2Flist.c;h=0000000000000000000000000000000000000000;hp=0b6eb5d0d61a32b5a986621b0c9c1734cc97c09e;hb=997cc00138c36154429f4e3b5f63e48e2e570211;hpb=bee8ba898a41656226595f4c2718c1aaae99263e diff --git a/src/list.c b/src/list.c deleted file mode 100644 index 0b6eb5d..0000000 --- a/src/list.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010-2013 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 - */ - -#include -#include - -#include "list.h" - -int list_length(void **list) -{ - int n; - - if (!list) - return 0; - - n = 0; - while (*list) { - n++; - list++; - } - - return n; -} - -void **list_add(void **list, void *item) -{ - int n; - void **result; - - n = list_length(list); - - result = malloc((n + 1 + 1) * sizeof(void *)); - - if (list) - memcpy(result, list, n * sizeof(void *)); - - result[n] = item; - result[n + 1] = NULL; - - return result; -}