+2012-03-30 Tim Ruehsen <tim.ruehsen@gmx.de>
+
+ * convert.c (convert_links_in_hashtable): Mmake it static.
+ * cookies.c (parse_set_cookie): Remove empty else branches.
+ * css-url.c: Include "css-url.h".
+ (get_uri_string): Make it static.
+ * css-url.h (get_urls_css): Add protoype.
+ * gnutls.c (ssl_init): Add prototype.
+ * html-parse.c (tagstack_push): Make it static.
+ * html-parse.c (tagstack_pop): Make it static.
+ * html-parse.c (tagstack_find): Make it static.
+ * html-url.c (cleanup_html_url): Make it static.
+ * progress.c (count_cols): Make it static.
+ * progress.c (get_eta): Make it static.
+ * retr.h (convert_to_bits): Remove prototype.
+ * util.h (convert_to_bits): Add prototype.
+ * spider.c (spider_cleanup): Make it static.
+ * warc.c (warc_write_start_record): Add prototype.
+ * warc.c (warc_write_end_record): Add prototype.
+ * warc.c (warc_start_cdx_file): Add prototype.
+ * warc.c (warc_init): Add prototype.
+ * warc.c (warc_load_cdx_dedup_file): Add prototype.
+ * warc.c (warc_write_metadata): Add prototype.
+ * warc.c (warc_close): Add prototype.
+ * warc.c (warc_tempfile): Add prototype.
+ * warc.c (warc_write_warcinfo_record): Make it static.
+ * warc.c (warc_load_cdx_dedup_file): Make it static.
+ * warc.c (warc_write_metadata): Make it static.
+ * warc.h (warc_init): Fix prototype.
+ * warc.h (warc_close): Fix prototype.
+ * warc.h (warc_tempfile): Fix prototype.
+
2012-03-30 Tim Ruehsen <tim.ruehsen@gmx.de>
* url.c: Use empty query in local filenames.
static void convert_links (const char *, struct urlpos *);
-void
+static void
convert_links_in_hashtable (struct hash_table *downloaded_set,
int is_css,
int *file_count)
goto error;
BOUNDED_TO_ALLOCA (value.b, value.e, value_copy);
+ /* Check if expiration spec is valid.
+ If not, assume default (cookie doesn't expire, but valid only for
+ this session.) */
expires = http_atotm (value_copy);
if (expires != (time_t) -1)
{
if (cookie->expiry_time < cookies_now)
cookie->discard_requested = 1;
}
- else
- /* Error in expiration spec. Assume default (cookie doesn't
- expire, but valid only for this session.) */
- ;
}
else if (TOKEN_IS (name, "max-age"))
{
/* ignore value completely */
cookie->secure = 1;
}
- else
- /* Ignore unrecognized attribute. */
- ;
+ /* else: Ignore unrecognized attribute. */
}
if (*ptr)
/* extract_param has encountered a syntax error */
#include "convert.h"
#include "html-url.h"
#include "css-tokens.h"
+#include "css-url.h"
/* from lex.yy.c */
extern char *yytext;
whitespace after the opening parenthesis and before the closing
parenthesis.
*/
-char *
+static char *
get_uri_string (const char *at, int *pos, int *length)
{
char *uri;
#ifndef CSS_URL_H
#define CSS_URL_H
+void get_urls_css (struct map_context *, int, int);
void get_urls_css (struct map_context *, int, int);
struct urlpos *get_urls_css_file (const char *, const char *);
static gnutls_certificate_credentials credentials;
bool
-ssl_init ()
+ssl_init (void)
{
/* Becomes true if GnuTLS is initialized. */
static bool ssl_initialized = false;
struct tagstack_item *next;
};
-struct tagstack_item *
+static struct tagstack_item *
tagstack_push (struct tagstack_item **head, struct tagstack_item **tail)
{
struct tagstack_item *ts = xmalloc(sizeof(struct tagstack_item));
}
/* remove ts and everything after it from the stack */
-void
+static void
tagstack_pop (struct tagstack_item **head, struct tagstack_item **tail,
struct tagstack_item *ts)
{
}
}
-struct tagstack_item *
+static struct tagstack_item *
tagstack_find (struct tagstack_item *tail, const char *tagname_begin,
const char *tagname_end)
{
return head;
}
-void
+static void
cleanup_html_url (void)
{
/* Destroy the hash tables. The hash table keys and values are not
}
#if USE_NLS_PROGRESS_BAR
-int
+static int
count_cols (const char *mbs)
{
wchar_t wc;
# define count_cols(mbs) ((int)(strlen(mbs)))
#endif
-const char *
+static const char *
get_eta (int *bcd)
{
/* TRANSLATORS: "ETA" is English-centric, but this must
bool input_file_url (const char *);
-wgint convert_to_bits (wgint num);
-
#endif /* RETR_H */
/* Cleanup the data structures associated with this file. */
-void
+static void
spider_cleanup (void)
{
if (nonexisting_urls_set)
int numdigit (wgint);
char *number_to_string (char *, wgint);
char *number_to_static_string (wgint);
+wgint convert_to_bits (wgint);
int determine_screen_width (void);
int random_number (int);
Returns false and set warc_write_ok to false if there
is an error. */
static bool
-warc_write_start_record ()
+warc_write_start_record (void)
{
if (!warc_write_ok)
return false;
with the uncompressed and compressed length of the
record. */
static bool
-warc_write_end_record ()
+warc_write_end_record (void)
{
warc_write_buffer ("\r\n\r\n", 4);
/* Write a warcinfo record to the current file.
Updates warc_current_warcinfo_uuid_str. */
-bool
+static bool
warc_write_warcinfo_record (char *filename)
{
/* Write warc-info record as the first record of the file. */
/* Opens the CDX file for output. */
static bool
-warc_start_cdx_file ()
+warc_start_cdx_file (void)
{
int filename_length = strlen (opt.warc_filename);
char *cdx_filename = alloca (filename_length + 4 + 1);
/* Loads the CDX file from opt.warc_cdx_dedup_filename and fills
the warc_cdx_dedup_table. */
-bool
-warc_load_cdx_dedup_file ()
+static bool
+warc_load_cdx_dedup_file (void)
{
FILE *f = fopen (opt.warc_cdx_dedup_filename, "r");
if (f == NULL)
/* Initializes the WARC writer (if opt.warc_filename is set).
This should be called before any WARC record is written. */
void
-warc_init ()
+warc_init (void)
{
warc_write_ok = true;
}
/* Writes metadata (manifest, configuration, log file) to the WARC file. */
-void
-warc_write_metadata ()
+static void
+warc_write_metadata (void)
{
/* If there are multiple WARC files, the metadata should be written to a separate file. */
if (opt.warc_maxsize > 0)
/* Finishes the WARC writing.
This should be called at the end of the program. */
void
-warc_close ()
+warc_close (void)
{
if (warc_current_file != NULL)
{
The temporary file will be created in opt.warc_tempdir.
Returns the pointer to the temporary file, or NULL. */
FILE *
-warc_tempfile ()
+warc_tempfile (void)
{
char filename[100];
if (path_search (filename, 100, opt.warc_tempdir, "wget", true) == -1)
#include "host.h"
-void warc_init ();
-void warc_close ();
+void warc_init (void);
+void warc_close (void);
void warc_timestamp (char *timestamp);
void warc_uuid_str (char *id_str);
-FILE * warc_tempfile ();
+FILE * warc_tempfile (void);
bool warc_write_request_record (char *url, char *timestamp_str, char *concurrent_to_uuid, ip_address *ip, FILE *body, off_t payload_offset);
bool warc_write_response_record (char *url, char *timestamp_str, char *concurrent_to_uuid, ip_address *ip, FILE *body, off_t payload_offset, char *mime_type, int response_code, char *redirect_location);