Parse and identify different URL schemes. More...
#include "config.h"#include <stdbool.h>#include <string.h>#include "mutt/lib.h"#include "url.h"#include "mime.h"
Include dependency graph for url.c:Go to the source code of this file.
Functions | |
| static bool | parse_query_string (struct UrlQueryList *list, char *src) |
| Parse a URL query string. | |
| static enum UrlScheme | get_scheme (const char *src, const regmatch_t *match) |
| Extract the scheme part from a matched URL. | |
| static struct Url * | url_new (void) |
| Create a Url. | |
| void | url_free (struct Url **ptr) |
| Free the contents of a URL. | |
| void | url_pct_encode (char *buf, size_t buflen, const char *src) |
| Percent-encode a string. | |
| int | url_pct_decode (char *s) |
| Decode a percent-encoded string. | |
| enum UrlScheme | url_check_scheme (const char *str) |
| Check the protocol of a URL. | |
| struct Url * | url_parse (const char *src) |
| Fill in Url. | |
| int | url_tobuffer (const struct Url *url, struct Buffer *buf, uint8_t flags) |
| Output the URL string for a given Url object. | |
| int | url_tostring (const struct Url *url, char *dest, size_t len, uint8_t flags) |
| Output the URL string for a given Url object. | |
Variables | |
| static const struct Mapping | UrlMap [] |
| Constants for URL protocols. | |
Parse and identify different URL schemes.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file url.c.
|
static |
Parse a URL query string.
| list | List to store the results |
| src | String to parse |
| true | Success |
| false | Error |
Definition at line 55 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Extract the scheme part from a matched URL.
| src | Original string that was matched |
| match | Result from a matched regex |
| enum | Scheme |
Definition at line 96 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| void url_free | ( | struct Url ** | ptr | ) |
Free the contents of a URL.
| ptr | Url to free |
Definition at line 123 of file url.c.
Here is the caller graph for this function:| void url_pct_encode | ( | char * | buf, |
| size_t | buflen, | ||
| const char * | src | ||
| ) |
Percent-encode a string.
| buf | Buffer for the result |
| buflen | Length of buffer |
| src | String to encode |
e.g. turn "hello world" into "hello%20world"
Definition at line 151 of file url.c.
Here is the caller graph for this function:| int url_pct_decode | ( | char * | s | ) |
Decode a percent-encoded string.
| s | String to decode |
| 0 | Success |
| -1 | Error |
e.g. turn "hello%20world" into "hello world" The string is decoded in-place.
Definition at line 189 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:| enum UrlScheme url_check_scheme | ( | const char * | str | ) |
Check the protocol of a URL.
| str | String to check |
| enum | UrlScheme, e.g. U_IMAPS |
Definition at line 225 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct Url * url_parse | ( | const char * | src | ) |
Fill in Url.
| src | String to parse |
| ptr | Parsed URL |
| NULL | Error |
Definition at line 238 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:Output the URL string for a given Url object.
| 0 | Success |
| -1 | Error |
Definition at line 357 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int url_tostring | ( | const struct Url * | url, |
| char * | dest, | ||
| size_t | len, | ||
| uint8_t | flags | ||
| ) |
Output the URL string for a given Url object.
| url | Url to turn into a string |
| dest | Buffer for the result |
| len | Length of buffer |
| flags | Flags, e.g. U_PATH |
| 0 | Success |
| -1 | Error |
Definition at line 422 of file url.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Constants for URL protocols.