deps: update ada to 2.4.0

PR-URL: https://github.com/nodejs/node/pull/47922
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
pull/47942/head
Node.js GitHub Bot 2023-05-09 16:53:06 +01:00 committed by GitHub
parent 4f69aae6a0
commit a6ad5d89e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2665 additions and 2271 deletions

4831
deps/ada/ada.cpp vendored

File diff suppressed because it is too large Load Diff

13
deps/ada/ada.h vendored
View File

@ -1,4 +1,4 @@
/* auto-generated on 2023-05-05 22:58:51 -0400. Do not edit! */
/* auto-generated on 2023-05-08 12:41:03 -0400. Do not edit! */
/* begin file include/ada.h */
/**
* @file ada.h
@ -8,7 +8,7 @@
#define ADA_H
/* begin file include/ada/ada_idna.h */
/* auto-generated on 2023-04-26 14:14:42 -0400. Do not edit! */
/* auto-generated on 2023-05-07 19:12:14 -0400. Do not edit! */
/* begin file include/idna.h */
#ifndef ADA_IDNA_H
#define ADA_IDNA_H
@ -6473,14 +6473,14 @@ inline std::ostream &operator<<(std::ostream &out,
#ifndef ADA_ADA_VERSION_H
#define ADA_ADA_VERSION_H
#define ADA_VERSION "2.3.1"
#define ADA_VERSION "2.4.0"
namespace ada {
enum {
ADA_VERSION_MAJOR = 2,
ADA_VERSION_MINOR = 3,
ADA_VERSION_REVISION = 1,
ADA_VERSION_MINOR = 4,
ADA_VERSION_REVISION = 0,
};
} // namespace ada
@ -6528,7 +6528,8 @@ extern template ada::result<url_aggregator> parse<url_aggregator>(
* @see https://url.spec.whatwg.org/#dom-url-canparse
* @return If URL can be parsed or not.
*/
bool can_parse(std::string_view input, std::string_view* base_input);
bool can_parse(std::string_view input,
const std::string_view* base_input = nullptr);
/**
* Computes a href string from a file path.

92
deps/ada/ada_c.h vendored 100644
View File

@ -0,0 +1,92 @@
/**
* @file ada_c.h
* @brief Includes the C definitions for Ada. This is a C file, not C++.
*/
#ifndef ADA_C_H
#define ADA_C_H
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
// string that is owned by the ada_url instance
typedef struct {
const char* data;
size_t length;
} ada_string;
// string that must be freed by the caller
typedef struct {
const char* data;
size_t length;
} ada_owned_string;
typedef struct {
uint32_t protocol_end;
uint32_t username_end;
uint32_t host_start;
uint32_t host_end;
uint32_t port;
uint32_t pathname_start;
uint32_t search_start;
uint32_t hash_start;
} ada_url_components;
typedef void* ada_url;
// input should be a null terminated C string
// you must call ada_free on the returned pointer
ada_url ada_parse(const char* string);
// input and base should be a null terminated C strings
bool ada_can_parse(const char* input, const char* base);
void ada_free(ada_url result);
bool ada_is_valid(ada_url result);
// url_aggregator getters
// if ada_is_valid(result)) is false, an empty string is returned
ada_owned_string ada_get_origin(ada_url result);
void ada_free_owned_string(ada_owned_string owned);
ada_string ada_get_href(ada_url result);
ada_string ada_get_username(ada_url result);
ada_string ada_get_password(ada_url result);
ada_string ada_get_port(ada_url result);
ada_string ada_get_hash(ada_url result);
ada_string ada_get_host(ada_url result);
ada_string ada_get_hostname(ada_url result);
ada_string ada_get_pathname(ada_url result);
ada_string ada_get_search(ada_url result);
ada_string ada_get_protocol(ada_url result);
// url_aggregator setters
// if ada_is_valid(result)) is false, the setters have no effect
// input should be a null terminated C string
bool ada_set_href(ada_url result, const char* input);
bool ada_set_host(ada_url result, const char* input);
bool ada_set_hostname(ada_url result, const char* input);
bool ada_set_protocol(ada_url result, const char* input);
bool ada_set_username(ada_url result, const char* input);
bool ada_set_password(ada_url result, const char* input);
bool ada_set_port(ada_url result, const char* input);
bool ada_set_pathname(ada_url result, const char* input);
void ada_set_search(ada_url result, const char* input);
void ada_set_hash(ada_url result, const char* input);
// url_aggregator functions
// if ada_is_valid(result) is false, functions below will return false
bool ada_has_credentials(ada_url result);
bool ada_has_empty_hostname(ada_url result);
bool ada_has_hostname(ada_url result);
bool ada_has_non_empty_username(ada_url result);
bool ada_has_non_empty_password(ada_url result);
bool ada_has_port(ada_url result);
bool ada_has_password(ada_url result);
bool ada_has_hash(ada_url result);
bool ada_has_search(ada_url result);
// returns a pointer to the internal url_aggregator::url_components
const ada_url_components* ada_get_components(ada_url result);
#endif // ADA_C_H