From cf3c678c8246fc326b69ae64b4e2766a69df5704 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 9 Jul 2010 12:24:51 +0200 Subject: [PATCH] Rename two functions. --- src/ChangeLog | 14 ++++++++++++++ src/convert.c | 8 ++++---- src/css-url.c | 4 ++-- src/html-url.c | 8 ++++---- src/res.c | 4 ++-- src/utils.c | 8 ++++---- src/utils.h | 4 ++-- 7 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 21261f49..789d3bf7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2010-07-09 Giuseppe Scrivano + + * css-url.c (get_urls_css_file): Use `wget_read_file' instead of + `read_file'. Use `wget_read_file_free' instead of `read_file_free'. + * convert.c (convert_links): Likewise. + * html-url.c (get_urls_html, get_urls_file): Likewise. + * res.c (res_parse_from_file): Likewise. + + * utils.h: Rename `read_file' to `wget_read_file'. Rename + `read_file_free' to `wget_read_file_free'. + + * utils.c (wget_read_file): Renamed from `read_file'. + (wget_read_file_free): Renamed from `read_file_free'. + 2010-07-05 Giuseppe Scrivano * gnutls.c (ssl_init): New local variables `ca_directory' and `dir'. diff --git a/src/convert.c b/src/convert.c index c0144230..fc858787 100644 --- a/src/convert.c +++ b/src/convert.c @@ -228,7 +228,7 @@ convert_links (const char *file, struct urlpos *links) } } - fm = read_file (file); + fm = wget_read_file (file); if (!fm) { logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"), @@ -248,7 +248,7 @@ convert_links (const char *file, struct urlpos *links) { logprintf (LOG_NOTQUIET, _("Unable to delete %s: %s\n"), quote (file), strerror (errno)); - read_file_free (fm); + wget_read_file_free (fm); return; } /* Now open the file for writing. */ @@ -257,7 +257,7 @@ convert_links (const char *file, struct urlpos *links) { logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"), file, strerror (errno)); - read_file_free (fm); + wget_read_file_free (fm); return; } @@ -342,7 +342,7 @@ convert_links (const char *file, struct urlpos *links) if (p - fm->content < fm->length) fwrite (p, 1, fm->length - (p - fm->content), fp); fclose (fp); - read_file_free (fm); + wget_read_file_free (fm); logprintf (LOG_VERBOSE, "%d-%d\n", to_file_count, to_url_count); } diff --git a/src/css-url.c b/src/css-url.c index fd3d5f77..f3d8c909 100644 --- a/src/css-url.c +++ b/src/css-url.c @@ -252,7 +252,7 @@ get_urls_css_file (const char *file, const char *url) struct map_context ctx; /* Load the file. */ - fm = read_file (file); + fm = wget_read_file (file); if (!fm) { logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno)); @@ -268,6 +268,6 @@ get_urls_css_file (const char *file, const char *url) ctx.nofollow = 0; get_urls_css (&ctx, 0, fm->length); - read_file_free (fm); + wget_read_file_free (fm); return ctx.head; } diff --git a/src/html-url.c b/src/html-url.c index 5e9aeb4b..02092e5a 100644 --- a/src/html-url.c +++ b/src/html-url.c @@ -659,7 +659,7 @@ get_urls_html (const char *file, const char *url, bool *meta_disallow_follow, int flags; /* Load the file. */ - fm = read_file (file); + fm = wget_read_file (file); if (!fm) { logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno)); @@ -701,7 +701,7 @@ get_urls_html (const char *file, const char *url, bool *meta_disallow_follow, *meta_disallow_follow = ctx.nofollow; xfree_null (ctx.base); - read_file_free (fm); + wget_read_file_free (fm); return ctx.head; } @@ -716,7 +716,7 @@ get_urls_file (const char *file) const char *text, *text_end; /* Load the file. */ - fm = read_file (file); + fm = wget_read_file (file); if (!fm) { logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno)); @@ -786,7 +786,7 @@ get_urls_file (const char *file) tail->next = entry; tail = entry; } - read_file_free (fm); + wget_read_file_free (fm); return head; } diff --git a/src/res.c b/src/res.c index 897f1240..3df2b3f8 100644 --- a/src/res.c +++ b/src/res.c @@ -385,7 +385,7 @@ struct robot_specs * res_parse_from_file (const char *filename) { struct robot_specs *specs; - struct file_memory *fm = read_file (filename); + struct file_memory *fm = wget_read_file (filename); if (!fm) { logprintf (LOG_NOTQUIET, _("Cannot open %s: %s"), @@ -393,7 +393,7 @@ res_parse_from_file (const char *filename) return NULL; } specs = res_parse (fm->content, fm->length); - read_file_free (fm); + wget_read_file_free (fm); return specs; } diff --git a/src/utils.c b/src/utils.c index 81065353..d7683075 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1149,18 +1149,18 @@ read_whole_line (FILE *fp) zero-terminated, and you should *not* read or write beyond the [0, length) range of characters. - After you are done with the file contents, call read_file_free to + After you are done with the file contents, call wget_read_file_free to release the memory. Depending on the operating system and the type of file that is - being read, read_file() either mmap's the file into memory, or + being read, wget_read_file() either mmap's the file into memory, or reads the file into the core using read(). If file is named "-", fileno(stdin) is used for reading instead. If you want to read from a real file named "-", use "./-" instead. */ struct file_memory * -read_file (const char *file) +wget_read_file (const char *file) { int fd; struct file_memory *fm; @@ -1270,7 +1270,7 @@ read_file (const char *file) memory needed to hold the FM structure itself. */ void -read_file_free (struct file_memory *fm) +wget_read_file_free (struct file_memory *fm) { #ifdef HAVE_MMAP if (fm->mmap_p) diff --git a/src/utils.h b/src/utils.h index f2d6e23e..3708b12d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -97,8 +97,8 @@ bool has_wildcards_p (const char *); bool has_html_suffix_p (const char *); char *read_whole_line (FILE *); -struct file_memory *read_file (const char *); -void read_file_free (struct file_memory *); +struct file_memory *wget_read_file (const char *); +void wget_read_file_free (struct file_memory *); void free_vec (char **); char **merge_vecs (char **, char **); -- 2.39.2