]> sjero.net Git - wget/commitdiff
Rename two functions.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 9 Jul 2010 10:24:51 +0000 (12:24 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 9 Jul 2010 10:24:51 +0000 (12:24 +0200)
src/ChangeLog
src/convert.c
src/css-url.c
src/html-url.c
src/res.c
src/utils.c
src/utils.h

index 21261f49d3351422f3461835067508dcfc71dba4..789d3bf7e2c52e0597410f91dc98e2c7d00988be 100644 (file)
@@ -1,3 +1,17 @@
+2010-07-09  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * 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  <gscrivano@gnu.org>
 
        * gnutls.c (ssl_init): New local variables `ca_directory' and `dir'.
 2010-07-05  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * gnutls.c (ssl_init): New local variables `ca_directory' and `dir'.
index c0144230b842d848b2b6978d5f5e9c7fa757e465..fc858787f43fda92ebe7ce79572131eb8a0e434e 100644 (file)
@@ -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"),
   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));
     {
       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.  */
       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));
     {
       logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"),
                  file, strerror (errno));
-      read_file_free (fm);
+      wget_read_file_free (fm);
       return;
     }
 
       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);
   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);
 }
 
   logprintf (LOG_VERBOSE, "%d-%d\n", to_file_count, to_url_count);
 }
index fd3d5f77a1c53af84a6c1bbb09a13f9dac43b5f0..f3d8c909eb417a1b58d9545485bf1af19fdadadd 100644 (file)
@@ -252,7 +252,7 @@ get_urls_css_file (const char *file, const char *url)
   struct map_context ctx;
 
   /* Load the file. */
   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));
   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);
   ctx.nofollow = 0;
 
   get_urls_css (&ctx, 0, fm->length);
-  read_file_free (fm);
+  wget_read_file_free (fm);
   return ctx.head;
 }
   return ctx.head;
 }
index 5e9aeb4bb2333ab262c9a3aeeae77fd5c673dcf8..02092e5a31023a1322d8b05f787d0028ff4bc964 100644 (file)
@@ -659,7 +659,7 @@ get_urls_html (const char *file, const char *url, bool *meta_disallow_follow,
   int flags;
 
   /* Load the file. */
   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));
   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);
     *meta_disallow_follow = ctx.nofollow;
 
   xfree_null (ctx.base);
-  read_file_free (fm);
+  wget_read_file_free (fm);
   return ctx.head;
 }
 
   return ctx.head;
 }
 
@@ -716,7 +716,7 @@ get_urls_file (const char *file)
   const char *text, *text_end;
 
   /* Load the 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));
   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;
     }
         tail->next = entry;
       tail = entry;
     }
-  read_file_free (fm);
+  wget_read_file_free (fm);
   return head;
 }
 
   return head;
 }
 
index 897f1240d57c0108d6817adb4a2ba0e51ef16a40..3df2b3f86fcb7b04a716f6e5a3df005ab2bc0a45 100644 (file)
--- 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;
 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"),
   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);
       return NULL;
     }
   specs = res_parse (fm->content, fm->length);
-  read_file_free (fm);
+  wget_read_file_free (fm);
   return specs;
 }
 
   return specs;
 }
 
index 81065353efa888e720770218d8448853e905c1ba..d7683075dc3e352cb0d1729f691d3cb0a2d78777 100644 (file)
@@ -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.
 
    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
    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 *
    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;
 {
   int fd;
   struct file_memory *fm;
@@ -1270,7 +1270,7 @@ read_file (const char *file)
    memory needed to hold the FM structure itself.  */
 
 void
    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)
 {
 #ifdef HAVE_MMAP
   if (fm->mmap_p)
index f2d6e23e23e7bb9a232976159320d6ea91e2ab98..3708b12d3b9c79f0de13201a5db5957c0edc38fc 100644 (file)
@@ -97,8 +97,8 @@ bool has_wildcards_p (const char *);
 bool has_html_suffix_p (const char *);
 
 char *read_whole_line (FILE *);
 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 **);
 
 void free_vec (char **);
 char **merge_vecs (char **, char **);