mk-ca-bundle.1: convert syntax to what's used elsewhere
[platform/upstream/curl.git] / lib / curl_conncache.h
1 #ifndef HEADER_CURL_CONNCACHE_H
2 #define HEADER_CURL_CONNCACHE_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 2012, Linus Nielsen Feltzing, <linus@haxx.se>
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  ***************************************************************************/
24
25 typedef enum {
26   CONNCACHE_PRIVATE, /* used for an easy handle alone */
27   CONNCACHE_MULTI    /* shared within a multi handle */
28 } conncachetype;
29
30 struct conncache {
31   struct curl_hash *hash;
32   conncachetype type;
33   size_t num_connections;
34 };
35
36 struct conncache *Curl_conncache_init(conncachetype type);
37
38 void Curl_conncache_destroy(struct conncache *connc);
39
40 struct connectbundle *Curl_conncache_find_bundle(struct conncache *connc,
41                                                  char *hostname);
42
43 CURLcode Curl_conncache_add_conn(struct conncache *connc,
44                                  struct connectdata *conn);
45
46 void Curl_conncache_remove_conn(struct conncache *connc,
47                                 struct connectdata *conn);
48
49 void Curl_conncache_foreach(struct conncache *connc,
50                             void *param,
51                             int (*func)(struct connectdata *conn,
52                                         void *param));
53
54 struct connectdata *
55 Curl_conncache_find_first_connection(struct conncache *connc);
56
57 void Curl_conncache_print(struct conncache *connc);
58
59 #endif /* HEADER_CURL_CONNCACHE_H */