Go to the documentation of this file.00001 #ifndef HEADER_CURL_SPLAY_H
00002 #define HEADER_CURL_SPLAY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "curl_setup.h"
00025
00026 struct Curl_tree {
00027 struct Curl_tree *smaller;
00028 struct Curl_tree *larger;
00029 struct Curl_tree *same;
00030 struct timeval key;
00031 void *payload;
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