splay.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_SPLAY_H
00002 #define HEADER_CURL_SPLAY_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1997 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 #include "curl_setup.h"
00025 
00026 struct Curl_tree {
00027   struct Curl_tree *smaller; /* smaller node */
00028   struct Curl_tree *larger;  /* larger node */
00029   struct Curl_tree *same;    /* points to a node with identical key */
00030   struct timeval key;        /* this node's "sort" key */
00031   void *payload;             /* data the splay code doesn't care about */
00032 };
00033 
00034 struct Curl_tree *Curl_splay(struct timeval i,
00035                              struct Curl_tree *t);
00036 
00037 struct Curl_tree *Curl_splayinsert(struct timeval key,
00038                                    struct Curl_tree *t,
00039                                    struct Curl_tree *newnode);
00040 
00041 #if 0
00042 struct Curl_tree *Curl_splayremove(struct timeval key,
00043                                    struct Curl_tree *t,
00044                                    struct Curl_tree **removed);
00045 #endif
00046 
00047 struct Curl_tree *Curl_splaygetbest(struct timeval key,
00048                                     struct Curl_tree *t,
00049                                     struct Curl_tree **removed);
00050 
00051 int Curl_splayremovebyaddr(struct Curl_tree *t,
00052                            struct Curl_tree *removenode,
00053                            struct Curl_tree **newroot);
00054 
00055 #define Curl_splaycomparekeys(i,j) ( ((i.tv_sec)  < (j.tv_sec))  ? -1 : \
00056                                    ( ((i.tv_sec)  > (j.tv_sec))  ?  1 : \
00057                                    ( ((i.tv_usec) < (j.tv_usec)) ? -1 : \
00058                                    ( ((i.tv_usec) > (j.tv_usec)) ?  1 : 0))))
00059 
00060 #ifdef DEBUGBUILD
00061 void Curl_splayprint(struct Curl_tree * t, int d, char output);
00062 #else
00063 #define Curl_splayprint(x,y,z) Curl_nop_stmt
00064 #endif
00065 
00066 #endif /* HEADER_CURL_SPLAY_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:06