mirror of
https://gitlab.com/gnuwget/wget2.git
synced 2026-02-01 14:41:08 +00:00
Rename ROBOTS to wget_robots_t
* fuzz/libwget_robots_parse_fuzzer.c: Rename ROBOTS to wget_robots_t * include/wget/wget.h: Likewise * libwget/robots.c: Likewise * src/wget_host.h: Likewise * unit-tests/test.c: Likewise
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
ROBOTS *robots;
|
||||
wget_robots_t *robots;
|
||||
char *in = (char *) malloc(size + 1);
|
||||
|
||||
assert(in != NULL);
|
||||
|
||||
@ -2232,17 +2232,17 @@ WGETAPI void
|
||||
* Robots types and routines
|
||||
*/
|
||||
|
||||
typedef struct ROBOTS {
|
||||
typedef struct {
|
||||
wget_vector_t
|
||||
*paths;
|
||||
wget_vector_t
|
||||
*sitemaps;
|
||||
} ROBOTS;
|
||||
} wget_robots_t;
|
||||
|
||||
WGETAPI ROBOTS *
|
||||
WGETAPI wget_robots_t *
|
||||
wget_robots_parse(const char *data, const char *client);
|
||||
WGETAPI void
|
||||
wget_robots_free(ROBOTS **robots);
|
||||
wget_robots_free(wget_robots_t **robots);
|
||||
|
||||
/*
|
||||
* Progress bar routines
|
||||
|
||||
@ -60,9 +60,9 @@ static void _free_path(wget_string_t *path)
|
||||
*
|
||||
* The ROBOTS structure has to be freed by calling wget_robots_free().
|
||||
*/
|
||||
ROBOTS *wget_robots_parse(const char *data, const char *client)
|
||||
wget_robots_t *wget_robots_parse(const char *data, const char *client)
|
||||
{
|
||||
ROBOTS *robots;
|
||||
wget_robots_t *robots;
|
||||
wget_string_t path;
|
||||
size_t client_length = client ? strlen(client) : 0;
|
||||
int collect = 0;
|
||||
@ -71,7 +71,7 @@ ROBOTS *wget_robots_parse(const char *data, const char *client)
|
||||
if (!data || !*data)
|
||||
return NULL;
|
||||
|
||||
robots = xcalloc(1, sizeof (ROBOTS));
|
||||
robots = xcalloc(1, sizeof (wget_robots_t));
|
||||
|
||||
do {
|
||||
if (collect < 2 && !wget_strncasecmp_ascii(data, "User-agent:", 11)) {
|
||||
@ -135,7 +135,7 @@ ROBOTS *wget_robots_parse(const char *data, const char *client)
|
||||
*
|
||||
* wget_robots_free() free's the formerly allocated ROBOTS structure.
|
||||
*/
|
||||
void wget_robots_free(ROBOTS **robots)
|
||||
void wget_robots_free(wget_robots_t **robots)
|
||||
{
|
||||
if (robots && *robots) {
|
||||
wget_vector_free(&(*robots)->paths);
|
||||
|
||||
@ -54,7 +54,7 @@ typedef struct {
|
||||
*host;
|
||||
JOB
|
||||
*robot_job; // special job for downloading robots.txt (before anything else)
|
||||
ROBOTS
|
||||
wget_robots_t
|
||||
*robots;
|
||||
wget_list_t
|
||||
*queue; // host specific job queue
|
||||
|
||||
@ -2218,7 +2218,7 @@ static void test_robots(void)
|
||||
|
||||
for (unsigned it = 0; it < countof(test_data); it++) {
|
||||
const struct test_data *t = &test_data[it];
|
||||
ROBOTS *robots = wget_robots_parse(t->data, PACKAGE_NAME);
|
||||
wget_robots_t *robots = wget_robots_parse(t->data, PACKAGE_NAME);
|
||||
|
||||
for (unsigned it2 = 0; it2 < countof(test_data[it].path) && t->path[it2]; it2++) {
|
||||
int n = wget_vector_size(robots->paths);
|
||||
|
||||
Reference in New Issue
Block a user