ada.c.ada

Undocumented in source.

Members

Aliases

ada_strings
alias ada_strings = void*

An opaque pointer type representing a collection of strings (e.g., multiple values for a query parameter).

ada_url
alias ada_url = void*

An opaque pointer type representing a parsed URL in the Ada library.

ada_url_search_params
alias ada_url_search_params = void*

An opaque pointer type representing URL search (query) parameters in the Ada library.

ada_url_search_params_entries_iter
alias ada_url_search_params_entries_iter = void*

An opaque pointer type representing an iterator over search parameter key-value pairs.

ada_url_search_params_keys_iter
alias ada_url_search_params_keys_iter = void*

An opaque pointer type representing an iterator over search parameter keys.

ada_url_search_params_values_iter
alias ada_url_search_params_values_iter = void*

An opaque pointer type representing an iterator over search parameter values.

Functions

ada_can_parse
bool ada_can_parse(const(char)* input, size_t length)

Checks if a URL string can be parsed. The input must be a null-terminated C string (ASCII or UTF-8).

ada_can_parse_with_base
bool ada_can_parse_with_base(const(char)* input, size_t input_length, const(char)* base, size_t base_length)

Checks if a URL string can be parsed with a base URL. Both input and base must be null-terminated C strings (ASCII or UTF-8).

ada_clear_hash
void ada_clear_hash(ada_url result)

Clears the hash (fragment) component of a parsed URL. Has no effect if the URL is invalid.

ada_clear_port
void ada_clear_port(ada_url result)

Clears the port component of a parsed URL. Has no effect if the URL is invalid.

ada_clear_search
void ada_clear_search(ada_url result)

Clears the search (query) component of a parsed URL. Has no effect if the URL is invalid.

ada_copy
ada_url ada_copy(ada_url input)

Creates a copy of a parsed URL.

ada_free
void ada_free(ada_url result)

Frees the resources associated with a parsed URL.

ada_free_owned_string
void ada_free_owned_string(ada_owned_string owned)

Frees the resources associated with an owned string.

ada_free_search_params
void ada_free_search_params(ada_url_search_params result)

Frees the resources associated with search parameters.

ada_free_search_params_entries_iter
void ada_free_search_params_entries_iter(ada_url_search_params_entries_iter result)

Frees the resources associated with a search parameters entries iterator.

ada_free_search_params_keys_iter
void ada_free_search_params_keys_iter(ada_url_search_params_keys_iter result)

Frees the resources associated with a search parameters keys iterator.

ada_free_search_params_values_iter
void ada_free_search_params_values_iter(ada_url_search_params_values_iter result)

Frees the resources associated with a search parameters values iterator.

ada_free_strings
void ada_free_strings(ada_strings result)

Frees the resources associated with a string collection.

ada_get_components
ada_url_components* ada_get_components(ada_url result)

Retrieves the internal components of a parsed URL.

ada_get_hash
ada_string ada_get_hash(ada_url result)

Retrieves the hash (fragment) component of a parsed URL. Returns an empty string if the URL is invalid or no hash is present.

ada_get_host
ada_string ada_get_host(ada_url result)

Retrieves the host component of a parsed URL (hostname + port). Returns an empty string if the URL is invalid or no host is present.

ada_get_host_type
ubyte ada_get_host_type(ada_url result)

Retrieves the host type of a parsed URL. Returns an undefined value if the URL is invalid.

ada_get_hostname
ada_string ada_get_hostname(ada_url result)

Retrieves the hostname component of a parsed URL. Returns an empty string if the URL is invalid or no hostname is present.

ada_get_href
ada_string ada_get_href(ada_url result)

Retrieves the full URL (href) as a string. Returns an empty string if the URL is invalid.

ada_get_origin
ada_owned_string ada_get_origin(ada_url result)

Retrieves the origin of a parsed URL (e.g., protocol + host + port). Returns an empty string if the URL is invalid.

ada_get_password
ada_string ada_get_password(ada_url result)

Retrieves the password component of a parsed URL. Returns an empty string if the URL is invalid or no password is present.

ada_get_pathname
ada_string ada_get_pathname(ada_url result)

Retrieves the pathname component of a parsed URL. Returns an empty string if the URL is invalid or no pathname is present.

ada_get_port
ada_string ada_get_port(ada_url result)

Retrieves the port component of a parsed URL. Returns an empty string if the URL is invalid or no port is present.

ada_get_protocol
ada_string ada_get_protocol(ada_url result)

Retrieves the protocol component of a parsed URL (e.g., "http:"). Returns an empty string if the URL is invalid or no protocol is present.

