mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Rename two functions.
This commit is contained in:
parent
ec40efb27b
commit
cf3c678c82
@ -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'.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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 **);
|
||||
|
Loading…
Reference in New Issue
Block a user