diff --git a/fuzz/libwget_robots_parse_fuzzer.c b/fuzz/libwget_robots_parse_fuzzer.c index fedf0ab7..dfc12815 100644 --- a/fuzz/libwget_robots_parse_fuzzer.c +++ b/fuzz/libwget_robots_parse_fuzzer.c @@ -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); diff --git a/include/wget/wget.h b/include/wget/wget.h index 8129dc37..e07240e0 100644 --- a/include/wget/wget.h +++ b/include/wget/wget.h @@ -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 diff --git a/libwget/robots.c b/libwget/robots.c index c320c443..4d3b2041 100644 --- a/libwget/robots.c +++ b/libwget/robots.c @@ -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); diff --git a/src/wget_host.h b/src/wget_host.h index 4ac87779..8e2bc0c2 100644 --- a/src/wget_host.h +++ b/src/wget_host.h @@ -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 diff --git a/unit-tests/test.c b/unit-tests/test.c index 994dc728..f974943b 100644 --- a/unit-tests/test.c +++ b/unit-tests/test.c @@ -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);