summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/splay.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-10-08 20:30:41 (GMT)
committerBrad King <brad.king@kitware.com>2014-10-29 20:43:21 (GMT)
commit80c881f7938969dab169f4fc4fbf8bc3d4355fc2 (patch)
tree77abe643bf8fcb388056480350b99b666f543965 /Utilities/cmcurl/lib/splay.h
parentff67d2b57946a29e18d1947efe71f26ece9e1747 (diff)
parent3fe5d9bff98b4716e219516c30d71462495324f4 (diff)
downloadCMake-80c881f7938969dab169f4fc4fbf8bc3d4355fc2.zip
CMake-80c881f7938969dab169f4fc4fbf8bc3d4355fc2.tar.gz
CMake-80c881f7938969dab169f4fc4fbf8bc3d4355fc2.tar.bz2
Merge branch 'curl-upstream' into update-curl
Resolve all conflicts in favor of the upstream side. We can re-apply specific changes later.
Diffstat (limited to 'Utilities/cmcurl/lib/splay.h')
-rw-r--r--Utilities/cmcurl/lib/splay.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/Utilities/cmcurl/lib/splay.h b/Utilities/cmcurl/lib/splay.h
index 1674534..5f9ef24 100644
--- a/Utilities/cmcurl/lib/splay.h
+++ b/Utilities/cmcurl/lib/splay.h
@@ -1,5 +1,5 @@
-#ifndef __SPLAY_H
-#define __SPLAY_H
+#ifndef HEADER_CURL_SPLAY_H
+#define HEADER_CURL_SPLAY_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1997 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1997 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -20,35 +20,47 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id$
***************************************************************************/
+#include "curl_setup.h"
struct Curl_tree {
struct Curl_tree *smaller; /* smaller node */
struct Curl_tree *larger; /* larger node */
struct Curl_tree *same; /* points to a node with identical key */
- int key; /* the "sort" key */
+ struct timeval key; /* this node's "sort" key */
void *payload; /* data the splay code doesn't care about */
};
-struct Curl_tree *Curl_splay(int i, struct Curl_tree *t);
-struct Curl_tree *Curl_splayinsert(int key, struct Curl_tree *t,
+struct Curl_tree *Curl_splay(struct timeval i,
+ struct Curl_tree *t);
+
+struct Curl_tree *Curl_splayinsert(struct timeval key,
+ struct Curl_tree *t,
struct Curl_tree *newnode);
+
#if 0
-struct Curl_tree *Curl_splayremove(int key, struct Curl_tree *t,
+struct Curl_tree *Curl_splayremove(struct timeval key,
+ struct Curl_tree *t,
struct Curl_tree **removed);
#endif
-struct Curl_tree *Curl_splaygetbest(int key, struct Curl_tree *t,
+struct Curl_tree *Curl_splaygetbest(struct timeval key,
+ struct Curl_tree *t,
struct Curl_tree **removed);
+
int Curl_splayremovebyaddr(struct Curl_tree *t,
- struct Curl_tree *remove,
+ struct Curl_tree *removenode,
struct Curl_tree **newroot);
-#ifdef CURLDEBUG
+#define Curl_splaycomparekeys(i,j) ( ((i.tv_sec) < (j.tv_sec)) ? -1 : \
+ ( ((i.tv_sec) > (j.tv_sec)) ? 1 : \
+ ( ((i.tv_usec) < (j.tv_usec)) ? -1 : \
+ ( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0 ))))
+
+#ifdef DEBUGBUILD
void Curl_splayprint(struct Curl_tree * t, int d, char output);
#else
-#define Curl_splayprint(x,y,z)
+#define Curl_splayprint(x,y,z) Curl_nop_stmt
#endif
-#endif
+#endif /* HEADER_CURL_SPLAY_H */