ada_get_scheme_type
ubyte ada_get_scheme_type(ada_url result)

Retrieves the scheme type of a parsed URL. Returns an undefined value if the URL is invalid.

ada_get_search
ada_string ada_get_search(ada_url result)

Retrieves the search (query) component of a parsed URL. Returns an empty string if the URL is invalid or no search is present.

ada_get_username
ada_string ada_get_username(ada_url result)

Retrieves the username component of a parsed URL. Returns an empty string if the URL is invalid or no username is present.

ada_has_credentials
bool ada_has_credentials(ada_url result)

Checks if a parsed URL has credentials (username or password). Returns false if the URL is invalid.

ada_has_empty_hostname
bool ada_has_empty_hostname(ada_url result)

Checks if a parsed URL has an empty hostname. Returns false if the URL is invalid.

ada_has_hash
bool ada_has_hash(ada_url result)

Checks if a parsed URL has a hash (fragment). Returns false if the URL is invalid.

ada_has_hostname
bool ada_has_hostname(ada_url result)

Checks if a parsed URL has a hostname. Returns false if the URL is invalid.

ada_has_non_empty_password
bool ada_has_non_empty_password(ada_url result)

Checks if a parsed URL has a non-empty password. Returns false if the URL is invalid.

ada_has_non_empty_username
bool ada_has_non_empty_username(ada_url result)

Checks if a parsed URL has a non-empty username. Returns false if the URL is invalid.

ada_has_password
bool ada_has_password(ada_url result)

Checks if a parsed URL has a password. Returns false if the URL is invalid.

ada_has_port
bool ada_has_port(ada_url result)

Checks if a parsed URL has a port. Returns false if the URL is invalid.

ada_has_search
bool ada_has_search(ada_url result)

Checks if a parsed URL has a search (query) component. Returns false if the URL is invalid.

ada_idna_to_ascii
ada_owned_string ada_idna_to_ascii(const(char)* input, size_t length)

Converts a Unicode string to IDNA-encoded ASCII.

ada_idna_to_unicode
ada_owned_string ada_idna_to_unicode(const(char)* input, size_t length)

Converts an IDNA-encoded string to Unicode.

ada_is_valid
bool ada_is_valid(ada_url result)

Checks if a parsed URL is valid.

ada_parse
ada_url ada_parse(const(char)* input, size_t length)

Parses a URL string and returns a handle to the parsed URL. The input must be a null-terminated C string (ASCII or UTF-8).

ada_parse_search_params
ada_url_search_params ada_parse_search_params(const(char)* input, size_t length)

Parses a query string into search parameters.

ada_parse_with_base
ada_url ada_parse_with_base(const(char)* input, size_t input_length, const(char)* base, size_t base_length)

Parses a URL string with a base URL for relative URL resolution. Both input and base must be null-terminated C strings (ASCII or UTF-8).

ada_search_params_append
void ada_search_params_append(ada_url_search_params result, const(char)* key, size_t key_length, const(char)* value, size_t value_length)

Appends a key-value pair to search parameters.

ada_search_params_entries_iter_has_next
bool ada_search_params_entries_iter_has_next(ada_url_search_params_entries_iter result)

Checks if there are more key-value pairs in a search parameters entries iterator.

ada_search_params_entries_iter_next
ada_string_pair ada_search_params_entries_iter_next(ada_url_search_params_entries_iter result)

Retrieves the next key-value pair from a search parameters entries iterator.

ada_search_params_get
ada_string ada_search_params_get(ada_url_search_params result, const(char)* key, size_t key_length)

Retrieves the value for a given key in search parameters.

ada_search_params_get_all
ada_strings ada_search_params_get_all(ada_url_search_params result, const(char)* key, size_t key_length)

Retrieves all values for a given key in search parameters.

ada_search_params_get_entries
ada_url_search_params_entries_iter ada_search_params_get_entries(ada_url_search_params result)

Retrieves an iterator for the key-value pairs in search parameters.

ada_search_params_get_keys
ada_url_search_params_keys_iter ada_search_params_get_keys(ada_url_search_params result)

Retrieves an iterator for the keys in search parameters.

ada_search_params_get_values
ada_url_search_params_values_iter ada_search_params_get_values(ada_url_search_params result)

Retrieves an iterator for the values in search parameters.

ada_search_params_has
bool ada_search_params_has(ada_url_search_params result, const(char)* key, size_t key_length)

Checks if a key exists in search parameters.

ada_search_params_has_value
bool ada_search_params_has_value(ada_url_search_params result, const(char)* key, size_t key_length, const(char)* value, size_t value_length)

