Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / rpmio / rpmurl.h
1 #ifndef H_RPMURL
2 #define H_RPMURL
3
4 /** \ingroup rpmio
5  * \file rpmio/rpmurl.h
6  *
7  * A couple utils for URL Manipulation
8  */
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /** \ingroup rpmurl
15  * Supported URL types.
16  */
17 typedef enum urltype_e {
18     URL_IS_UNKNOWN      = 0,    /*!< unknown (aka a file) */
19     URL_IS_DASH         = 1,    /*!< stdin/stdout */
20     URL_IS_PATH         = 2,    /*!< file://... */
21     URL_IS_FTP          = 3,    /*!< ftp://... */
22     URL_IS_HTTP         = 4,    /*!< http://... */
23     URL_IS_HTTPS        = 5,    /*!< https://... */
24     URL_IS_HKP          = 6     /*!< hkp://... */
25 } urltype;
26
27 /** \ingroup rpmurl
28  * Return type of URL.
29  * @param url           url string
30  * @return              type of url
31  */
32 urltype urlIsURL(const char * url);
33
34 /** \ingroup rpmurl
35  * Return path component of URL.
36  * @param url           url string
37  * @retval pathp        pointer to path component of url
38  * @return              type of url
39  */
40 urltype urlPath(const char * url, const char ** pathp);
41
42 /** \ingroup rpmurl
43  * Copy data from URL to local file.
44  * @param url           url string of source
45  * @param dest          file name of destination
46  * @return              0 on success, -1 on error
47  */
48 int urlGetFile(const char * url, const char * dest);
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif  /* H_RPMURL */