From 6de7dc5879b3605a180dafa05f792f132eafdcaa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 3 Jan 2002 10:22:59 +0000 Subject: Sterling Hughes' provided initial DNS cache source code. --- lib/llist.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lib/llist.h (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h new file mode 100644 index 000000000..f598a1cad --- /dev/null +++ b/lib/llist.h @@ -0,0 +1,64 @@ +#ifndef __LLIST_H +#define __LLIST_H +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2001, Daniel Stenberg, , et al + * + * In order to be useful for every potential user, curl and libcurl are + * dual-licensed under the MPL and the MIT/X-derivate licenses. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the MPL or the MIT/X-derivate + * licenses. You may pick one of these licenses. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + *****************************************************************************/ + +#include "setup.h" +#include + +typedef void (*curl_llist_dtor)(void *, void *); + +typedef struct _curl_llist_element { + void *ptr; + + struct _curl_llist_element *prev; + struct _curl_llist_element *next; +} curl_llist_element; + +typedef struct _curl_llist { + curl_llist_element *head; + curl_llist_element *tail; + + curl_llist_dtor dtor; + + size_t size; +} curl_llist; + +void curl_llist_init(curl_llist *, curl_llist_dtor); +curl_llist *curl_llist_alloc(curl_llist_dtor); +int curl_llist_insert_next(curl_llist *, curl_llist_element *, const void *); +int curl_llist_insert_prev(curl_llist *, curl_llist_element *, const void *); +int curl_llist_remove(curl_llist *, curl_llist_element *, void *); +int curl_llist_remove_next(curl_llist *, curl_llist_element *, void *); +size_t curl_llist_count(curl_llist *); +void curl_llist_destroy(curl_llist *, void *); + +#define CURL_LLIST_HEAD(__l) ((__l)->head) +#define CURL_LLIST_TAIL(__l) ((__l)->tail) +#define CURL_LLIST_NEXT(__e) ((__e)->next) +#define CURL_LLIST_PREV(__e) ((__e)->prev) +#define CURL_LLIST_VALP(__e) ((__e)->ptr) +#define CURL_LLIST_IS_TAIL(__e) ((__e)->next ? 0 : 1) +#define CURL_LLIST_IS_HEAD(__e) ((__e)->prev ? 0 : 1) + +#endif -- cgit v1.2.1 From 974f314f5785156af6983675aeb28313cc8ba2ea Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 19 Mar 2002 07:54:55 +0000 Subject: copyright string (year) update --- lib/llist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index f598a1cad..dca7ebbd2 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2001, Daniel Stenberg, , et al + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * * In order to be useful for every potential user, curl and libcurl are * dual-licensed under the MPL and the MIT/X-derivate licenses. -- cgit v1.2.1 From 8358505b6daec39a5bf0937a8524488a4e284912 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 27 Apr 2002 13:07:51 +0000 Subject: Now uses Curl_ as prefix for internal global symbols. curl_ should only be used for "exported" globals. --- lib/llist.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index dca7ebbd2..1b6105298 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -44,14 +44,14 @@ typedef struct _curl_llist { size_t size; } curl_llist; -void curl_llist_init(curl_llist *, curl_llist_dtor); -curl_llist *curl_llist_alloc(curl_llist_dtor); -int curl_llist_insert_next(curl_llist *, curl_llist_element *, const void *); -int curl_llist_insert_prev(curl_llist *, curl_llist_element *, const void *); -int curl_llist_remove(curl_llist *, curl_llist_element *, void *); -int curl_llist_remove_next(curl_llist *, curl_llist_element *, void *); -size_t curl_llist_count(curl_llist *); -void curl_llist_destroy(curl_llist *, void *); +void Curl_llist_init(curl_llist *, curl_llist_dtor); +curl_llist *Curl_llist_alloc(curl_llist_dtor); +int Curl_llist_insert_next(curl_llist *, curl_llist_element *, const void *); +int Curl_llist_insert_prev(curl_llist *, curl_llist_element *, const void *); +int Curl_llist_remove(curl_llist *, curl_llist_element *, void *); +int Curl_llist_remove_next(curl_llist *, curl_llist_element *, void *); +size_t Curl_llist_count(curl_llist *); +void Curl_llist_destroy(curl_llist *, void *); #define CURL_LLIST_HEAD(__l) ((__l)->head) #define CURL_LLIST_TAIL(__l) ((__l)->tail) -- cgit v1.2.1 From ba4e69bebc8f7f32f3bc7faa1e13e7580754075b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2002 11:52:59 +0000 Subject: updated source code boilerplate/header --- lib/llist.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index 1b6105298..fa38e74f3 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -1,6 +1,6 @@ #ifndef __LLIST_H #define __LLIST_H -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | @@ -9,19 +9,19 @@ * * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. - * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ #include "setup.h" #include -- cgit v1.2.1 From f26a338a54e04d0a6907f5d2479d8b0fa9daf297 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Jan 2003 21:08:12 +0000 Subject: copyright year update in the source header --- lib/llist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index fa38e74f3..80875c860 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From adcbe03aeb72e25c2c1509c0ad3fd1d1e620b6db Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Sep 2003 12:44:35 +0000 Subject: Uses less macros. #ifdef'ed out unused functions. Edited slightly to be more in the same style as other curl source code. The only actual code change is an added check after a malloc() call. --- lib/llist.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index 80875c860..146bad803 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -53,12 +53,4 @@ int Curl_llist_remove_next(curl_llist *, curl_llist_element *, void *); size_t Curl_llist_count(curl_llist *); void Curl_llist_destroy(curl_llist *, void *); -#define CURL_LLIST_HEAD(__l) ((__l)->head) -#define CURL_LLIST_TAIL(__l) ((__l)->tail) -#define CURL_LLIST_NEXT(__e) ((__e)->next) -#define CURL_LLIST_PREV(__e) ((__e)->prev) -#define CURL_LLIST_VALP(__e) ((__e)->ptr) -#define CURL_LLIST_IS_TAIL(__e) ((__e)->next ? 0 : 1) -#define CURL_LLIST_IS_HEAD(__e) ((__e)->prev ? 0 : 1) - #endif -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- lib/llist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index 146bad803..4f765138e 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 043d70fcdfa50c93dc826069aa5836206f8e3e2d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jan 2005 00:06:29 +0000 Subject: Use plain structs and not typedef'ed ones in the hash and linked-list code. --- lib/llist.h | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index 4f765138e..5c7a8a008 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -1,18 +1,18 @@ #ifndef __LLIST_H #define __LLIST_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. @@ -28,29 +28,33 @@ typedef void (*curl_llist_dtor)(void *, void *); -typedef struct _curl_llist_element { +struct curl_llist_element { void *ptr; - struct _curl_llist_element *prev; - struct _curl_llist_element *next; -} curl_llist_element; + struct curl_llist_element *prev; + struct curl_llist_element *next; +}; -typedef struct _curl_llist { - curl_llist_element *head; - curl_llist_element *tail; +struct curl_llist { + struct curl_llist_element *head; + struct curl_llist_element *tail; curl_llist_dtor dtor; size_t size; -} curl_llist; - -void Curl_llist_init(curl_llist *, curl_llist_dtor); -curl_llist *Curl_llist_alloc(curl_llist_dtor); -int Curl_llist_insert_next(curl_llist *, curl_llist_element *, const void *); -int Curl_llist_insert_prev(curl_llist *, curl_llist_element *, const void *); -int Curl_llist_remove(curl_llist *, curl_llist_element *, void *); -int Curl_llist_remove_next(curl_llist *, curl_llist_element *, void *); -size_t Curl_llist_count(curl_llist *); -void Curl_llist_destroy(curl_llist *, void *); +}; + +void Curl_llist_init(struct curl_llist *, curl_llist_dtor); +struct curl_llist *Curl_llist_alloc(curl_llist_dtor); +int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *, + const void *); +int Curl_llist_insert_prev(struct curl_llist *, struct curl_llist_element *, + const void *); +int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *, + void *); +int Curl_llist_remove_next(struct curl_llist *, struct curl_llist_element *, + void *); +size_t Curl_llist_count(struct curl_llist *); +void Curl_llist_destroy(struct curl_llist *, void *); #endif -- cgit v1.2.1 From b3de497d8316647d988e97703f975e0acd40cacd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 16 Jan 2008 12:24:00 +0000 Subject: Dmitry Kurochkin worked a lot on improving the HTTP Pipelining support that previously had a number of flaws, perhaps most notably when an application fired up N transfers at once as then they wouldn't pipeline at all that nicely as anyone would think... Test case 530 was also updated to take the improved functionality into account. --- lib/llist.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index 5c7a8a008..bf013898c 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -56,5 +56,7 @@ int Curl_llist_remove_next(struct curl_llist *, struct curl_llist_element *, void *); size_t Curl_llist_count(struct curl_llist *); void Curl_llist_destroy(struct curl_llist *, void *); +int Curl_llist_move(struct curl_llist *, struct curl_llist_element *, + struct curl_llist *, struct curl_llist_element *); #endif -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/llist.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index bf013898c..358d3d689 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ #include "setup.h" -- cgit v1.2.1 From 1d594772fd15143ad602ac90f5bb2f58f8b06f1a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 8 Aug 2010 23:49:49 +0200 Subject: llist: hide Curl_llist_init Curl_llist_init is never used outside of llist.c and thus it should be static. I also removed the protos for Curl_llist_insert_prev and Curl_llist_remove_next which are functions we removed from llist.c ages ago. --- lib/llist.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/llist.h') diff --git a/lib/llist.h b/lib/llist.h index 358d3d689..c33912a4b 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -43,16 +43,11 @@ struct curl_llist { size_t size; }; -void Curl_llist_init(struct curl_llist *, curl_llist_dtor); struct curl_llist *Curl_llist_alloc(curl_llist_dtor); int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *, const void *); -int Curl_llist_insert_prev(struct curl_llist *, struct curl_llist_element *, - const void *); int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *, void *); -int Curl_llist_remove_next(struct curl_llist *, struct curl_llist_element *, - void *); size_t Curl_llist_count(struct curl_llist *); void Curl_llist_destroy(struct curl_llist *, void *); int Curl_llist_move(struct curl_llist *, struct curl_llist_element *, -- cgit v1.2.1