Checks if a key-value pair exists in search parameters.

ada_search_params_keys_iter_has_next
bool ada_search_params_keys_iter_has_next(ada_url_search_params_keys_iter result)

Checks if there are more keys in a search parameters keys iterator.

ada_search_params_keys_iter_next
ada_string ada_search_params_keys_iter_next(ada_url_search_params_keys_iter result)

Retrieves the next key from a search parameters keys iterator.

ada_search_params_remove
void ada_search_params_remove(ada_url_search_params result, const(char)* key, size_t key_length)

Removes all values for a given key in search parameters.

ada_search_params_remove_value
void ada_search_params_remove_value(ada_url_search_params result, const(char)* key, size_t key_length, const(char)* value, size_t value_length)

Removes a specific key-value pair from search parameters.

ada_search_params_reset
void ada_search_params_reset(ada_url_search_params result, const(char)* input, size_t length)

Resets search parameters to a new query string.

ada_search_params_set
void ada_search_params_set(ada_url_search_params result, const(char)* key, size_t key_length, const(char)* value, size_t value_length)

Sets a key-value pair in search parameters, replacing any existing values for the key.

ada_search_params_size
size_t ada_search_params_size(ada_url_search_params result)

Retrieves the number of key-value pairs in search parameters.

ada_search_params_sort
void ada_search_params_sort(ada_url_search_params result)

Sorts the search parameters by key.

ada_search_params_to_string
ada_owned_string ada_search_params_to_string(ada_url_search_params result)

Converts search parameters to a query string.

ada_search_params_values_iter_has_next
bool ada_search_params_values_iter_has_next(ada_url_search_params_values_iter result)

Checks if there are more values in a search parameters values iterator.

ada_search_params_values_iter_next
ada_string ada_search_params_values_iter_next(ada_url_search_params_values_iter result)

Retrieves the next value from a search parameters values iterator.

ada_set_hash
void ada_set_hash(ada_url result, const(char)* input, size_t length)

Sets the hash (fragment) component of a parsed URL. Has no effect if the URL is invalid.

ada_set_host
bool ada_set_host(ada_url result, const(char)* input, size_t length)

Sets the host component of a parsed URL. Has no effect if the URL is invalid.

ada_set_hostname
bool ada_set_hostname(ada_url result, const(char)* input, size_t length)

Sets the hostname component of a parsed URL. Has no effect if the URL is invalid.

ada_set_href
bool ada_set_href(ada_url result, const(char)* input, size_t length)

Sets the full URL (href) of a parsed URL. Has no effect if the URL is invalid.

ada_set_password
bool ada_set_password(ada_url result, const(char)* input, size_t length)

Sets the password component of a parsed URL. Has no effect if the URL is invalid.

ada_set_pathname
bool ada_set_pathname(ada_url result, const(char)* input, size_t length)

Sets the pathname component of a parsed URL. Has no effect if the URL is invalid.

ada_set_port
bool ada_set_port(ada_url result, const(char)* input, size_t length)

Sets the port component of a parsed URL. Has no effect if the URL is invalid.

ada_set_protocol
bool ada_set_protocol(ada_url result, const(char)* input, size_t length)

Sets the protocol component of a parsed URL. Has no effect if the URL is invalid.

ada_set_search
void ada_set_search(ada_url result, const(char)* input, size_t length)

Sets the search (query) component of a parsed URL. Has no effect if the URL is invalid.

ada_set_username
bool ada_set_username(ada_url result, const(char)* input, size_t length)

Sets the username component of a parsed URL. Has no effect if the URL is invalid.

ada_strings_get
ada_string ada_strings_get(ada_strings result, size_t index)

Retrieves a string at a specific index in a collection.

ada_strings_size
size_t ada_strings_size(ada_strings result)

Retrieves the number of strings in a collection.

Structs

ada_owned_string
struct ada_owned_string

A struct representing a string that must be freed by the caller. Typically used for strings returned by the Ada library that require manual memory management.

ada_string
struct ada_string

A struct representing a string owned by the ada_url instance. The string is managed by the Ada library and does not require manual freeing.

ada_string_pair
struct ada_string_pair

A struct representing a key-value pair in search parameters.

ada_url_components
struct ada_url_components

A struct representing the components of a parsed URL. Each field indicates the position or value of a URL component, with ada_url_omitted indicating an absent component.

Variables

ada_url_omitted
enum uint ada_url_omitted;

A constant representing an omitted URL component. Equivalent to uint32_t(-1) in the Ada library, used in ada_url_components to indicate absence.

Meta