mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[uri] enum uri_component -> uri_component_T
This commit is contained in:
parent
86a6326ee2
commit
28a263eac7
@ -84,7 +84,7 @@ html_form(struct html_context *html_context, char *a,
|
||||
mem_free(al);
|
||||
|
||||
} else {
|
||||
enum uri_component components = URI_ORIGINAL;
|
||||
uri_component_T components = URI_ORIGINAL;
|
||||
|
||||
mem_free_if(al);
|
||||
|
||||
|
@ -380,7 +380,7 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
||||
render_encoded_document(cached, document);
|
||||
sort_links(document);
|
||||
if (!document->title) {
|
||||
enum uri_component components;
|
||||
uri_component_T components;
|
||||
|
||||
if (document->uri->protocol == PROTOCOL_FILE) {
|
||||
components = URI_PATH;
|
||||
|
@ -1260,7 +1260,7 @@ tags_html_form(struct source_renderer *renderer, void *node, unsigned char *a,
|
||||
form->action = join_urls(html_context->base_href, trim_chars(al, ' ', NULL));
|
||||
mem_free(al);
|
||||
} else {
|
||||
enum uri_component components = URI_ORIGINAL;
|
||||
uri_component_T components = URI_ORIGINAL;
|
||||
|
||||
mem_free_if(al);
|
||||
|
||||
|
@ -339,7 +339,7 @@ subst_user_agent(char *fmt, char *version,
|
||||
}
|
||||
|
||||
static void
|
||||
add_url_to_http_string(struct string *header, struct uri *uri, enum uri_component components)
|
||||
add_url_to_http_string(struct string *header, struct uri *uri, uri_component_T components)
|
||||
{
|
||||
/* This block substitues spaces in URL by %20s. This is
|
||||
* certainly not the right place where to do it, but now the
|
||||
|
@ -459,7 +459,7 @@ compare_component(const char *a, int alen,
|
||||
|
||||
int
|
||||
compare_uri(const struct uri *a, const struct uri *b,
|
||||
enum uri_component components)
|
||||
uri_component_T components)
|
||||
{
|
||||
if (a == b) return 1;
|
||||
if (!components) return 0;
|
||||
@ -489,7 +489,7 @@ compare_uri(const struct uri *a, const struct uri *b,
|
||||
/* We might need something more intelligent than this Swiss army knife. */
|
||||
struct string *
|
||||
add_uri_to_string(struct string *string, const struct uri *uri,
|
||||
enum uri_component components)
|
||||
uri_component_T components)
|
||||
{
|
||||
/* Custom or unknown keep the URI untouched. */
|
||||
if (uri->protocol == PROTOCOL_UNKNOWN)
|
||||
@ -671,7 +671,7 @@ add_uri_to_string(struct string *string, const struct uri *uri,
|
||||
#undef wants
|
||||
|
||||
char *
|
||||
get_uri_string(const struct uri *uri, enum uri_component components)
|
||||
get_uri_string(const struct uri *uri, uri_component_T components)
|
||||
{
|
||||
struct string string;
|
||||
|
||||
@ -686,7 +686,7 @@ get_uri_string(const struct uri *uri, enum uri_component components)
|
||||
|
||||
struct string *
|
||||
add_string_uri_to_string(struct string *string, char *uristring,
|
||||
enum uri_component components)
|
||||
uri_component_T components)
|
||||
{
|
||||
struct uri uri;
|
||||
|
||||
@ -1298,7 +1298,7 @@ parse_uri:
|
||||
|
||||
|
||||
struct uri *
|
||||
get_composed_uri(struct uri *uri, enum uri_component components)
|
||||
get_composed_uri(struct uri *uri, uri_component_T components)
|
||||
{
|
||||
char *string;
|
||||
|
||||
@ -1597,7 +1597,7 @@ get_uri_cache_entry(char *string, int length)
|
||||
}
|
||||
|
||||
struct uri *
|
||||
get_uri(char *string, enum uri_component components)
|
||||
get_uri(char *string, uri_component_T components)
|
||||
{
|
||||
struct uri_cache_entry *entry;
|
||||
|
||||
|
@ -216,6 +216,7 @@ enum uri_component {
|
||||
URI_FORM_GET = URI_SERVER | URI_PATH,
|
||||
};
|
||||
|
||||
typedef unsigned int uri_component_T;
|
||||
|
||||
/* List for maintaining multiple URIs. Free it with mem_free() */
|
||||
struct uri_list {
|
||||
@ -251,7 +252,7 @@ void free_uri_list(struct uri_list *list);
|
||||
|
||||
/* Register a new URI in the cache where @components controls which parts are
|
||||
* added to the returned URI. */
|
||||
struct uri *get_uri(char *string, enum uri_component components);
|
||||
struct uri *get_uri(char *string, uri_component_T components);
|
||||
|
||||
/* Dereference an URI from the cache */
|
||||
void done_uri(struct uri *uri);
|
||||
@ -265,7 +266,7 @@ get_uri_reference(struct uri *uri)
|
||||
}
|
||||
|
||||
/* Get URI using the string returned by get_uri_string(@uri, @components) */
|
||||
struct uri *get_composed_uri(struct uri *uri, enum uri_component components);
|
||||
struct uri *get_composed_uri(struct uri *uri, uri_component_T components);
|
||||
|
||||
/* Resolves an URI relative to a current working directory (CWD) and possibly
|
||||
* extracts the fragment. It is possible to just use it to extract fragment
|
||||
@ -282,7 +283,7 @@ char *normalize_uri(struct uri *uri, char *uristring);
|
||||
/* Check if two URIs are equal. If @components are 0 simply compare the whole
|
||||
* URI else only compare the specific parts. */
|
||||
int compare_uri(const struct uri *uri1, const struct uri *uri2,
|
||||
enum uri_component components);
|
||||
uri_component_T components);
|
||||
|
||||
/* These functions recreate the URI string part by part. */
|
||||
/* The @components bitmask describes the set of URI components used for
|
||||
@ -290,15 +291,15 @@ int compare_uri(const struct uri *uri1, const struct uri *uri2,
|
||||
|
||||
/* Adds the components to an already initialized string. */
|
||||
struct string *add_uri_to_string(struct string *string, const struct uri *uri,
|
||||
enum uri_component components);
|
||||
uri_component_T components);
|
||||
|
||||
/* Takes an uri string, parses it and adds the desired components. Useful if
|
||||
* there is no struct uri around. */
|
||||
struct string *add_string_uri_to_string(struct string *string, char *uristring, enum uri_component components);
|
||||
struct string *add_string_uri_to_string(struct string *string, char *uristring, uri_component_T components);
|
||||
|
||||
/* Returns the new URI string or NULL upon an error. */
|
||||
char *get_uri_string(const struct uri *uri,
|
||||
enum uri_component components);
|
||||
uri_component_T components);
|
||||
|
||||
/* Returns either the uri's port number if available or the protocol's
|
||||
* default port. It is zarro for user protocols. */
|
||||
|
Loading…
Reference in New Issue
Block a user