added
[strongswan.git] / src / libstrongswan / utils / fetcher.h
1 /**
2 * @file fetcher.h
3 *
4 * @brief Interface of fetcher_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2007 Andreas Steffen
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <fetcher://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #ifndef FETCHER_H_
24 #define FETCHER_H_
25
26 typedef struct fetcher_t fetcher_t;
27
28 #include <chunk.h>
29
30 /**
31 * @brief Fetches information from an URI (http, file, ftp, etc.)
32 *
33 * @ingroup utils
34 */
35 struct fetcher_t {
36
37 /**
38 * @brief Get information via a get request.
39 *
40 * @param this calling object
41 * @param uri uri specifying where to get information from
42 * @return chunk_t containing the information
43 */
44 chunk_t (*get) (fetcher_t *this, chunk_t uri);
45
46 /**
47 * @brief Destroys the fetcher_t object.
48 *
49 * @param this fetcher_t to destroy
50 */
51 void (*destroy) (fetcher_t *this);
52
53 };
54
55 /**
56 * @brief Create a fetcher_t object.
57 *
58 * @return created fetcher_t object
59 *
60 * @ingroup transforms
61 */
62 fetcher_t *fetcher_create(void);
63
64 #endif /*FETCHER_H_*/