comparison mupdf-source/thirdparty/curl/docs/libcurl/curl_url_get.3 @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 .\" **************************************************************************
2 .\" * _ _ ____ _
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .TH curl_url_get 3 "6 Aug 2018" "libcurl" "libcurl Manual"
23 .SH NAME
24 curl_url_get - extract a part from a URL
25 .SH SYNOPSIS
26 .B #include <curl/curl.h>
27
28 .nf
29 CURLUcode curl_url_get(CURLU *url,
30 CURLUPart what,
31 char **part,
32 unsigned int flags)
33 .fi
34 .SH DESCRIPTION
35 Given the \fIurl\fP handle of an already parsed URL, this function lets the
36 user extract individual pieces from it.
37
38 The \fIwhat\fP argument should be the particular part to extract (see list
39 below) and \fIpart\fP points to a 'char *' to get updated to point to a newly
40 allocated string with the contents.
41
42 The \fIflags\fP argument is a bitmask with individual features.
43
44 The returned part pointer must be freed with \fIcurl_free(3)\fP after use.
45 .SH FLAGS
46 The flags argument is zero, one or more bits set in a bitmask.
47 .IP CURLU_DEFAULT_PORT
48 If the handle has no port stored, this option will make \fIcurl_url_get(3)\fP
49 return the default port for the used scheme.
50 .IP CURLU_DEFAULT_SCHEME
51 If the handle has no scheme stored, this option will make
52 \fIcurl_url_get(3)\fP return the default scheme instead of error.
53 .IP CURLU_NO_DEFAULT_PORT
54 Instructs \fIcurl_url_get(3)\fP to not return a port number if it matches the
55 default port for the scheme.
56 .IP CURLU_URLDECODE
57 Asks \fIcurl_url_get(3)\fP to URL decode the contents before returning it. It
58 will not attempt to decode the scheme, the port number or the full URL.
59
60 The query component will also get plus-to-space conversion as a bonus when
61 this bit is set.
62
63 Note that this URL decoding is charset unaware and you will get a zero
64 terminated string back with data that could be intended for a particular
65 encoding.
66
67 If there's any byte values lower than 32 in the decoded string, the get
68 operation will return an error instead.
69 .SH PARTS
70 .IP CURLUPART_URL
71 When asked to return the full URL, \fIcurl_url_get(3)\fP will return a
72 normalized and possibly cleaned up version of what was previously parsed.
73 .IP CURLUPART_SCHEME
74 Scheme cannot be URL decoded on get.
75 .IP CURLUPART_USER
76 .IP CURLUPART_PASSWORD
77 .IP CURLUPART_OPTIONS
78 .IP CURLUPART_HOST
79 If the host part is an IPv6 numeric address, the zoneid will not be part of
80 the extracted host but is provided separately in \fICURLUPART_ZONEID\fP.
81 .IP CURLUPART_ZONEID
82 If the host name is a numeric IPv6 address, this field might also be set.
83 .IP CURLUPART_PORT
84 Port cannot be URL decoded on get.
85 .IP CURLUPART_PATH
86 .IP CURLUPART_QUERY
87 The query part will also get pluses converted to space when asked to URL
88 decode on get with the CURLU_URLDECODE bit.
89 .IP CURLUPART_FRAGMENT
90 .SH RETURN VALUE
91 Returns a CURLUcode error value, which is CURLUE_OK (0) if everything went
92 fine.
93
94 If this function returns an error, no URL part is returned.
95 .SH EXAMPLE
96 .nf
97 CURLUcode rc;
98 CURLU *url = curl_url();
99 rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
100 if(!rc) {
101 char *scheme;
102 rc = curl_url_get(url, CURLUPART_SCHEME, &scheme, 0);
103 if(!rc) {
104 printf("the scheme is %s\\n", scheme);
105 curl_free(scheme);
106 }
107 curl_url_cleanup(url);
108 }
109 .fi
110 .SH AVAILABILITY
111 Added in curl 7.62.0. CURLUPART_ZONEID was added in 7.65.0.
112 .SH "SEE ALSO"
113 .BR curl_url_cleanup "(3), " curl_url "(3), " curl_url_set "(3), "
114 .BR curl_url_dup "(3), "