~ubuntu-branches/ubuntu/feisty/curl/feisty-updates

« back to all changes in this revision

Viewing changes to lib/llist.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-07-26 19:03:01 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20050726190301-x2m2vmjgc8fwnic5
Tags: 7.14.0-2ubuntu1
Synchronize with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: llist.c,v 1.15 2004/06/24 07:43:49 bagder Exp $
 
21
 * $Id: llist.c,v 1.16 2005/01/25 00:06:29 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
33
33
#include "memdebug.h"
34
34
 
35
35
void
36
 
Curl_llist_init(curl_llist *l, curl_llist_dtor dtor)
 
36
Curl_llist_init(struct curl_llist *l, curl_llist_dtor dtor)
37
37
{
38
38
  l->size = 0;
39
39
  l->dtor = dtor;
41
41
  l->tail = NULL;
42
42
}
43
43
 
44
 
curl_llist *
 
44
struct curl_llist *
45
45
Curl_llist_alloc(curl_llist_dtor dtor)
46
46
{
47
 
  curl_llist *list;
 
47
  struct curl_llist *list;
48
48
 
49
 
  list = (curl_llist *)malloc(sizeof(curl_llist));
 
49
  list = (struct curl_llist *)malloc(sizeof(struct curl_llist));
50
50
  if(NULL == list)
51
51
    return NULL;
52
52
 
59
59
 * Curl_llist_insert_next() returns 1 on success and 0 on failure.
60
60
 */
61
61
int
62
 
Curl_llist_insert_next(curl_llist *list, curl_llist_element *e, const void *p)
 
62
Curl_llist_insert_next(struct curl_llist *list, struct curl_llist_element *e,
 
63
                       const void *p)
63
64
{
64
 
  curl_llist_element *ne =
65
 
    (curl_llist_element *) malloc(sizeof(curl_llist_element));
 
65
  struct curl_llist_element *ne =
 
66
    (struct curl_llist_element *) malloc(sizeof(struct curl_llist_element));
66
67
  if(!ne)
67
68
    return 0;
68
69
 
91
92
}
92
93
 
93
94
int
94
 
Curl_llist_remove(curl_llist *list, curl_llist_element *e, void *user)
 
95
Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e,
 
96
                  void *user)
95
97
{
96
98
  if (e == NULL || list->size == 0)
97
99
    return 1;
119
121
}
120
122
 
121
123
void
122
 
Curl_llist_destroy(curl_llist *list, void *user)
 
124
Curl_llist_destroy(struct curl_llist *list, void *user)
123
125
{
124
126
  if(list) {
125
127
    while (list->size > 0)