Use coccinelle to change logging macro calls in c files

for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done

@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
This commit is contained in:
Vincent Sanders 2017-09-06 18:28:12 +01:00
parent 8d9b2efc11
commit 75018632a9
215 changed files with 3497 additions and 2170 deletions

View File

@ -73,7 +73,8 @@ nserror content__init(struct content *c, const content_handler *handler,
struct content_user *user_sentinel; struct content_user *user_sentinel;
nserror error; nserror error;
LOG("url "URL_FMT_SPC" -> %p", nsurl_access(llcache_handle_get_url(llcache)), c); NSLOG(netsurf, INFO, "url "URL_FMT_SPC" -> %p",
nsurl_access(llcache_handle_get_url(llcache)), c);
user_sentinel = calloc(1, sizeof(struct content_user)); user_sentinel = calloc(1, sizeof(struct content_user));
if (user_sentinel == NULL) { if (user_sentinel == NULL) {
@ -272,7 +273,8 @@ void content_convert(struct content *c)
if (c->locked == true) if (c->locked == true)
return; return;
LOG("content "URL_FMT_SPC" (%p)", nsurl_access(llcache_handle_get_url(c->llcache)), c); NSLOG(netsurf, INFO, "content "URL_FMT_SPC" (%p)",
nsurl_access(llcache_handle_get_url(c->llcache)), c);
if (c->handler->data_complete != NULL) { if (c->handler->data_complete != NULL) {
c->locked = true; c->locked = true;
@ -376,7 +378,8 @@ void content_destroy(struct content *c)
struct content_rfc5988_link *link; struct content_rfc5988_link *link;
assert(c); assert(c);
LOG("content %p %s", c, nsurl_access(llcache_handle_get_url(c->llcache))); NSLOG(netsurf, INFO, "content %p %s", c,
nsurl_access(llcache_handle_get_url(c->llcache)));
assert(c->locked == false); assert(c->locked == false);
if (c->handler->destroy != NULL) if (c->handler->destroy != NULL)
@ -585,7 +588,7 @@ bool content_scaled_redraw(struct hlcache_handle *h,
return true; return true;
} }
LOG("Content %p %dx%d ctx:%p", c, width, height, ctx); NSLOG(netsurf, INFO, "Content %p %dx%d ctx:%p", c, width, height, ctx);
if (ctx->plot->option_knockout) { if (ctx->plot->option_knockout) {
knockout_plot_start(ctx, &new_ctx); knockout_plot_start(ctx, &new_ctx);
@ -654,7 +657,9 @@ bool content_add_user(
{ {
struct content_user *user; struct content_user *user;
LOG("content "URL_FMT_SPC" (%p), user %p %p", nsurl_access(llcache_handle_get_url(c->llcache)), c, callback, pw); NSLOG(netsurf, INFO, "content "URL_FMT_SPC" (%p), user %p %p",
nsurl_access(llcache_handle_get_url(c->llcache)), c, callback,
pw);
user = malloc(sizeof(struct content_user)); user = malloc(sizeof(struct content_user));
if (!user) if (!user)
return false; return false;
@ -687,7 +692,9 @@ void content_remove_user(
void *pw) void *pw)
{ {
struct content_user *user, *next; struct content_user *user, *next;
LOG("content "URL_FMT_SPC" (%p), user %p %p", nsurl_access(llcache_handle_get_url(c->llcache)), c, callback, pw); NSLOG(netsurf, INFO, "content "URL_FMT_SPC" (%p), user %p %p",
nsurl_access(llcache_handle_get_url(c->llcache)), c, callback,
pw);
/* user_list starts with a sentinel */ /* user_list starts with a sentinel */
for (user = c->user_list; user->next != 0 && for (user = c->user_list; user->next != 0 &&
@ -695,7 +702,7 @@ void content_remove_user(
user->next->pw == pw); user = user->next) user->next->pw == pw); user = user->next)
; ;
if (user->next == 0) { if (user->next == 0) {
LOG("user not found in list"); NSLOG(netsurf, INFO, "user not found in list");
assert(0); assert(0);
return; return;
} }
@ -808,7 +815,8 @@ void content_open(hlcache_handle *h, struct browser_window *bw,
{ {
struct content *c = hlcache_handle_get_content(h); struct content *c = hlcache_handle_get_content(h);
assert(c != 0); assert(c != 0);
LOG("content %p %s", c, nsurl_access(llcache_handle_get_url(c->llcache))); NSLOG(netsurf, INFO, "content %p %s", c,
nsurl_access(llcache_handle_get_url(c->llcache)));
if (c->handler->open != NULL) if (c->handler->open != NULL)
c->handler->open(c, bw, page, params); c->handler->open(c, bw, page, params);
} }
@ -824,7 +832,8 @@ void content_close(hlcache_handle *h)
{ {
struct content *c = hlcache_handle_get_content(h); struct content *c = hlcache_handle_get_content(h);
assert(c != 0); assert(c != 0);
LOG("content %p %s", c, nsurl_access(llcache_handle_get_url(c->llcache))); NSLOG(netsurf, INFO, "content %p %s", c,
nsurl_access(llcache_handle_get_url(c->llcache)));
if (c->handler->close != NULL) if (c->handler->close != NULL)
c->handler->close(c); c->handler->close(c);
} }
@ -1472,7 +1481,7 @@ nserror content__clone(const struct content *c, struct content *nc)
*/ */
nserror content_abort(struct content *c) nserror content_abort(struct content *c)
{ {
LOG("Aborting %p", c); NSLOG(netsurf, INFO, "Aborting %p", c);
if (c->handler->stop != NULL) if (c->handler->stop != NULL)
c->handler->stop(c); c->handler->stop(c);

View File

@ -217,14 +217,16 @@ static void dump_rings(void)
q = queue_ring; q = queue_ring;
if (q) { if (q) {
do { do {
LOG("queue_ring: %s", nsurl_access(q->url)); NSLOG(netsurf, INFO, "queue_ring: %s",
nsurl_access(q->url));
q = q->r_next; q = q->r_next;
} while (q != queue_ring); } while (q != queue_ring);
} }
f = fetch_ring; f = fetch_ring;
if (f) { if (f) {
do { do {
LOG("fetch_ring: %s", nsurl_access(f->url)); NSLOG(netsurf, INFO, "fetch_ring: %s",
nsurl_access(f->url));
f = f->r_next; f = f->r_next;
} while (f != fetch_ring); } while (f != fetch_ring);
} }
@ -341,7 +343,10 @@ void fetcher_quit(void)
* the reference count to allow the fetcher to * the reference count to allow the fetcher to
* be stopped. * be stopped.
*/ */
LOG("Fetcher for scheme %s still has %d active users at quit.", lwc_string_data(fetchers[fetcherd].scheme), fetchers[fetcherd].refcount); NSLOG(netsurf, INFO,
"Fetcher for scheme %s still has %d active users at quit.",
lwc_string_data(fetchers[fetcherd].scheme),
fetchers[fetcherd].refcount);
fetchers[fetcherd].refcount = 1; fetchers[fetcherd].refcount = 1;
} }
@ -753,9 +758,9 @@ void fetch_remove_from_queues(struct fetch *fetch)
RING_GETSIZE(struct fetch, fetch_ring, all_active); RING_GETSIZE(struct fetch, fetch_ring, all_active);
RING_GETSIZE(struct fetch, queue_ring, all_queued); RING_GETSIZE(struct fetch, queue_ring, all_queued);
LOG("Fetch ring is now %d elements.", all_active); NSLOG(netsurf, INFO, "Fetch ring is now %d elements.", all_active);
LOG("Queue ring is now %d elements.", all_queued); NSLOG(netsurf, INFO, "Queue ring is now %d elements.", all_queued);
#endif #endif
} }

View File

@ -155,7 +155,8 @@ static void ns_X509_free(X509 *cert)
*/ */
static bool fetch_curl_initialise(lwc_string *scheme) static bool fetch_curl_initialise(lwc_string *scheme)
{ {
LOG("Initialise cURL fetcher for %s", lwc_string_data(scheme)); NSLOG(netsurf, INFO, "Initialise cURL fetcher for %s",
lwc_string_data(scheme));
curl_fetchers_registered++; curl_fetchers_registered++;
return true; /* Always succeeds */ return true; /* Always succeeds */
} }
@ -171,17 +172,20 @@ static void fetch_curl_finalise(lwc_string *scheme)
struct cache_handle *h; struct cache_handle *h;
curl_fetchers_registered--; curl_fetchers_registered--;
LOG("Finalise cURL fetcher %s", lwc_string_data(scheme)); NSLOG(netsurf, INFO, "Finalise cURL fetcher %s",
lwc_string_data(scheme));
if (curl_fetchers_registered == 0) { if (curl_fetchers_registered == 0) {
CURLMcode codem; CURLMcode codem;
/* All the fetchers have been finalised. */ /* All the fetchers have been finalised. */
LOG("All cURL fetchers finalised, closing down cURL"); NSLOG(netsurf, INFO,
"All cURL fetchers finalised, closing down cURL");
curl_easy_cleanup(fetch_blank_curl); curl_easy_cleanup(fetch_blank_curl);
codem = curl_multi_cleanup(fetch_curl_multi); codem = curl_multi_cleanup(fetch_curl_multi);
if (codem != CURLM_OK) if (codem != CURLM_OK)
LOG("curl_multi_cleanup failed: ignoring"); NSLOG(netsurf, INFO,
"curl_multi_cleanup failed: ignoring");
curl_global_cleanup(); curl_global_cleanup();
} }
@ -251,7 +255,9 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
"application/octet-stream", "application/octet-stream",
CURLFORM_END); CURLFORM_END);
if (code != CURL_FORMADD_OK) if (code != CURL_FORMADD_OK)
LOG("curl_formadd: %d (%s)", code, control->name); NSLOG(netsurf, INFO,
"curl_formadd: %d (%s)", code,
control->name);
} else { } else {
char *mimetype = guit->fetch->mimetype(control->value); char *mimetype = guit->fetch->mimetype(control->value);
code = curl_formadd(&post, &last, code = curl_formadd(&post, &last,
@ -262,7 +268,11 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
(mimetype != 0 ? mimetype : "text/plain"), (mimetype != 0 ? mimetype : "text/plain"),
CURLFORM_END); CURLFORM_END);
if (code != CURL_FORMADD_OK) if (code != CURL_FORMADD_OK)
LOG("curl_formadd: %d (%s=%s)", code, control->name, control->value); NSLOG(netsurf, INFO,
"curl_formadd: %d (%s=%s)",
code,
control->name,
control->value);
free(mimetype); free(mimetype);
} }
free(leafname); free(leafname);
@ -273,7 +283,9 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
CURLFORM_COPYCONTENTS, control->value, CURLFORM_COPYCONTENTS, control->value,
CURLFORM_END); CURLFORM_END);
if (code != CURL_FORMADD_OK) if (code != CURL_FORMADD_OK)
LOG("curl_formadd: %d (%s=%s)", code, control->name, control->value); NSLOG(netsurf, INFO,
"curl_formadd: %d (%s=%s)", code,
control->name, control->value);
} }
} }
@ -321,7 +333,7 @@ fetch_curl_setup(struct fetch *parent_fetch,
fetch->fetch_handle = parent_fetch; fetch->fetch_handle = parent_fetch;
LOG("fetch %p, url '%s'", fetch, nsurl_access(url)); NSLOG(netsurf, INFO, "fetch %p, url '%s'", fetch, nsurl_access(url));
/* construct a new fetch structure */ /* construct a new fetch structure */
fetch->curl_handle = NULL; fetch->curl_handle = NULL;
@ -776,7 +788,7 @@ static void fetch_curl_abort(void *vf)
{ {
struct curl_fetch_info *f = (struct curl_fetch_info *)vf; struct curl_fetch_info *f = (struct curl_fetch_info *)vf;
assert(f); assert(f);
LOG("fetch %p, url '%s'", f, nsurl_access(f->url)); NSLOG(netsurf, INFO, "fetch %p, url '%s'", f, nsurl_access(f->url));
if (f->curl_handle) { if (f->curl_handle) {
f->abort = true; f->abort = true;
} else { } else {
@ -796,7 +808,7 @@ static void fetch_curl_stop(struct curl_fetch_info *f)
CURLMcode codem; CURLMcode codem;
assert(f); assert(f);
LOG("fetch %p, url '%s'", f, nsurl_access(f->url)); NSLOG(netsurf, INFO, "fetch %p, url '%s'", f, nsurl_access(f->url));
if (f->curl_handle) { if (f->curl_handle) {
/* remove from curl multi handle */ /* remove from curl multi handle */
@ -864,7 +876,7 @@ static bool fetch_curl_process_headers(struct curl_fetch_info *f)
assert(code == CURLE_OK); assert(code == CURLE_OK);
} }
http_code = f->http_code; http_code = f->http_code;
LOG("HTTP status code %li", http_code); NSLOG(netsurf, INFO, "HTTP status code %li", http_code);
if (http_code == 304 && !f->post_urlenc && !f->post_multipart) { if (http_code == 304 && !f->post_urlenc && !f->post_multipart) {
/* Not Modified && GET request */ /* Not Modified && GET request */
@ -875,7 +887,7 @@ static bool fetch_curl_process_headers(struct curl_fetch_info *f)
/* handle HTTP redirects (3xx response codes) */ /* handle HTTP redirects (3xx response codes) */
if (300 <= http_code && http_code < 400 && f->location != 0) { if (300 <= http_code && http_code < 400 && f->location != 0) {
LOG("FETCH_REDIRECT, '%s'", f->location); NSLOG(netsurf, INFO, "FETCH_REDIRECT, '%s'", f->location);
msg.type = FETCH_REDIRECT; msg.type = FETCH_REDIRECT;
msg.data.redirect = f->location; msg.data.redirect = f->location;
fetch_send_callback(&msg, f->fetch_handle); fetch_send_callback(&msg, f->fetch_handle);
@ -1037,7 +1049,7 @@ static void fetch_curl_done(CURL *curl_handle, CURLcode result)
assert(code == CURLE_OK); assert(code == CURLE_OK);
abort_fetch = f->abort; abort_fetch = f->abort;
LOG("done %s", nsurl_access(f->url)); NSLOG(netsurf, INFO, "done %s", nsurl_access(f->url));
if ((abort_fetch == false) && if ((abort_fetch == false) &&
(result == CURLE_OK || (result == CURLE_OK ||
@ -1082,7 +1094,7 @@ static void fetch_curl_done(CURL *curl_handle, CURLcode result)
memset(f->cert_data, 0, sizeof(f->cert_data)); memset(f->cert_data, 0, sizeof(f->cert_data));
cert = true; cert = true;
} else { } else {
LOG("Unknown cURL response code %d", result); NSLOG(netsurf, INFO, "Unknown cURL response code %d", result);
error = true; error = true;
} }
@ -1146,7 +1158,8 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
&exc_fd_set, &max_fd); &exc_fd_set, &max_fd);
assert(codem == CURLM_OK); assert(codem == CURLM_OK);
LOG("Curl file descriptor states (maxfd=%i):", max_fd); NSLOG(netsurf, INFO,
"Curl file descriptor states (maxfd=%i):", max_fd);
for (i = 0; i <= max_fd; i++) { for (i = 0; i <= max_fd; i++) {
bool read = false; bool read = false;
bool write = false; bool write = false;
@ -1162,10 +1175,10 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
error = true; error = true;
} }
if (read || write || error) { if (read || write || error) {
LOG(" fd %i: %s %s %s", i, NSLOG(netsurf, INFO, " fd %i: %s %s %s", i,
read ? "read" : " ", read ? "read" : " ",
write ? "write" : " ", write ? "write" : " ",
error ? "error" : " "); error ? "error" : " ");
} }
} }
} }
@ -1174,7 +1187,8 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
do { do {
codem = curl_multi_perform(fetch_curl_multi, &running); codem = curl_multi_perform(fetch_curl_multi, &running);
if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) { if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) {
LOG("curl_multi_perform: %i %s", codem, curl_multi_strerror(codem)); NSLOG(netsurf, INFO, "curl_multi_perform: %i %s",
codem, curl_multi_strerror(codem));
guit->misc->warning("MiscError", curl_multi_strerror(codem)); guit->misc->warning("MiscError", curl_multi_strerror(codem));
return; return;
} }
@ -1336,7 +1350,7 @@ fetch_curl_header(char *data, size_t size, size_t nmemb, void *_f)
free(f->location); free(f->location);
f->location = malloc(size); f->location = malloc(size);
if (!f->location) { if (!f->location) {
LOG("malloc failed"); NSLOG(netsurf, INFO, "malloc failed");
return size; return size;
} }
SKIP_ST(9); SKIP_ST(9);
@ -1427,17 +1441,17 @@ nserror fetch_curl_register(void)
.finalise = fetch_curl_finalise .finalise = fetch_curl_finalise
}; };
LOG("curl_version %s", curl_version()); NSLOG(netsurf, INFO, "curl_version %s", curl_version());
code = curl_global_init(CURL_GLOBAL_ALL); code = curl_global_init(CURL_GLOBAL_ALL);
if (code != CURLE_OK) { if (code != CURLE_OK) {
LOG("curl_global_init failed."); NSLOG(netsurf, INFO, "curl_global_init failed.");
return NSERROR_INIT_FAILED; return NSERROR_INIT_FAILED;
} }
fetch_curl_multi = curl_multi_init(); fetch_curl_multi = curl_multi_init();
if (!fetch_curl_multi) { if (!fetch_curl_multi) {
LOG("curl_multi_init failed."); NSLOG(netsurf, INFO, "curl_multi_init failed.");
return NSERROR_INIT_FAILED; return NSERROR_INIT_FAILED;
} }
@ -1465,7 +1479,7 @@ nserror fetch_curl_register(void)
*/ */
fetch_blank_curl = curl_easy_init(); fetch_blank_curl = curl_easy_init();
if (!fetch_blank_curl) { if (!fetch_blank_curl) {
LOG("curl_easy_init failed"); NSLOG(netsurf, INFO, "curl_easy_init failed");
return NSERROR_INIT_FAILED; return NSERROR_INIT_FAILED;
} }
@ -1497,11 +1511,12 @@ nserror fetch_curl_register(void)
if (nsoption_charp(ca_bundle) && if (nsoption_charp(ca_bundle) &&
strcmp(nsoption_charp(ca_bundle), "")) { strcmp(nsoption_charp(ca_bundle), "")) {
LOG("ca_bundle: '%s'", nsoption_charp(ca_bundle)); NSLOG(netsurf, INFO, "ca_bundle: '%s'",
nsoption_charp(ca_bundle));
SETOPT(CURLOPT_CAINFO, nsoption_charp(ca_bundle)); SETOPT(CURLOPT_CAINFO, nsoption_charp(ca_bundle));
} }
if (nsoption_charp(ca_path) && strcmp(nsoption_charp(ca_path), "")) { if (nsoption_charp(ca_path) && strcmp(nsoption_charp(ca_path), "")) {
LOG("ca_path: '%s'", nsoption_charp(ca_path)); NSLOG(netsurf, INFO, "ca_path: '%s'", nsoption_charp(ca_path));
SETOPT(CURLOPT_CAPATH, nsoption_charp(ca_path)); SETOPT(CURLOPT_CAPATH, nsoption_charp(ca_path));
} }
@ -1513,7 +1528,8 @@ nserror fetch_curl_register(void)
curl_with_openssl = false; curl_with_openssl = false;
} }
LOG("cURL %slinked against openssl", curl_with_openssl ? "" : "not "); NSLOG(netsurf, INFO, "cURL %slinked against openssl",
curl_with_openssl ? "" : "not ");
/* cURL initialised okay, register the fetchers */ /* cURL initialised okay, register the fetchers */
@ -1532,19 +1548,21 @@ nserror fetch_curl_register(void)
} }
if (fetcher_add(scheme, &fetcher_ops) != NSERROR_OK) { if (fetcher_add(scheme, &fetcher_ops) != NSERROR_OK) {
LOG("Unable to register cURL fetcher for %s", data->protocols[i]); NSLOG(netsurf, INFO,
"Unable to register cURL fetcher for %s",
data->protocols[i]);
} }
} }
return NSERROR_OK; return NSERROR_OK;
curl_easy_setopt_failed: curl_easy_setopt_failed:
LOG("curl_easy_setopt failed."); NSLOG(netsurf, INFO, "curl_easy_setopt failed.");
return NSERROR_INIT_FAILED; return NSERROR_INIT_FAILED;
#if LIBCURL_VERSION_NUM >= 0x071e00 #if LIBCURL_VERSION_NUM >= 0x071e00
curl_multi_setopt_failed: curl_multi_setopt_failed:
LOG("curl_multi_setopt failed."); NSLOG(netsurf, INFO, "curl_multi_setopt failed.");
return NSERROR_INIT_FAILED; return NSERROR_INIT_FAILED;
#endif #endif
} }

View File

@ -57,14 +57,16 @@ static struct fetch_data_context *ring = NULL;
static bool fetch_data_initialise(lwc_string *scheme) static bool fetch_data_initialise(lwc_string *scheme)
{ {
LOG("fetch_data_initialise called for %s", lwc_string_data(scheme)); NSLOG(netsurf, INFO, "fetch_data_initialise called for %s",
lwc_string_data(scheme));
return true; return true;
} }
static void fetch_data_finalise(lwc_string *scheme) static void fetch_data_finalise(lwc_string *scheme)
{ {
LOG("fetch_data_finalise called for %s", lwc_string_data(scheme)); NSLOG(netsurf, INFO, "fetch_data_finalise called for %s",
lwc_string_data(scheme));
} }
static bool fetch_data_can_fetch(const nsurl *url) static bool fetch_data_can_fetch(const nsurl *url)
@ -147,7 +149,7 @@ static bool fetch_data_process(struct fetch_data_context *c)
* data must still be there. * data must still be there.
*/ */
LOG("url: %.140s", c->url); NSLOG(netsurf, INFO, "url: %.140s", c->url);
if (strlen(c->url) < 6) { if (strlen(c->url) < 6) {
/* 6 is the minimum possible length (data:,) */ /* 6 is the minimum possible length (data:,) */
@ -259,8 +261,10 @@ static void fetch_data_poll(lwc_string *scheme)
char header[64]; char header[64];
fetch_set_http_code(c->parent_fetch, 200); fetch_set_http_code(c->parent_fetch, 200);
LOG("setting data: MIME type to %s, length to %" PRIsizet, NSLOG(netsurf, INFO,
c->mimetype, c->datalen); "setting data: MIME type to %s, length to %"PRIsizet,
c->mimetype,
c->datalen);
/* Any callback can result in the fetch being aborted. /* Any callback can result in the fetch being aborted.
* Therefore, we _must_ check for this after _every_ * Therefore, we _must_ check for this after _every_
* call to fetch_data_send_callback(). * call to fetch_data_send_callback().
@ -296,7 +300,8 @@ static void fetch_data_poll(lwc_string *scheme)
fetch_data_send_callback(&msg, c); fetch_data_send_callback(&msg, c);
} }
} else { } else {
LOG("Processing of %s failed!", c->url); NSLOG(netsurf, INFO, "Processing of %s failed!",
c->url);
/* Ensure that we're unlocked here. If we aren't, /* Ensure that we're unlocked here. If we aren't,
* then fetch_data_process() is broken. * then fetch_data_process() is broken.

View File

@ -276,14 +276,16 @@ static bool fetch_resource_initialise(lwc_string *scheme)
&e->data, &e->data,
&e->data_len); &e->data_len);
if (res == NSERROR_OK) { if (res == NSERROR_OK) {
LOG("direct data for %s", fetch_resource_paths[i]); NSLOG(netsurf, INFO, "direct data for %s",
fetch_resource_paths[i]);
fetch_resource_path_count++; fetch_resource_path_count++;
} else { } else {
e->redirect_url = guit->fetch->get_resource_url(fetch_resource_paths[i]); e->redirect_url = guit->fetch->get_resource_url(fetch_resource_paths[i]);
if (e->redirect_url == NULL) { if (e->redirect_url == NULL) {
lwc_string_unref(e->path); lwc_string_unref(e->path);
} else { } else {
LOG("redirect url for %s", fetch_resource_paths[i]); NSLOG(netsurf, INFO, "redirect url for %s",
fetch_resource_paths[i]);
fetch_resource_path_count++; fetch_resource_path_count++;
} }
} }

View File

@ -519,11 +519,12 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
* This entry cannot be immediately removed as it has * This entry cannot be immediately removed as it has
* associated allocation so wait for allocation release. * associated allocation so wait for allocation release.
*/ */
LOG("invalidating entry with referenced allocation"); NSLOG(netsurf, INFO,
"invalidating entry with referenced allocation");
return NSERROR_OK; return NSERROR_OK;
} }
LOG("Removing entry for %p", bse); NSLOG(netsurf, INFO, "Removing entry for %p", bse);
/* remove the entry from the index */ /* remove the entry from the index */
ret = remove_store_entry(state, &bse); ret = remove_store_entry(state, &bse);
@ -533,12 +534,12 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
ret = invalidate_element(state, bse, ENTRY_ELEM_META); ret = invalidate_element(state, bse, ENTRY_ELEM_META);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("Error invalidating metadata element"); NSLOG(netsurf, INFO, "Error invalidating metadata element");
} }
ret = invalidate_element(state, bse, ENTRY_ELEM_DATA); ret = invalidate_element(state, bse, ENTRY_ELEM_DATA);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("Error invalidating data element"); NSLOG(netsurf, INFO, "Error invalidating data element");
} }
return NSERROR_OK; return NSERROR_OK;
@ -620,8 +621,10 @@ static nserror store_evict(struct store_state *state)
return NSERROR_OK; return NSERROR_OK;
} }
LOG("Evicting entries to reduce %"PRIu64" by %"PRIsizet, NSLOG(netsurf, INFO,
state->total_alloc, state->hysteresis); "Evicting entries to reduce %"PRIu64" by %"PRIsizet,
state->total_alloc,
state->hysteresis);
/* allocate storage for the list */ /* allocate storage for the list */
elist = malloc(sizeof(entry_ident_t) * state->last_entry); elist = malloc(sizeof(entry_ident_t) * state->last_entry);
@ -658,7 +661,8 @@ static nserror store_evict(struct store_state *state)
free(elist); free(elist);
LOG("removed %"PRIsizet" in %d entries", removed, ent); NSLOG(netsurf, INFO, "removed %"PRIsizet" in %d entries", removed,
ent);
return ret; return ret;
} }
@ -773,7 +777,10 @@ static nserror write_blocks(struct store_state *state)
&state->blocks[elem_idx][bfidx].use_map[0], &state->blocks[elem_idx][bfidx].use_map[0],
BLOCK_USE_MAP_SIZE); BLOCK_USE_MAP_SIZE);
if (wr != BLOCK_USE_MAP_SIZE) { if (wr != BLOCK_USE_MAP_SIZE) {
LOG("writing block file %d use index on file number %d failed", elem_idx, bfidx); NSLOG(netsurf, INFO,
"writing block file %d use index on file number %d failed",
elem_idx,
bfidx);
goto wr_err; goto wr_err;
} }
written += wr; written += wr;
@ -829,19 +836,21 @@ static nserror set_block_extents(struct store_state *state)
return NSERROR_OK; return NSERROR_OK;
} }
LOG("Starting"); NSLOG(netsurf, INFO, "Starting");
for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) { for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) {
for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) { for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
if (state->blocks[elem_idx][bfidx].fd != -1) { if (state->blocks[elem_idx][bfidx].fd != -1) {
/* ensure block file is correct extent */ /* ensure block file is correct extent */
ftr = ftruncate(state->blocks[elem_idx][bfidx].fd, 1U << (log2_block_size[elem_idx] + BLOCK_ENTRY_COUNT)); ftr = ftruncate(state->blocks[elem_idx][bfidx].fd, 1U << (log2_block_size[elem_idx] + BLOCK_ENTRY_COUNT));
if (ftr == -1) { if (ftr == -1) {
LOG("Truncate failed errno:%d", errno); NSLOG(netsurf, INFO,
"Truncate failed errno:%d",
errno);
} }
} }
} }
} }
LOG("Complete"); NSLOG(netsurf, INFO, "Complete");
state->blocks_opened = false; state->blocks_opened = false;
@ -886,7 +895,7 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
entry_ident_t ident; entry_ident_t ident;
unsigned int sei; /* store entry index */ unsigned int sei; /* store entry index */
LOG("url:%s", nsurl_access(url)); NSLOG(netsurf, INFO, "url:%s", nsurl_access(url));
/* use the url hash as the entry identifier */ /* use the url hash as the entry identifier */
ident = nsurl_hash(url); ident = nsurl_hash(url);
@ -894,13 +903,14 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
sei = BS_ENTRY_INDEX(ident, state); sei = BS_ENTRY_INDEX(ident, state);
if (sei == 0) { if (sei == 0) {
LOG("Failed to find ident 0x%x in index", ident); NSLOG(netsurf, INFO, "Failed to find ident 0x%x in index",
ident);
return NSERROR_NOT_FOUND; return NSERROR_NOT_FOUND;
} }
if (state->entries[sei].ident != ident) { if (state->entries[sei].ident != ident) {
/* entry ident did not match */ /* entry ident did not match */
LOG("ident did not match entry"); NSLOG(netsurf, INFO, "ident did not match entry");
return NSERROR_NOT_FOUND; return NSERROR_NOT_FOUND;
} }
@ -975,7 +985,7 @@ set_store_entry(struct store_state *state,
nserror ret; nserror ret;
struct store_entry_element *elem; struct store_entry_element *elem;
LOG("url:%s", nsurl_access(url)); NSLOG(netsurf, INFO, "url:%s", nsurl_access(url));
/* evict entries as required and ensure there is at least one /* evict entries as required and ensure there is at least one
* new entry available. * new entry available.
@ -1013,7 +1023,10 @@ set_store_entry(struct store_state *state,
* to see if the old entry is in use and if * to see if the old entry is in use and if
* not prefer the newly stored entry instead? * not prefer the newly stored entry instead?
*/ */
LOG("Entry index collision trying to replace %x with %x", se->ident, ident); NSLOG(netsurf, INFO,
"Entry index collision trying to replace %x with %x",
se->ident,
ident);
return NSERROR_PERMISSION; return NSERROR_PERMISSION;
} }
} }
@ -1026,7 +1039,8 @@ set_store_entry(struct store_state *state,
/* this entry cannot be removed as it has associated /* this entry cannot be removed as it has associated
* allocation. * allocation.
*/ */
LOG("attempt to overwrite entry with in use data"); NSLOG(netsurf, INFO,
"attempt to overwrite entry with in use data");
return NSERROR_PERMISSION; return NSERROR_PERMISSION;
} }
@ -1085,7 +1099,7 @@ store_open(struct store_state *state,
fname = store_fname(state, ident, elem_idx); fname = store_fname(state, ident, elem_idx);
if (fname == NULL) { if (fname == NULL) {
LOG("filename error"); NSLOG(netsurf, INFO, "filename error");
return -1; return -1;
} }
@ -1093,13 +1107,14 @@ store_open(struct store_state *state,
if (openflags & O_CREAT) { if (openflags & O_CREAT) {
ret = netsurf_mkdir_all(fname); ret = netsurf_mkdir_all(fname);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("file path \"%s\" could not be created", fname); NSLOG(netsurf, INFO,
"file path \"%s\" could not be created", fname);
free(fname); free(fname);
return -1; return -1;
} }
} }
LOG("opening %s", fname); NSLOG(netsurf, INFO, "opening %s", fname);
fd = open(fname, openflags, S_IRUSR | S_IWUSR); fd = open(fname, openflags, S_IRUSR | S_IWUSR);
free(fname); free(fname);
@ -1126,9 +1141,9 @@ build_entrymap(struct store_state *state)
{ {
unsigned int eloop; unsigned int eloop;
LOG("Allocating %ld bytes for max of %d buckets", NSLOG(netsurf, INFO, "Allocating %ld bytes for max of %d buckets",
(1 << state->ident_bits) * sizeof(entry_index_t), (1 << state->ident_bits) * sizeof(entry_index_t),
1 << state->ident_bits); 1 << state->ident_bits);
state->addrmap = calloc(1 << state->ident_bits, sizeof(entry_index_t)); state->addrmap = calloc(1 << state->ident_bits, sizeof(entry_index_t));
if (state->addrmap == NULL) { if (state->addrmap == NULL) {
@ -1204,10 +1219,12 @@ read_entries(struct store_state *state)
entries_size = (1 << state->entry_bits) * sizeof(struct store_entry); entries_size = (1 << state->entry_bits) * sizeof(struct store_entry);
LOG("Allocating %"PRIsizet" bytes for max of %d entries of %ld length elements %ld length", NSLOG(netsurf, INFO,
entries_size, 1 << state->entry_bits, "Allocating %"PRIsizet" bytes for max of %d entries of %ld length elements %ld length",
sizeof(struct store_entry), entries_size,
sizeof(struct store_entry_element)); 1 << state->entry_bits,
sizeof(struct store_entry),
sizeof(struct store_entry_element));
state->entries = calloc(1, entries_size); state->entries = calloc(1, entries_size);
if (state->entries == NULL) { if (state->entries == NULL) {
@ -1222,7 +1239,8 @@ read_entries(struct store_state *state)
close(fd); close(fd);
if (rd > 0) { if (rd > 0) {
state->last_entry = rd / sizeof(struct store_entry); state->last_entry = rd / sizeof(struct store_entry);
LOG("Read %d entries", state->last_entry); NSLOG(netsurf, INFO, "Read %d entries",
state->last_entry);
} }
} else { } else {
/* could rebuild entries from fs */ /* could rebuild entries from fs */
@ -1253,7 +1271,7 @@ read_blocks(struct store_state *state)
return ret; return ret;
} }
LOG("Initialising block use map from %s", fname); NSLOG(netsurf, INFO, "Initialising block use map from %s", fname);
fd = open(fname, O_RDWR); fd = open(fname, O_RDWR);
free(fname); free(fname);
@ -1265,7 +1283,10 @@ read_blocks(struct store_state *state)
&state->blocks[elem_idx][bfidx].use_map[0], &state->blocks[elem_idx][bfidx].use_map[0],
BLOCK_USE_MAP_SIZE); BLOCK_USE_MAP_SIZE);
if (rd <= 0) { if (rd <= 0) {
LOG("reading block file %d use index on file number %d failed", elem_idx, bfidx); NSLOG(netsurf, INFO,
"reading block file %d use index on file number %d failed",
elem_idx,
bfidx);
goto rd_err; goto rd_err;
} }
} }
@ -1274,7 +1295,7 @@ read_blocks(struct store_state *state)
close(fd); close(fd);
} else { } else {
LOG("Initialising block use map to defaults"); NSLOG(netsurf, INFO, "Initialising block use map to defaults");
/* ensure block 0 (invalid sentinel) is skipped */ /* ensure block 0 (invalid sentinel) is skipped */
state->blocks[ENTRY_ELEM_DATA][0].use_map[0] = 1; state->blocks[ENTRY_ELEM_DATA][0].use_map[0] = 1;
state->blocks[ENTRY_ELEM_META][0].use_map[0] = 1; state->blocks[ENTRY_ELEM_META][0].use_map[0] = 1;
@ -1344,7 +1365,7 @@ write_control(struct store_state *state)
return ret; return ret;
} }
LOG("writing control file \"%s\"", fname); NSLOG(netsurf, INFO, "writing control file \"%s\"", fname);
ret = netsurf_mkdir_all(fname); ret = netsurf_mkdir_all(fname);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
@ -1392,7 +1413,7 @@ read_control(struct store_state *state)
return ret; return ret;
} }
LOG("opening control file \"%s\"", fname); NSLOG(netsurf, INFO, "opening control file \"%s\"", fname);
fcontrol = fopen(fname, "rb"); fcontrol = fopen(fname, "rb");
@ -1509,7 +1530,8 @@ initialise(const struct llcache_store_parameters *parameters)
/* read store control and create new if required */ /* read store control and create new if required */
ret = read_control(newstate); ret = read_control(newstate);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("read control failed %s", messages_get_errorcode(ret)); NSLOG(netsurf, INFO, "read control failed %s",
messages_get_errorcode(ret));
ret = write_control(newstate); ret = write_control(newstate);
if (ret == NSERROR_OK) { if (ret == NSERROR_OK) {
unlink_entries(newstate); unlink_entries(newstate);
@ -1558,15 +1580,17 @@ initialise(const struct llcache_store_parameters *parameters)
storestate = newstate; storestate = newstate;
LOG("FS backing store init successful"); NSLOG(netsurf, INFO, "FS backing store init successful");
LOG("path:%s limit:%"PRIsizet" hyst:%"PRIsizet" addr:%d entries:%d", NSLOG(netsurf, INFO,
newstate->path, "path:%s limit:%"PRIsizet" hyst:%"PRIsizet" addr:%d entries:%d",
newstate->limit, newstate->path,
newstate->hysteresis, newstate->limit,
newstate->ident_bits, newstate->hysteresis,
newstate->entry_bits); newstate->ident_bits,
LOG("Using %"PRIu64"/%"PRIsizet, newstate->total_alloc, newstate->limit); newstate->entry_bits);
NSLOG(netsurf, INFO, "Using %"PRIu64"/%"PRIsizet,
newstate->total_alloc, newstate->limit);
return NSERROR_OK; return NSERROR_OK;
} }
@ -1605,14 +1629,15 @@ finalise(void)
/* avoid division by zero */ /* avoid division by zero */
if (op_count > 0) { if (op_count > 0) {
LOG("Cache total/hit/miss/fail (counts) %d/%"PRIsizet"/%"PRIsizet"/%d (100%%/%"PRIsizet"%%/%"PRIsizet"%%/%d%%)", NSLOG(netsurf, INFO,
op_count, "Cache total/hit/miss/fail (counts) %d/%"PRIsizet"/%"PRIsizet"/%d (100%%/%"PRIsizet"%%/%"PRIsizet"%%/%d%%)",
storestate->hit_count, op_count,
storestate->miss_count, storestate->hit_count,
0, storestate->miss_count,
(storestate->hit_count * 100) / op_count, 0,
(storestate->miss_count * 100) / op_count, (storestate->hit_count * 100) / op_count,
0); (storestate->miss_count * 100) / op_count,
0);
} }
free(storestate->path); free(storestate->path);
@ -1646,7 +1671,7 @@ static nserror store_write_block(struct store_state *state,
state->blocks[elem_idx][bf].fd = store_open(state, bf, state->blocks[elem_idx][bf].fd = store_open(state, bf,
elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR); elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
if (state->blocks[elem_idx][bf].fd == -1) { if (state->blocks[elem_idx][bf].fd == -1) {
LOG("Open failed errno %d", errno); NSLOG(netsurf, INFO, "Open failed errno %d", errno);
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
@ -1661,21 +1686,21 @@ static nserror store_write_block(struct store_state *state,
bse->elem[elem_idx].size, bse->elem[elem_idx].size,
offst); offst);
if (wr != (ssize_t)bse->elem[elem_idx].size) { if (wr != (ssize_t)bse->elem[elem_idx].size) {
LOG("Write failed %"PRIssizet" of %d bytes from %p at 0x%jx block %d errno %d", NSLOG(netsurf, INFO,
wr, "Write failed %"PRIssizet" of %d bytes from %p at 0x%jx block %d errno %d",
bse->elem[elem_idx].size, wr,
bse->elem[elem_idx].data, bse->elem[elem_idx].size,
(uintmax_t)offst, bse->elem[elem_idx].data,
bse->elem[elem_idx].block, (uintmax_t)offst,
errno); bse->elem[elem_idx].block,
errno);
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
LOG("Wrote %"PRIssizet" bytes from %p at 0x%jx block %d", NSLOG(netsurf, INFO,
wr, "Wrote %"PRIssizet" bytes from %p at 0x%jx block %d", wr,
bse->elem[elem_idx].data, bse->elem[elem_idx].data, (uintmax_t)offst,
(uintmax_t)offst, bse->elem[elem_idx].block);
bse->elem[elem_idx].block);
return NSERROR_OK; return NSERROR_OK;
} }
@ -1699,7 +1724,7 @@ static nserror store_write_file(struct store_state *state,
fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY); fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY);
if (fd < 0) { if (fd < 0) {
perror(""); perror("");
LOG("Open failed %d errno %d", fd, errno); NSLOG(netsurf, INFO, "Open failed %d errno %d", fd, errno);
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
@ -1708,17 +1733,19 @@ static nserror store_write_file(struct store_state *state,
close(fd); close(fd);
if (wr != (ssize_t)bse->elem[elem_idx].size) { if (wr != (ssize_t)bse->elem[elem_idx].size) {
LOG("Write failed %"PRIssizet" of %d bytes from %p errno %d", NSLOG(netsurf, INFO,
wr, "Write failed %"PRIssizet" of %d bytes from %p errno %d",
bse->elem[elem_idx].size, wr,
bse->elem[elem_idx].data, bse->elem[elem_idx].size,
err); bse->elem[elem_idx].data,
err);
/** @todo Delete the file? */ /** @todo Delete the file? */
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
LOG("Wrote %"PRIssizet" bytes from %p", wr, bse->elem[elem_idx].data); NSLOG(netsurf, INFO, "Wrote %"PRIssizet" bytes from %p", wr,
bse->elem[elem_idx].data);
return NSERROR_OK; return NSERROR_OK;
} }
@ -1759,7 +1786,7 @@ store(nsurl *url,
/* set the store entry up */ /* set the store entry up */
ret = set_store_entry(storestate, url, elem_idx, data, datalen, &bse); ret = set_store_entry(storestate, url, elem_idx, data, datalen, &bse);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("store entry setting failed"); NSLOG(netsurf, INFO, "store entry setting failed");
return ret; return ret;
} }
@ -1782,7 +1809,7 @@ static nserror entry_release_alloc(struct store_entry_element *elem)
if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) { if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
elem->ref--; elem->ref--;
if (elem->ref == 0) { if (elem->ref == 0) {
LOG("freeing %p", elem->data); NSLOG(netsurf, INFO, "freeing %p", elem->data);
free(elem->data); free(elem->data);
elem->flags &= ~ENTRY_ELEM_FLAG_HEAP; elem->flags &= ~ENTRY_ELEM_FLAG_HEAP;
} }
@ -1814,7 +1841,7 @@ static nserror store_read_block(struct store_state *state,
state->blocks[elem_idx][bf].fd = store_open(state, bf, state->blocks[elem_idx][bf].fd = store_open(state, bf,
elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR); elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
if (state->blocks[elem_idx][bf].fd == -1) { if (state->blocks[elem_idx][bf].fd == -1) {
LOG("Open failed errno %d", errno); NSLOG(netsurf, INFO, "Open failed errno %d", errno);
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
@ -1829,21 +1856,21 @@ static nserror store_read_block(struct store_state *state,
bse->elem[elem_idx].size, bse->elem[elem_idx].size,
offst); offst);
if (rd != (ssize_t)bse->elem[elem_idx].size) { if (rd != (ssize_t)bse->elem[elem_idx].size) {
LOG("Failed reading %"PRIssizet" of %d bytes into %p from 0x%jx block %d errno %d", NSLOG(netsurf, INFO,
rd, "Failed reading %"PRIssizet" of %d bytes into %p from 0x%jx block %d errno %d",
bse->elem[elem_idx].size, rd,
bse->elem[elem_idx].data, bse->elem[elem_idx].size,
(uintmax_t)offst, bse->elem[elem_idx].data,
bse->elem[elem_idx].block, (uintmax_t)offst,
errno); bse->elem[elem_idx].block,
errno);
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
LOG("Read %"PRIssizet" bytes into %p from 0x%jx block %d", NSLOG(netsurf, INFO,
rd, "Read %"PRIssizet" bytes into %p from 0x%jx block %d", rd,
bse->elem[elem_idx].data, bse->elem[elem_idx].data, (uintmax_t)offst,
(uintmax_t)offst, bse->elem[elem_idx].block);
bse->elem[elem_idx].block);
return NSERROR_OK; return NSERROR_OK;
} }
@ -1868,7 +1895,7 @@ static nserror store_read_file(struct store_state *state,
/* separate file in backing store */ /* separate file in backing store */
fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY); fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY);
if (fd < 0) { if (fd < 0) {
LOG("Open failed %d errno %d", fd, errno); NSLOG(netsurf, INFO, "Open failed %d errno %d", fd, errno);
/** @todo should this invalidate the entry? */ /** @todo should this invalidate the entry? */
return NSERROR_NOT_FOUND; return NSERROR_NOT_FOUND;
} }
@ -1878,8 +1905,10 @@ static nserror store_read_file(struct store_state *state,
bse->elem[elem_idx].data + tot, bse->elem[elem_idx].data + tot,
bse->elem[elem_idx].size - tot); bse->elem[elem_idx].size - tot);
if (rd <= 0) { if (rd <= 0) {
LOG("read error returned %"PRIssizet" errno %d", NSLOG(netsurf, INFO,
rd, errno); "read error returned %"PRIssizet" errno %d",
rd,
errno);
ret = NSERROR_NOT_FOUND; ret = NSERROR_NOT_FOUND;
break; break;
} }
@ -1888,7 +1917,8 @@ static nserror store_read_file(struct store_state *state,
close(fd); close(fd);
LOG("Read %"PRIsizet" bytes into %p", tot, bse->elem[elem_idx].data); NSLOG(netsurf, INFO, "Read %"PRIsizet" bytes into %p", tot,
bse->elem[elem_idx].data);
return ret; return ret;
} }
@ -1921,13 +1951,14 @@ fetch(nsurl *url,
/* fetch store entry */ /* fetch store entry */
ret = get_store_entry(storestate, url, &bse); ret = get_store_entry(storestate, url, &bse);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("entry not found"); NSLOG(netsurf, INFO, "entry not found");
storestate->miss_count++; storestate->miss_count++;
return ret; return ret;
} }
storestate->hit_count++; storestate->hit_count++;
LOG("retrieving cache data for url:%s", nsurl_access(url)); NSLOG(netsurf, INFO, "retrieving cache data for url:%s",
nsurl_access(url));
/* calculate the entry element index */ /* calculate the entry element index */
if ((bsflags & BACKING_STORE_META) != 0) { if ((bsflags & BACKING_STORE_META) != 0) {
@ -1942,16 +1973,20 @@ fetch(nsurl *url,
/* use the existing allocation and bump the ref count. */ /* use the existing allocation and bump the ref count. */
elem->ref++; elem->ref++;
LOG("Using existing entry (%p) allocation %p refs:%d", bse, elem->data, elem->ref); NSLOG(netsurf, INFO,
"Using existing entry (%p) allocation %p refs:%d", bse,
elem->data, elem->ref);
} else { } else {
/* allocate from the heap */ /* allocate from the heap */
elem->data = malloc(elem->size); elem->data = malloc(elem->size);
if (elem->data == NULL) { if (elem->data == NULL) {
LOG("Failed to create new heap allocation"); NSLOG(netsurf, INFO,
"Failed to create new heap allocation");
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
LOG("Created new heap allocation %p", elem->data); NSLOG(netsurf, INFO, "Created new heap allocation %p",
elem->data);
/* mark the entry as having a valid heap allocation */ /* mark the entry as having a valid heap allocation */
elem->flags |= ENTRY_ELEM_FLAG_HEAP; elem->flags |= ENTRY_ELEM_FLAG_HEAP;
@ -2000,7 +2035,7 @@ static nserror release(nsurl *url, enum backing_store_flags bsflags)
ret = get_store_entry(storestate, url, &bse); ret = get_store_entry(storestate, url, &bse);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("entry not found"); NSLOG(netsurf, INFO, "entry not found");
return ret; return ret;
} }

View File

@ -321,9 +321,11 @@ static css_error nscss_convert_css_data(struct content_css_data *c)
const char *url; const char *url;
if (css_stylesheet_get_url(c->sheet, &url) == CSS_OK) { if (css_stylesheet_get_url(c->sheet, &url) == CSS_OK) {
LOG("Failed converting %p %s (%d)", c, url, error); NSLOG(netsurf, INFO, "Failed converting %p %s (%d)",
c, url, error);
} else { } else {
LOG("Failed converting %p (%d)", c, error); NSLOG(netsurf, INFO, "Failed converting %p (%d)", c,
error);
} }
} }
@ -598,7 +600,9 @@ css_error nscss_handle_import(void *pw, css_stylesheet *parent,
nsurl_unref(ns_ref); nsurl_unref(ns_ref);
#ifdef NSCSS_IMPORT_TRACE #ifdef NSCSS_IMPORT_TRACE
LOG("Import %d '%s' -> (handle: %p ctx: %p)", c->import_count, lwc_string_data(url), c->imports[c->import_count].c, ctx); NSLOG(netsurf, INFO, "Import %d '%s' -> (handle: %p ctx: %p)",
c->import_count, lwc_string_data(url),
c->imports[c->import_count].c, ctx);
#endif #endif
c->import_count++; c->import_count++;
@ -621,7 +625,7 @@ nserror nscss_import(hlcache_handle *handle,
css_error error = CSS_OK; css_error error = CSS_OK;
#ifdef NSCSS_IMPORT_TRACE #ifdef NSCSS_IMPORT_TRACE
LOG("Event %d for %p (%p)", event->type, handle, ctx); NSLOG(netsurf, INFO, "Event %d for %p (%p)", event->type, handle, ctx);
#endif #endif
assert(ctx->css->imports[ctx->index].c == handle); assert(ctx->css->imports[ctx->index].c == handle);
@ -663,7 +667,8 @@ css_error nscss_import_complete(nscss_import_ctx *ctx)
error = nscss_register_imports(ctx->css); error = nscss_register_imports(ctx->css);
#ifdef NSCSS_IMPORT_TRACE #ifdef NSCSS_IMPORT_TRACE
LOG("Destroying import context %p for %d", ctx, ctx->index); NSLOG(netsurf, INFO, "Destroying import context %p for %d", ctx,
ctx->index);
#endif #endif
/* No longer need import context */ /* No longer need import context */

View File

@ -1615,7 +1615,7 @@ css_error node_presentational_hint(void *pw, void *node,
} }
#ifdef LOG_STATS #ifdef LOG_STATS
LOG("Properties with hints: %i", hint_ctx.len); NSLOG(netsurf, INFO, "Properties with hints: %i", hint_ctx.len);
#endif #endif
css_hint_get_hints(hints, nhints); css_hint_get_hints(hints, nhints);

View File

@ -175,20 +175,20 @@ css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len,
error = css_stylesheet_create(&params, &sheet); error = css_stylesheet_create(&params, &sheet);
if (error != CSS_OK) { if (error != CSS_OK) {
LOG("Failed creating sheet: %d", error); NSLOG(netsurf, INFO, "Failed creating sheet: %d", error);
return NULL; return NULL;
} }
error = css_stylesheet_append_data(sheet, data, len); error = css_stylesheet_append_data(sheet, data, len);
if (error != CSS_OK && error != CSS_NEEDDATA) { if (error != CSS_OK && error != CSS_NEEDDATA) {
LOG("failed appending data: %d", error); NSLOG(netsurf, INFO, "failed appending data: %d", error);
css_stylesheet_destroy(sheet); css_stylesheet_destroy(sheet);
return NULL; return NULL;
} }
error = css_stylesheet_data_done(sheet); error = css_stylesheet_data_done(sheet);
if (error != CSS_OK) { if (error != CSS_OK) {
LOG("failed completing parse: %d", error); NSLOG(netsurf, INFO, "failed completing parse: %d", error);
css_stylesheet_destroy(sheet); css_stylesheet_destroy(sheet);
return NULL; return NULL;
} }
@ -214,7 +214,8 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_CLONED, CSS_NODE_CLONED,
NULL, src, dst, data); NULL, src, dst, data);
if (error != CSS_OK) if (error != CSS_OK)
LOG("Failed to clone libcss_node_data."); NSLOG(netsurf, INFO,
"Failed to clone libcss_node_data.");
break; break;
case DOM_NODE_RENAMED: case DOM_NODE_RENAMED:
@ -222,7 +223,8 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_MODIFIED, CSS_NODE_MODIFIED,
NULL, src, NULL, data); NULL, src, NULL, data);
if (error != CSS_OK) if (error != CSS_OK)
LOG("Failed to update libcss_node_data."); NSLOG(netsurf, INFO,
"Failed to update libcss_node_data.");
break; break;
case DOM_NODE_IMPORTED: case DOM_NODE_IMPORTED:
@ -232,11 +234,12 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_DELETED, CSS_NODE_DELETED,
NULL, src, NULL, data); NULL, src, NULL, data);
if (error != CSS_OK) if (error != CSS_OK)
LOG("Failed to delete libcss_node_data."); NSLOG(netsurf, INFO,
"Failed to delete libcss_node_data.");
break; break;
default: default:
LOG("User data operation not handled."); NSLOG(netsurf, INFO, "User data operation not handled.");
assert(0); assert(0);
} }
} }

View File

@ -160,7 +160,7 @@ static bool nsico_convert(struct content *c)
bmp = ico_find(ico->ico, 255, 255); bmp = ico_find(ico->ico, 255, 255);
if (bmp == NULL) { if (bmp == NULL) {
/* return error */ /* return error */
LOG("Failed to select icon"); NSLOG(netsurf, INFO, "Failed to select icon");
return false; return false;
} }
@ -183,7 +183,7 @@ static bool nsico_redraw(struct content *c, struct content_redraw_data *data,
bmp = ico_find(ico->ico, data->width, data->height); bmp = ico_find(ico->ico, data->width, data->height);
if (bmp == NULL) { if (bmp == NULL) {
/* return error */ /* return error */
LOG("Failed to select icon"); NSLOG(netsurf, INFO, "Failed to select icon");
return false; return false;
} }
@ -192,7 +192,7 @@ static bool nsico_redraw(struct content *c, struct content_redraw_data *data,
if (bmp_decode(bmp) != BMP_OK) { if (bmp_decode(bmp) != BMP_OK) {
return false; return false;
} else { } else {
LOG("Decoding bitmap"); NSLOG(netsurf, INFO, "Decoding bitmap");
guit->bitmap->modified(bmp->bitmap); guit->bitmap->modified(bmp->bitmap);
} }
@ -255,7 +255,7 @@ static void *nsico_get_internal(const struct content *c, void *context)
bmp = ico_find(ico->ico, 16, 16); bmp = ico_find(ico->ico, 16, 16);
if (bmp == NULL) { if (bmp == NULL) {
/* return error */ /* return error */
LOG("Failed to select icon"); NSLOG(netsurf, INFO, "Failed to select icon");
return NULL; return NULL;
} }

View File

@ -256,11 +256,12 @@ static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
{ {
if (centry->bitmap != NULL) { if (centry->bitmap != NULL) {
#ifdef IMAGE_CACHE_VERBOSE #ifdef IMAGE_CACHE_VERBOSE
LOG("Freeing bitmap %p size %d age %d redraw count %d", NSLOG(netsurf, INFO,
centry->bitmap, "Freeing bitmap %p size %d age %d redraw count %d",
centry->bitmap_size, centry->bitmap,
image_cache->current_age - centry->bitmap_age, centry->bitmap_size,
centry->redraw_count); image_cache->current_age - centry->bitmap_age,
centry->redraw_count);
#endif #endif
guit->bitmap->destroy(centry->bitmap); guit->bitmap->destroy(centry->bitmap);
centry->bitmap = NULL; centry->bitmap = NULL;
@ -281,7 +282,7 @@ static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
static void image_cache__free_entry(struct image_cache_entry_s *centry) static void image_cache__free_entry(struct image_cache_entry_s *centry)
{ {
#ifdef IMAGE_CACHE_VERBOSE #ifdef IMAGE_CACHE_VERBOSE
LOG("freeing %p ", centry); NSLOG(netsurf, INFO, "freeing %p ", centry);
#endif #endif
if (centry->redraw_count == 0) { if (centry->redraw_count == 0) {
@ -331,7 +332,7 @@ static void image_cache__background_update(void *p)
icache->current_age += icache->params.bg_clean_time; icache->current_age += icache->params.bg_clean_time;
#ifdef IMAGE_CACHE_VERBOSE #ifdef IMAGE_CACHE_VERBOSE
LOG("Cache age %ds", icache->current_age / 1000); NSLOG(netsurf, INFO, "Cache age %ds", icache->current_age / 1000);
#endif #endif
image_cache__clean(icache); image_cache__clean(icache);
@ -383,13 +384,16 @@ bool image_cache_speculate(struct content *c)
if ((image_cache->total_bitmap_size < image_cache->params.limit) && if ((image_cache->total_bitmap_size < image_cache->params.limit) &&
(c->size <= image_cache->params.speculative_small)) { (c->size <= image_cache->params.speculative_small)) {
#ifdef IMAGE_CACHE_VERBOSE #ifdef IMAGE_CACHE_VERBOSE
LOG("content size (%d) is smaller than minimum (%d)", c->size, SPECULATE_SMALL); NSLOG(netsurf, INFO,
"content size (%d) is smaller than minimum (%d)",
c->size,
SPECULATE_SMALL);
#endif #endif
decision = true; decision = true;
} }
#ifdef IMAGE_CACHE_VERBOSE #ifdef IMAGE_CACHE_VERBOSE
LOG("returning %d", decision); NSLOG(netsurf, INFO, "returning %d", decision);
#endif #endif
return decision; return decision;
} }
@ -422,8 +426,10 @@ image_cache_init(const struct image_cache_parameters *image_cache_parameters)
image_cache__background_update, image_cache__background_update,
image_cache); image_cache);
LOG("Image cache initialised with a limit of %" PRIsizet " hysteresis of %"PRIsizet, NSLOG(netsurf, INFO,
image_cache->params.limit, image_cache->params.hysteresis); "Image cache initialised with a limit of %"PRIsizet" hysteresis of %"PRIsizet,
image_cache->params.limit,
image_cache->params.hysteresis);
return NSERROR_OK; return NSERROR_OK;
} }
@ -435,8 +441,8 @@ nserror image_cache_fini(void)
guit->misc->schedule(-1, image_cache__background_update, image_cache); guit->misc->schedule(-1, image_cache__background_update, image_cache);
LOG("Size at finish %" PRIsizet " (in %d)", NSLOG(netsurf, INFO, "Size at finish %"PRIsizet" (in %d)",
image_cache->total_bitmap_size, image_cache->bitmap_count); image_cache->total_bitmap_size, image_cache->bitmap_count);
while (image_cache->entries != NULL) { while (image_cache->entries != NULL) {
image_cache__free_entry(image_cache->entries); image_cache__free_entry(image_cache->entries);
@ -446,11 +452,13 @@ nserror image_cache_fini(void)
image_cache->miss_count + image_cache->miss_count +
image_cache->fail_count; image_cache->fail_count;
LOG("Age %ds", image_cache->current_age / 1000); NSLOG(netsurf, INFO, "Age %ds", image_cache->current_age / 1000);
LOG("Peak size %" PRIsizet " (in %d)", NSLOG(netsurf, INFO, "Peak size %"PRIsizet" (in %d)",
image_cache->max_bitmap_size, image_cache->max_bitmap_size_count); image_cache->max_bitmap_size,
LOG("Peak image count %d (size %" PRIsizet ")", image_cache->max_bitmap_size_count);
image_cache->max_bitmap_count, image_cache->max_bitmap_count_size); NSLOG(netsurf, INFO, "Peak image count %d (size %"PRIsizet")",
image_cache->max_bitmap_count,
image_cache->max_bitmap_count_size);
if (op_count > 0) { if (op_count > 0) {
uint64_t op_size; uint64_t op_size;
@ -459,35 +467,39 @@ nserror image_cache_fini(void)
image_cache->miss_size + image_cache->miss_size +
image_cache->fail_size; image_cache->fail_size;
LOG("Cache total/hit/miss/fail (counts) %d/%d/%d/%d (100%%/%d%%/%d%%/%d%%)", NSLOG(netsurf, INFO,
op_count, "Cache total/hit/miss/fail (counts) %d/%d/%d/%d (100%%/%d%%/%d%%/%d%%)",
image_cache->hit_count, op_count,
image_cache->miss_count, image_cache->hit_count,
image_cache->fail_count, image_cache->miss_count,
(image_cache->hit_count * 100) / op_count, image_cache->fail_count,
(image_cache->miss_count * 100) / op_count, (image_cache->hit_count * 100) / op_count,
(image_cache->fail_count * 100) / op_count); (image_cache->miss_count * 100) / op_count,
LOG("Cache total/hit/miss/fail (size) %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64" (100%%/%"PRId64"%%/%"PRId64"%%/%"PRId64"%%)", (image_cache->fail_count * 100) / op_count);
op_size, NSLOG(netsurf, INFO,
image_cache->hit_size, "Cache total/hit/miss/fail (size) %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64" (100%%/%"PRId64"%%/%"PRId64"%%/%"PRId64"%%)",
image_cache->miss_size, op_size,
image_cache->fail_size, image_cache->hit_size,
(image_cache->hit_size * 100) / op_size, image_cache->miss_size,
(image_cache->miss_size * 100) / op_size, image_cache->fail_size,
(image_cache->fail_size * 100) / op_size); (image_cache->hit_size * 100) / op_size,
(image_cache->miss_size * 100) / op_size,
(image_cache->fail_size * 100) / op_size);
} }
LOG("Total images never rendered: %d (includes %d that were converted)", NSLOG(netsurf, INFO,
image_cache->total_unrendered, "Total images never rendered: %d (includes %d that were converted)",
image_cache->specultive_miss_count); image_cache->total_unrendered,
image_cache->specultive_miss_count);
LOG("Total number of excessive conversions: %d (from %d images converted more than once)", NSLOG(netsurf, INFO,
image_cache->total_extra_conversions, "Total number of excessive conversions: %d (from %d images converted more than once)",
image_cache->total_extra_conversions_count); image_cache->total_extra_conversions,
image_cache->total_extra_conversions_count);
LOG("Bitmap of size %d had most (%d) conversions", NSLOG(netsurf, INFO, "Bitmap of size %d had most (%d) conversions",
image_cache->peak_conversions_size, image_cache->peak_conversions_size,
image_cache->peak_conversions); image_cache->peak_conversions);
free(image_cache); free(image_cache);
@ -519,7 +531,8 @@ nserror image_cache_add(struct content *content,
centry->bitmap_size = content->width * content->height * 4; centry->bitmap_size = content->width * content->height * 4;
} }
LOG("centry %p, content %p, bitmap %p", centry, content, bitmap); NSLOG(netsurf, INFO, "centry %p, content %p, bitmap %p", centry,
content, bitmap);
centry->convert = convert; centry->convert = convert;
@ -558,7 +571,8 @@ nserror image_cache_remove(struct content *content)
/* get the cache entry */ /* get the cache entry */
centry = image_cache__find(content); centry = image_cache__find(content);
if (centry == NULL) { if (centry == NULL) {
LOG("Could not find cache entry for content (%p)", content); NSLOG(netsurf, INFO,
"Could not find cache entry for content (%p)", content);
return NSERROR_NOT_FOUND; return NSERROR_NOT_FOUND;
} }
@ -788,7 +802,8 @@ bool image_cache_redraw(struct content *c,
/* get the cache entry */ /* get the cache entry */
centry = image_cache__find(c); centry = image_cache__find(c);
if (centry == NULL) { if (centry == NULL) {
LOG("Could not find cache entry for content (%p)", c); NSLOG(netsurf, INFO,
"Could not find cache entry for content (%p)", c);
return false; return false;
} }
@ -827,7 +842,8 @@ void image_cache_destroy(struct content *content)
/* get the cache entry */ /* get the cache entry */
centry = image_cache__find(content); centry = image_cache__find(content);
if (centry == NULL) { if (centry == NULL) {
LOG("Could not find cache entry for content (%p)", content); NSLOG(netsurf, INFO,
"Could not find cache entry for content (%p)", content);
} else { } else {
image_cache__free_entry(centry); image_cache__free_entry(centry);
} }

View File

@ -142,7 +142,7 @@ static void nsjpeg_term_source(j_decompress_ptr cinfo)
static void nsjpeg_error_log(j_common_ptr cinfo) static void nsjpeg_error_log(j_common_ptr cinfo)
{ {
cinfo->err->format_message(cinfo, nsjpeg_error_buffer); cinfo->err->format_message(cinfo, nsjpeg_error_buffer);
LOG("%s", nsjpeg_error_buffer); NSLOG(netsurf, INFO, "%s", nsjpeg_error_buffer);
} }
@ -156,7 +156,7 @@ static void nsjpeg_error_exit(j_common_ptr cinfo)
jmp_buf *setjmp_buffer = (jmp_buf *) cinfo->client_data; jmp_buf *setjmp_buffer = (jmp_buf *) cinfo->client_data;
cinfo->err->format_message(cinfo, nsjpeg_error_buffer); cinfo->err->format_message(cinfo, nsjpeg_error_buffer);
LOG("%s", nsjpeg_error_buffer); NSLOG(netsurf, INFO, "%s", nsjpeg_error_buffer);
longjmp(*setjmp_buffer, 1); longjmp(*setjmp_buffer, 1);
} }

View File

@ -48,10 +48,10 @@ typedef struct nssprite_content {
#define ERRCHK(x) do { \ #define ERRCHK(x) do { \
rosprite_error err = x; \ rosprite_error err = x; \
if (err == ROSPRITE_EOF) { \ if (err == ROSPRITE_EOF) { \
LOG("Got ROSPRITE_EOF when loading sprite file"); \ NSLOG(netsurf, INFO, "Got ROSPRITE_EOF when loading sprite file"); \
goto ro_sprite_error; \ goto ro_sprite_error; \
} else if (err == ROSPRITE_BADMODE) { \ } else if (err == ROSPRITE_BADMODE) { \
LOG("Got ROSPRITE_BADMODE when loading sprite file"); \ NSLOG(netsurf, INFO, "Got ROSPRITE_BADMODE when loading sprite file"); \
goto ro_sprite_error; \ goto ro_sprite_error; \
} else if (err == ROSPRITE_OK) { \ } else if (err == ROSPRITE_OK) { \
} else { \ } else { \

View File

@ -74,7 +74,7 @@ enum nspng_cberr {
*/ */
static void nspng_warning(png_structp png_ptr, png_const_charp warning_message) static void nspng_warning(png_structp png_ptr, png_const_charp warning_message)
{ {
LOG("%s", warning_message); NSLOG(netsurf, INFO, "%s", warning_message);
} }
/** /**
@ -82,7 +82,7 @@ static void nspng_warning(png_structp png_ptr, png_const_charp warning_message)
*/ */
static void nspng_error(png_structp png_ptr, png_const_charp error_message) static void nspng_error(png_structp png_ptr, png_const_charp error_message)
{ {
LOG("%s", error_message); NSLOG(netsurf, INFO, "%s", error_message);
longjmp(png_jmpbuf(png_ptr), CBERR_LIBPNG); longjmp(png_jmpbuf(png_ptr), CBERR_LIBPNG);
} }
@ -175,10 +175,8 @@ static void info_callback(png_structp png_s, png_infop info)
png_c->rowbytes = png_get_rowbytes(png_s, info); png_c->rowbytes = png_get_rowbytes(png_s, info);
png_c->interlace = (interlace == PNG_INTERLACE_ADAM7); png_c->interlace = (interlace == PNG_INTERLACE_ADAM7);
LOG("size %li * %li, rowbytes %" PRIsizet, NSLOG(netsurf, INFO, "size %li * %li, rowbytes %"PRIsizet,
(unsigned long)width, (unsigned long)width, (unsigned long)height, png_c->rowbytes);
(unsigned long)height,
png_c->rowbytes);
} }
static void row_callback(png_structp png_s, png_bytep new_row, static void row_callback(png_structp png_s, png_bytep new_row,
@ -260,7 +258,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
if (setjmp(png_jmpbuf(png_c->png))) { if (setjmp(png_jmpbuf(png_c->png))) {
png_destroy_read_struct(&png_c->png, &png_c->info, 0); png_destroy_read_struct(&png_c->png, &png_c->info, 0);
LOG("Failed to set callbacks"); NSLOG(netsurf, INFO, "Failed to set callbacks");
png_c->png = NULL; png_c->png = NULL;
png_c->info = NULL; png_c->info = NULL;
@ -350,7 +348,8 @@ static bool nspng_process_data(struct content *c, const char *data,
* up png conversion and signal the content * up png conversion and signal the content
* error * error
*/ */
LOG("Fatal PNG error during header, error content"); NSLOG(netsurf, INFO,
"Fatal PNG error during header, error content");
png_destroy_read_struct(&png_c->png, &png_c->info, 0); png_destroy_read_struct(&png_c->png, &png_c->info, 0);
png_c->png = NULL; png_c->png = NULL;

View File

@ -68,7 +68,7 @@ static nserror rsvg_create_svg_data(rsvg_content *c)
c->bitmap = NULL; c->bitmap = NULL;
if ((c->rsvgh = rsvg_handle_new()) == NULL) { if ((c->rsvgh = rsvg_handle_new()) == NULL) {
LOG("rsvg_handle_new() returned NULL."); NSLOG(netsurf, INFO, "rsvg_handle_new() returned NULL.");
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -116,7 +116,8 @@ static bool rsvg_process_data(struct content *c, const char *data,
if (rsvg_handle_write(d->rsvgh, (const guchar *)data, (gsize)size, if (rsvg_handle_write(d->rsvgh, (const guchar *)data, (gsize)size,
&err) == FALSE) { &err) == FALSE) {
LOG("rsvg_handle_write returned an error: %s", err->message); NSLOG(netsurf, INFO,
"rsvg_handle_write returned an error: %s", err->message);
content_broadcast_errorcode(c, NSERROR_SVG_ERROR); content_broadcast_errorcode(c, NSERROR_SVG_ERROR);
return false; return false;
} }
@ -160,7 +161,8 @@ static bool rsvg_convert(struct content *c)
GError *err = NULL; GError *err = NULL;
if (rsvg_handle_close(d->rsvgh, &err) == FALSE) { if (rsvg_handle_close(d->rsvgh, &err) == FALSE) {
LOG("rsvg_handle_close returned an error: %s", err->message); NSLOG(netsurf, INFO,
"rsvg_handle_close returned an error: %s", err->message);
content_broadcast_errorcode(c, NSERROR_SVG_ERROR); content_broadcast_errorcode(c, NSERROR_SVG_ERROR);
return false; return false;
} }
@ -177,7 +179,8 @@ static bool rsvg_convert(struct content *c)
if ((d->bitmap = guit->bitmap->create(c->width, c->height, if ((d->bitmap = guit->bitmap->create(c->width, c->height,
BITMAP_NEW)) == NULL) { BITMAP_NEW)) == NULL) {
LOG("Failed to create bitmap for rsvg render."); NSLOG(netsurf, INFO,
"Failed to create bitmap for rsvg render.");
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_errorcode(c, NSERROR_NOMEM);
return false; return false;
} }
@ -187,13 +190,15 @@ static bool rsvg_convert(struct content *c)
CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_ARGB32,
c->width, c->height, c->width, c->height,
guit->bitmap->get_rowstride(d->bitmap))) == NULL) { guit->bitmap->get_rowstride(d->bitmap))) == NULL) {
LOG("Failed to create Cairo image surface for rsvg render."); NSLOG(netsurf, INFO,
"Failed to create Cairo image surface for rsvg render.");
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_errorcode(c, NSERROR_NOMEM);
return false; return false;
} }
if ((d->ct = cairo_create(d->cs)) == NULL) { if ((d->ct = cairo_create(d->cs)) == NULL) {
LOG("Failed to create Cairo drawing context for rsvg render."); NSLOG(netsurf, INFO,
"Failed to create Cairo drawing context for rsvg render.");
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_errorcode(c, NSERROR_NOMEM);
return false; return false;
} }

View File

@ -61,7 +61,8 @@ static duk_ret_t dukky_populate_object(duk_context *ctx, void *udata)
duk_get_prop(ctx, -2); duk_get_prop(ctx, -2);
/* ... obj args prototab {proto/undefined} */ /* ... obj args prototab {proto/undefined} */
if (duk_is_undefined(ctx, -1)) { if (duk_is_undefined(ctx, -1)) {
LOG("RuhRoh, couldn't find a prototype, HTMLUnknownElement it is"); NSLOG(netsurf, INFO,
"RuhRoh, couldn't find a prototype, HTMLUnknownElement it is");
duk_pop(ctx); duk_pop(ctx);
duk_push_string(ctx, PROTO_NAME(HTMLUNKNOWNELEMENT)); duk_push_string(ctx, PROTO_NAME(HTMLUNKNOWNELEMENT));
duk_get_prop(ctx, -2); duk_get_prop(ctx, -2);
@ -77,7 +78,7 @@ static duk_ret_t dukky_populate_object(duk_context *ctx, void *udata)
/* ... initfn obj[proto] args prototab proto */ /* ... initfn obj[proto] args prototab proto */
duk_pop_2(ctx); duk_pop_2(ctx);
/* ... initfn obj[proto] args */ /* ... initfn obj[proto] args */
LOG("Call the init function"); NSLOG(netsurf, INFO, "Call the init function");
duk_call(ctx, nargs + 1); duk_call(ctx, nargs + 1);
return 1; /* The object */ return 1; /* The object */
} }
@ -85,7 +86,7 @@ static duk_ret_t dukky_populate_object(duk_context *ctx, void *udata)
duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args) duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args)
{ {
duk_ret_t ret; duk_ret_t ret;
LOG("name=%s nargs=%d", name+2, args); NSLOG(netsurf, INFO, "name=%s nargs=%d", name + 2, args);
/* ... args */ /* ... args */
duk_push_object(ctx); duk_push_object(ctx);
/* ... args obj */ /* ... args obj */
@ -106,7 +107,7 @@ duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args)
if ((ret = duk_safe_call(ctx, dukky_populate_object, NULL, args + 3, 1)) if ((ret = duk_safe_call(ctx, dukky_populate_object, NULL, args + 3, 1))
!= DUK_EXEC_SUCCESS) != DUK_EXEC_SUCCESS)
return ret; return ret;
LOG("created"); NSLOG(netsurf, INFO, "created");
return DUK_EXEC_SUCCESS; return DUK_EXEC_SUCCESS;
} }
@ -146,7 +147,7 @@ dukky_push_node_stacked(duk_context *ctx)
if (duk_safe_call(ctx, dukky_populate_object, NULL, 4, 1) if (duk_safe_call(ctx, dukky_populate_object, NULL, 4, 1)
!= DUK_EXEC_SUCCESS) { != DUK_EXEC_SUCCESS) {
duk_set_top(ctx, top_at_fail); duk_set_top(ctx, top_at_fail);
LOG("Boo and also hiss"); NSLOG(netsurf, INFO, "Boo and also hiss");
return false; return false;
} }
/* ... nodeptr klass nodes node */ /* ... nodeptr klass nodes node */
@ -384,13 +385,14 @@ dukky_push_node_klass(duk_context *ctx, struct dom_node *node)
err = dom_node_get_namespace(node, &namespace); err = dom_node_get_namespace(node, &namespace);
if (err != DOM_NO_ERR) { if (err != DOM_NO_ERR) {
/* Feck it, element */ /* Feck it, element */
LOG("dom_node_get_namespace() failed"); NSLOG(netsurf, INFO,
"dom_node_get_namespace() failed");
duk_push_string(ctx, PROTO_NAME(ELEMENT)); duk_push_string(ctx, PROTO_NAME(ELEMENT));
break; break;
} }
if (namespace == NULL) { if (namespace == NULL) {
/* No namespace, -> element */ /* No namespace, -> element */
LOG("no namespace"); NSLOG(netsurf, INFO, "no namespace");
duk_push_string(ctx, PROTO_NAME(ELEMENT)); duk_push_string(ctx, PROTO_NAME(ELEMENT));
break; break;
} }
@ -561,7 +563,7 @@ nserror js_newcontext(int timeout, jscallback *cb, void *cbctx,
duk_context *ctx; duk_context *ctx;
jscontext *ret = calloc(1, sizeof(*ret)); jscontext *ret = calloc(1, sizeof(*ret));
*jsctx = NULL; *jsctx = NULL;
LOG("Creating new duktape javascript context"); NSLOG(netsurf, INFO, "Creating new duktape javascript context");
if (ret == NULL) return NSERROR_NOMEM; if (ret == NULL) return NSERROR_NOMEM;
ctx = ret->ctx = duk_create_heap( ctx = ret->ctx = duk_create_heap(
dukky_alloc_function, dukky_alloc_function,
@ -584,7 +586,7 @@ nserror js_newcontext(int timeout, jscallback *cb, void *cbctx,
void js_destroycontext(jscontext *ctx) void js_destroycontext(jscontext *ctx)
{ {
LOG("Destroying duktape javascript context"); NSLOG(netsurf, INFO, "Destroying duktape javascript context");
duk_destroy_heap(ctx->ctx); duk_destroy_heap(ctx->ctx);
free(ctx); free(ctx);
} }
@ -593,7 +595,9 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv)
{ {
assert(ctx != NULL); assert(ctx != NULL);
/* Pop any active thread off */ /* Pop any active thread off */
LOG("Yay, new compartment, win_priv=%p, doc_priv=%p", win_priv, doc_priv); NSLOG(netsurf, INFO,
"Yay, new compartment, win_priv=%p, doc_priv=%p", win_priv,
doc_priv);
duk_set_top(ctx->ctx, 0); duk_set_top(ctx->ctx, 0);
duk_push_thread(ctx->ctx); duk_push_thread(ctx->ctx);
ctx->thread = duk_require_context(ctx->ctx, -1); ctx->thread = duk_require_context(ctx->ctx, -1);
@ -659,15 +663,17 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
duk_get_prop_string(CTX, 0, "fileName"); duk_get_prop_string(CTX, 0, "fileName");
duk_get_prop_string(CTX, 0, "lineNumber"); duk_get_prop_string(CTX, 0, "lineNumber");
duk_get_prop_string(CTX, 0, "stack"); duk_get_prop_string(CTX, 0, "stack");
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(CTX, 1), NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(CTX, 2)); duk_safe_to_string(CTX, 1), duk_safe_to_string(CTX, 2));
LOG(" was at: %s line %s", duk_safe_to_string(CTX, 3), NSLOG(netsurf, INFO, " was at: %s line %s",
duk_safe_to_string(CTX, 4)); duk_safe_to_string(CTX, 3), duk_safe_to_string(CTX, 4));
LOG(" Stack trace: %s", duk_safe_to_string(CTX, 5)); NSLOG(netsurf, INFO, " Stack trace: %s",
duk_safe_to_string(CTX, 5));
return false; return false;
} }
if (duk_get_top(CTX) == 0) duk_push_boolean(CTX, false); if (duk_get_top(CTX) == 0) duk_push_boolean(CTX, false);
LOG("Returning %s", duk_get_boolean(CTX, 0) ? "true" : "false"); NSLOG(netsurf, INFO, "Returning %s",
duk_get_boolean(CTX, 0) ? "true" : "false");
return duk_get_boolean(CTX, 0); return duk_get_boolean(CTX, 0);
} }
@ -782,7 +788,8 @@ bool dukky_get_current_value_of_event_handler(duk_context *ctx,
/* ... node fullhandlersrc filename */ /* ... node fullhandlersrc filename */
if (duk_pcompile(ctx, DUK_COMPILE_FUNCTION) != 0) { if (duk_pcompile(ctx, DUK_COMPILE_FUNCTION) != 0) {
/* ... node err */ /* ... node err */
LOG("Unable to proceed with handler, could not compile"); NSLOG(netsurf, INFO,
"Unable to proceed with handler, could not compile");
duk_pop_2(ctx); duk_pop_2(ctx);
return false; return false;
} }
@ -816,29 +823,27 @@ static void dukky_generic_event_handler(dom_event *evt, void *pw)
duk_get_memory_functions(ctx, &funcs); duk_get_memory_functions(ctx, &funcs);
jsctx = funcs.udata; jsctx = funcs.udata;
LOG("WOOP WOOP, An event:"); NSLOG(netsurf, INFO, "WOOP WOOP, An event:");
exc = dom_event_get_type(evt, &name); exc = dom_event_get_type(evt, &name);
if (exc != DOM_NO_ERR) { if (exc != DOM_NO_ERR) {
LOG("Unable to find the event name"); NSLOG(netsurf, INFO, "Unable to find the event name");
return; return;
} }
LOG("Event's name is %*s", NSLOG(netsurf, INFO, "Event's name is %*s", dom_string_length(name),
dom_string_length(name), dom_string_data(name)); dom_string_data(name));
exc = dom_event_get_event_phase(evt, &phase); exc = dom_event_get_event_phase(evt, &phase);
if (exc != DOM_NO_ERR) { if (exc != DOM_NO_ERR) {
LOG("Unable to get event phase"); NSLOG(netsurf, INFO, "Unable to get event phase");
return; return;
} }
LOG("Event phase is: %s (%d)", NSLOG(netsurf, INFO, "Event phase is: %s (%d)",
phase == DOM_CAPTURING_PHASE ? "capturing" : phase == DOM_CAPTURING_PHASE ? "capturing" : phase == DOM_AT_TARGET ? "at-target" : phase == DOM_BUBBLING_PHASE ? "bubbling" : "unknown",
phase == DOM_AT_TARGET ? "at-target" : (int)phase);
phase == DOM_BUBBLING_PHASE ? "bubbling" :
"unknown", (int)phase);
exc = dom_event_get_current_target(evt, &targ); exc = dom_event_get_current_target(evt, &targ);
if (exc != DOM_NO_ERR) { if (exc != DOM_NO_ERR) {
dom_string_unref(name); dom_string_unref(name);
LOG("Unable to find the event target"); NSLOG(netsurf, INFO, "Unable to find the event target");
return; return;
} }
@ -852,7 +857,8 @@ static void dukky_generic_event_handler(dom_event *evt, void *pw)
if (dukky_push_node(ctx, (dom_node *)targ) == false) { if (dukky_push_node(ctx, (dom_node *)targ) == false) {
dom_string_unref(name); dom_string_unref(name);
dom_node_unref(targ); dom_node_unref(targ);
LOG("Unable to push JS node representation?!"); NSLOG(netsurf, INFO,
"Unable to push JS node representation?!");
return; return;
} }
/* ... node */ /* ... node */
@ -868,21 +874,26 @@ static void dukky_generic_event_handler(dom_event *evt, void *pw)
if (duk_pcall_method(ctx, 1) != 0) { if (duk_pcall_method(ctx, 1) != 0) {
/* Failed to run the method */ /* Failed to run the method */
/* ... err */ /* ... err */
LOG("OH NOES! An error running a callback. Meh."); NSLOG(netsurf, INFO,
"OH NOES! An error running a callback. Meh.");
exc = dom_event_stop_immediate_propagation(evt); exc = dom_event_stop_immediate_propagation(evt);
if (exc != DOM_NO_ERR) if (exc != DOM_NO_ERR)
LOG("WORSE! could not stop propagation"); NSLOG(netsurf, INFO,
"WORSE! could not stop propagation");
duk_get_prop_string(ctx, -1, "name"); duk_get_prop_string(ctx, -1, "name");
duk_get_prop_string(ctx, -2, "message"); duk_get_prop_string(ctx, -2, "message");
duk_get_prop_string(ctx, -3, "fileName"); duk_get_prop_string(ctx, -3, "fileName");
duk_get_prop_string(ctx, -4, "lineNumber"); duk_get_prop_string(ctx, -4, "lineNumber");
duk_get_prop_string(ctx, -5, "stack"); duk_get_prop_string(ctx, -5, "stack");
/* ... err name message fileName lineNumber stack */ /* ... err name message fileName lineNumber stack */
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(ctx, -5), NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(ctx, -4)); duk_safe_to_string(ctx, -5),
LOG(" was at: %s line %s", duk_safe_to_string(ctx, -3), duk_safe_to_string(ctx, -4));
duk_safe_to_string(ctx, -2)); NSLOG(netsurf, INFO, " was at: %s line %s",
LOG(" Stack trace: %s", duk_safe_to_string(ctx, -1)); duk_safe_to_string(ctx, -3),
duk_safe_to_string(ctx, -2));
NSLOG(netsurf, INFO, " Stack trace: %s",
duk_safe_to_string(ctx, -1));
duk_pop_n(ctx, 6); duk_pop_n(ctx, 6);
/* ... */ /* ... */
@ -962,21 +973,27 @@ handle_extras:
if (duk_pcall_method(ctx, 1) != 0) { if (duk_pcall_method(ctx, 1) != 0) {
/* Failed to run the method */ /* Failed to run the method */
/* ... copy handler err */ /* ... copy handler err */
LOG("OH NOES! An error running a callback. Meh."); NSLOG(netsurf, INFO,
"OH NOES! An error running a callback. Meh.");
exc = dom_event_stop_immediate_propagation(evt); exc = dom_event_stop_immediate_propagation(evt);
if (exc != DOM_NO_ERR) if (exc != DOM_NO_ERR)
LOG("WORSE! could not stop propagation"); NSLOG(netsurf, INFO,
"WORSE! could not stop propagation");
duk_get_prop_string(ctx, -1, "name"); duk_get_prop_string(ctx, -1, "name");
duk_get_prop_string(ctx, -2, "message"); duk_get_prop_string(ctx, -2, "message");
duk_get_prop_string(ctx, -3, "fileName"); duk_get_prop_string(ctx, -3, "fileName");
duk_get_prop_string(ctx, -4, "lineNumber"); duk_get_prop_string(ctx, -4, "lineNumber");
duk_get_prop_string(ctx, -5, "stack"); duk_get_prop_string(ctx, -5, "stack");
/* ... err name message fileName lineNumber stack */ /* ... err name message fileName lineNumber stack */
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(ctx, -5), NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(ctx, -4)); duk_safe_to_string(ctx, -5),
LOG(" was at: %s line %s", duk_safe_to_string(ctx, -3), duk_safe_to_string(ctx, -4));
duk_safe_to_string(ctx, -2)); NSLOG(netsurf, INFO,
LOG(" Stack trace: %s", duk_safe_to_string(ctx, -1)); " was at: %s line %s",
duk_safe_to_string(ctx, -3),
duk_safe_to_string(ctx, -2));
NSLOG(netsurf, INFO, " Stack trace: %s",
duk_safe_to_string(ctx, -1));
duk_pop_n(ctx, 7); duk_pop_n(ctx, 7);
/* ... copy */ /* ... copy */
@ -1034,11 +1051,12 @@ void dukky_register_event_listener_for(duk_context *ctx,
exc = dom_event_target_add_event_listener( exc = dom_event_target_add_event_listener(
ele, name, listen, capture); ele, name, listen, capture);
if (exc != DOM_NO_ERR) { if (exc != DOM_NO_ERR) {
LOG("Unable to register listener for %p.%*s", NSLOG(netsurf, INFO,
ele, dom_string_length(name), dom_string_data(name)); "Unable to register listener for %p.%*s", ele,
dom_string_length(name), dom_string_data(name));
} else { } else {
LOG("have registered listener for %p.%*s", NSLOG(netsurf, INFO, "have registered listener for %p.%*s",
ele, dom_string_length(name), dom_string_data(name)); ele, dom_string_length(name), dom_string_data(name));
} }
dom_event_listener_unref(listen); dom_event_listener_unref(listen);
} }
@ -1205,7 +1223,8 @@ bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, s
dom_event *evt; dom_event *evt;
dom_event_target *body; dom_event_target *body;
LOG("Event: %s (doc=%p, target=%p)", type, doc, target); NSLOG(netsurf, INFO, "Event: %s (doc=%p, target=%p)", type, doc,
target);
/** @todo Make this more generic, this only handles load and only /** @todo Make this more generic, this only handles load and only
* targetting the window, so that we actually stand a chance of * targetting the window, so that we actually stand a chance of
@ -1276,18 +1295,22 @@ bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, s
if (duk_pcall_method(CTX, 1) != 0) { if (duk_pcall_method(CTX, 1) != 0) {
/* Failed to run the handler */ /* Failed to run the handler */
/* ... err */ /* ... err */
LOG("OH NOES! An error running a handler. Meh."); NSLOG(netsurf, INFO,
"OH NOES! An error running a handler. Meh.");
duk_get_prop_string(CTX, -1, "name"); duk_get_prop_string(CTX, -1, "name");
duk_get_prop_string(CTX, -2, "message"); duk_get_prop_string(CTX, -2, "message");
duk_get_prop_string(CTX, -3, "fileName"); duk_get_prop_string(CTX, -3, "fileName");
duk_get_prop_string(CTX, -4, "lineNumber"); duk_get_prop_string(CTX, -4, "lineNumber");
duk_get_prop_string(CTX, -5, "stack"); duk_get_prop_string(CTX, -5, "stack");
/* ... err name message fileName lineNumber stack */ /* ... err name message fileName lineNumber stack */
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(CTX, -5), NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(CTX, -4)); duk_safe_to_string(CTX, -5),
LOG(" was at: %s line %s", duk_safe_to_string(CTX, -3), duk_safe_to_string(CTX, -4));
duk_safe_to_string(CTX, -2)); NSLOG(netsurf, INFO, " was at: %s line %s",
LOG(" Stack trace: %s", duk_safe_to_string(CTX, -1)); duk_safe_to_string(CTX, -3),
duk_safe_to_string(CTX, -2));
NSLOG(netsurf, INFO, " Stack trace: %s",
duk_safe_to_string(CTX, -1));
duk_pop_n(CTX, 6); duk_pop_n(CTX, 6);
/* ... */ /* ... */

View File

@ -195,7 +195,7 @@ static void hlcache_content_callback(struct content *c, content_msg msg,
error = handle->cb(handle, &event, handle->pw); error = handle->cb(handle, &event, handle->pw);
if (error != NSERROR_OK) if (error != NSERROR_OK)
LOG("Error in callback: %d", error); NSLOG(netsurf, INFO, "Error in callback: %d", error);
} }
/** /**
@ -566,7 +566,8 @@ void hlcache_finalise(void)
num_contents++; num_contents++;
} }
LOG("%d contents remain before cache drain", num_contents); NSLOG(netsurf, INFO, "%d contents remain before cache drain",
num_contents);
/* Drain cache */ /* Drain cache */
do { do {
@ -580,14 +581,17 @@ void hlcache_finalise(void)
} }
} while (num_contents > 0 && num_contents != prev_contents); } while (num_contents > 0 && num_contents != prev_contents);
LOG("%d contents remaining:", num_contents); NSLOG(netsurf, INFO, "%d contents remaining:", num_contents);
for (entry = hlcache->content_list; entry != NULL; entry = entry->next) { for (entry = hlcache->content_list; entry != NULL; entry = entry->next) {
hlcache_handle entry_handle = { entry, NULL, NULL }; hlcache_handle entry_handle = { entry, NULL, NULL };
if (entry->content != NULL) { if (entry->content != NULL) {
LOG(" %p : %s (%d users)", entry, nsurl_access(hlcache_handle_get_url(&entry_handle)), content_count_users(entry->content)); NSLOG(netsurf, INFO, " %p : %s (%d users)",
entry,
nsurl_access(hlcache_handle_get_url(&entry_handle)),
content_count_users(entry->content));
} else { } else {
LOG(" %p", entry); NSLOG(netsurf, INFO, " %p", entry);
} }
} }
@ -615,12 +619,13 @@ void hlcache_finalise(void)
hlcache->retrieval_ctx_ring = NULL; hlcache->retrieval_ctx_ring = NULL;
} }
LOG("hit/miss %d/%d", hlcache->hit_count, hlcache->miss_count); NSLOG(netsurf, INFO, "hit/miss %d/%d", hlcache->hit_count,
hlcache->miss_count);
free(hlcache); free(hlcache);
hlcache = NULL; hlcache = NULL;
LOG("Finalising low-level cache"); NSLOG(netsurf, INFO, "Finalising low-level cache");
llcache_finalise(); llcache_finalise();
} }

View File

@ -1331,13 +1331,13 @@ llcache_serialise_metadata(llcache_object *object,
overflow: overflow:
/* somehow we overflowed the buffer - hth? */ /* somehow we overflowed the buffer - hth? */
LOG("Overflowed metadata buffer"); NSLOG(netsurf, INFO, "Overflowed metadata buffer");
free(data); free(data);
return NSERROR_INVALID; return NSERROR_INVALID;
operror: operror:
/* output error */ /* output error */
LOG("Output error"); NSLOG(netsurf, INFO, "Output error");
free(data); free(data);
return NSERROR_INVALID; return NSERROR_INVALID;
} }
@ -1374,7 +1374,7 @@ llcache_process_metadata(llcache_object *object)
size_t num_headers; size_t num_headers;
size_t hloop; size_t hloop;
LOG("Retrieving metadata"); NSLOG(netsurf, INFO, "Retrieving metadata");
/* attempt to retrieve object metadata from the backing store */ /* attempt to retrieve object metadata from the backing store */
res = guit->llcache->fetch(object->url, res = guit->llcache->fetch(object->url,
@ -1385,7 +1385,7 @@ llcache_process_metadata(llcache_object *object)
return res; return res;
} }
LOG("Processing retrieved data"); NSLOG(netsurf, INFO, "Processing retrieved data");
/* metadata line 1 is the url the metadata referrs to */ /* metadata line 1 is the url the metadata referrs to */
line = 1; line = 1;
@ -1408,8 +1408,8 @@ llcache_process_metadata(llcache_object *object)
* by simply skipping caching of this object. * by simply skipping caching of this object.
*/ */
LOG("Got metadata for %s instead of %s", NSLOG(netsurf, INFO, "Got metadata for %s instead of %s",
nsurl_access(metadataurl), nsurl_access(object->url)); nsurl_access(metadataurl), nsurl_access(object->url));
nsurl_unref(metadataurl); nsurl_unref(metadataurl);
@ -1502,7 +1502,8 @@ llcache_process_metadata(llcache_object *object)
return NSERROR_OK; return NSERROR_OK;
format_error: format_error:
LOG("metadata error on line %d error code %d\n", line, res); NSLOG(netsurf, INFO, "metadata error on line %d error code %d\n",
line, res);
guit->llcache->release(object->url, BACKING_STORE_META); guit->llcache->release(object->url, BACKING_STORE_META);
return res; return res;
@ -1898,7 +1899,7 @@ static nserror llcache_fetch_redirect(llcache_object *object,
/* Forcibly stop redirecting if we've followed too many redirects */ /* Forcibly stop redirecting if we've followed too many redirects */
#define REDIRECT_LIMIT 10 #define REDIRECT_LIMIT 10
if (object->fetch.redirect_count > REDIRECT_LIMIT) { if (object->fetch.redirect_count > REDIRECT_LIMIT) {
LOG("Too many nested redirects"); NSLOG(netsurf, INFO, "Too many nested redirects");
event.type = LLCACHE_EVENT_ERROR; event.type = LLCACHE_EVENT_ERROR;
event.data.msg = messages_get("BadRedirect"); event.data.msg = messages_get("BadRedirect");
@ -2493,8 +2494,10 @@ static void llcache_persist_slowcheck(void *p)
total_bandwidth = (llcache->total_written * 1000) / llcache->total_elapsed; total_bandwidth = (llcache->total_written * 1000) / llcache->total_elapsed;
if (total_bandwidth < llcache->minimum_bandwidth) { if (total_bandwidth < llcache->minimum_bandwidth) {
LOG("Current bandwidth %" PRIu64 " less than minimum %" PRIsizet, NSLOG(netsurf, INFO,
total_bandwidth, llcache->minimum_bandwidth); "Current bandwidth %"PRIu64" less than minimum %"PRIsizet,
total_bandwidth,
llcache->minimum_bandwidth);
guit->llcache->finalise(); guit->llcache->finalise();
} }
} }
@ -2550,7 +2553,7 @@ static void llcache_persist(void *p)
* (bandwidth) for this run being exceeded. * (bandwidth) for this run being exceeded.
*/ */
if (total_elapsed > llcache->time_quantum) { if (total_elapsed > llcache->time_quantum) {
LOG("Overran timeslot"); NSLOG(netsurf, INFO, "Overran timeslot");
/* writeout has exhausted the available time. /* writeout has exhausted the available time.
* Either the writeout is slow or the last * Either the writeout is slow or the last
* object was very large. * object was very large.
@ -2920,12 +2923,14 @@ static nserror llcache_object_notify_users(llcache_object *object)
#ifdef LLCACHE_TRACE #ifdef LLCACHE_TRACE
if (handle->state != objstate) { if (handle->state != objstate) {
if (emitted_notify == false) { if (emitted_notify == false) {
LOG("Notifying users of %p", object); NSLOG(netsurf, INFO, "Notifying users of %p",
object);
emitted_notify = true; emitted_notify = true;
} }
LOG("User %p state: %d Object state: %d", user, NSLOG(netsurf, INFO,
handle->state, objstate); "User %p state: %d Object state: %d", user,
handle->state, objstate);
} }
#endif #endif
@ -3364,7 +3369,8 @@ llcache_initialise(const struct llcache_parameters *prm)
llcache->fetch_attempts = prm->fetch_attempts; llcache->fetch_attempts = prm->fetch_attempts;
llcache->all_caught_up = true; llcache->all_caught_up = true;
LOG("llcache initialising with a limit of %d bytes", llcache->limit); NSLOG(netsurf, INFO, "llcache initialising with a limit of %d bytes",
llcache->limit);
/* backing store initialisation */ /* backing store initialisation */
return guit->llcache->initialise(&prm->store); return guit->llcache->initialise(&prm->store);
@ -3427,10 +3433,11 @@ void llcache_finalise(void)
llcache->total_elapsed; llcache->total_elapsed;
} }
LOG("Backing store wrote %"PRIu64" bytes in %"PRIu64" ms " NSLOG(netsurf, INFO,
"(average %"PRIu64" bytes/second)", "Backing store wrote %"PRIu64" bytes in %"PRIu64" ms ""(average %"PRIu64" bytes/second)",
llcache->total_written, llcache->total_elapsed, llcache->total_written,
total_bandwidth); llcache->total_elapsed,
total_bandwidth);
free(llcache); free(llcache);
llcache = NULL; llcache = NULL;

View File

@ -662,7 +662,8 @@ static bool urldb__host_is_ip_address(const char *host)
c[slash - host] = '\0'; c[slash - host] = '\0';
sane_host = c; sane_host = c;
host_len = slash - host; host_len = slash - host;
LOG("WARNING: called with non-host '%s'", host); NSLOG(netsurf, INFO, "WARNING: called with non-host '%s'",
host);
} }
if (strspn(sane_host, "0123456789abcdefABCDEF[].:") < host_len) if (strspn(sane_host, "0123456789abcdefABCDEF[].:") < host_len)
@ -1292,7 +1293,7 @@ urldb_match_path(const struct path_data *parent,
assert(parent->segment == NULL); assert(parent->segment == NULL);
if (path[0] != '/') { if (path[0] != '/') {
LOG("path is %s", path); NSLOG(netsurf, INFO, "path is %s", path);
} }
assert(path[0] == '/'); assert(path[0] == '/');
@ -1422,12 +1423,14 @@ static void urldb_dump_paths(struct path_data *parent)
do { do {
if (p->segment != NULL) { if (p->segment != NULL) {
LOG("\t%s : %u", lwc_string_data(p->scheme), p->port); NSLOG(netsurf, INFO, "\t%s : %u",
lwc_string_data(p->scheme), p->port);
LOG("\t\t'%s'", p->segment); NSLOG(netsurf, INFO, "\t\t'%s'", p->segment);
for (i = 0; i != p->frag_cnt; i++) { for (i = 0; i != p->frag_cnt; i++) {
LOG("\t\t\t#%s", p->fragment[i]); NSLOG(netsurf, INFO, "\t\t\t#%s",
p->fragment[i]);
} }
} }
@ -1457,10 +1460,10 @@ static void urldb_dump_hosts(struct host_part *parent)
struct host_part *h; struct host_part *h;
if (parent->part) { if (parent->part) {
LOG("%s", parent->part); NSLOG(netsurf, INFO, "%s", parent->part);
LOG("\t%s invalid SSL certs", NSLOG(netsurf, INFO, "\t%s invalid SSL certs",
parent->permit_invalid_certs ? "Permits" : "Denies"); parent->permit_invalid_certs ? "Permits" : "Denies");
} }
/* Dump path data */ /* Dump path data */
@ -1512,7 +1515,7 @@ static void urldb_dump_search(struct search_node *parent, int depth)
} }
s[i]= 0; s[i]= 0;
LOG("%s", s); NSLOG(netsurf, INFO, "%s", s);
urldb_dump_search(parent->right, depth + 1); urldb_dump_search(parent->right, depth + 1);
} }
@ -2866,14 +2869,15 @@ nserror urldb_load(const char *filename)
assert(filename); assert(filename);
LOG("Loading URL file %s", filename); NSLOG(netsurf, INFO, "Loading URL file %s", filename);
if (url_bloom == NULL) if (url_bloom == NULL)
url_bloom = bloom_create(BLOOM_SIZE); url_bloom = bloom_create(BLOOM_SIZE);
fp = fopen(filename, "r"); fp = fopen(filename, "r");
if (!fp) { if (!fp) {
LOG("Failed to open file '%s' for reading", filename); NSLOG(netsurf, INFO, "Failed to open file '%s' for reading",
filename);
return NSERROR_NOT_FOUND; return NSERROR_NOT_FOUND;
} }
@ -2884,12 +2888,12 @@ nserror urldb_load(const char *filename)
version = atoi(s); version = atoi(s);
if (version < MIN_URL_FILE_VERSION) { if (version < MIN_URL_FILE_VERSION) {
LOG("Unsupported URL file version."); NSLOG(netsurf, INFO, "Unsupported URL file version.");
fclose(fp); fclose(fp);
return NSERROR_INVALID; return NSERROR_INVALID;
} }
if (version > URL_FILE_VERSION) { if (version > URL_FILE_VERSION) {
LOG("Unknown URL file version."); NSLOG(netsurf, INFO, "Unknown URL file version.");
fclose(fp); fclose(fp);
return NSERROR_INVALID; return NSERROR_INVALID;
} }
@ -2919,13 +2923,13 @@ nserror urldb_load(const char *filename)
/* no URLs => try next host */ /* no URLs => try next host */
if (urls == 0) { if (urls == 0) {
LOG("No URLs for '%s'", host); NSLOG(netsurf, INFO, "No URLs for '%s'", host);
continue; continue;
} }
h = urldb_add_host(host); h = urldb_add_host(host);
if (!h) { if (!h) {
LOG("Failed adding host: '%s'", host); NSLOG(netsurf, INFO, "Failed adding host: '%s'", host);
fclose(fp); fclose(fp);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -2976,7 +2980,8 @@ nserror urldb_load(const char *filename)
* Need a nsurl_save too. * Need a nsurl_save too.
*/ */
if (nsurl_create(url, &nsurl) != NSERROR_OK) { if (nsurl_create(url, &nsurl) != NSERROR_OK) {
LOG("Failed inserting '%s'", url); NSLOG(netsurf, INFO, "Failed inserting '%s'",
url);
fclose(fp); fclose(fp);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -2989,7 +2994,8 @@ nserror urldb_load(const char *filename)
/* Copy and merge path/query strings */ /* Copy and merge path/query strings */
if (nsurl_get(nsurl, NSURL_PATH | NSURL_QUERY, if (nsurl_get(nsurl, NSURL_PATH | NSURL_QUERY,
&path_query, &len) != NSERROR_OK) { &path_query, &len) != NSERROR_OK) {
LOG("Failed inserting '%s'", url); NSLOG(netsurf, INFO, "Failed inserting '%s'",
url);
fclose(fp); fclose(fp);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -3000,7 +3006,8 @@ nserror urldb_load(const char *filename)
p = urldb_add_path(scheme_lwc, port, h, path_query, p = urldb_add_path(scheme_lwc, port, h, path_query,
fragment_lwc, nsurl); fragment_lwc, nsurl);
if (!p) { if (!p) {
LOG("Failed inserting '%s'", url); NSLOG(netsurf, INFO, "Failed inserting '%s'",
url);
fclose(fp); fclose(fp);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -3044,7 +3051,7 @@ nserror urldb_load(const char *filename)
} }
fclose(fp); fclose(fp);
LOG("Successfully loaded URL file"); NSLOG(netsurf, INFO, "Successfully loaded URL file");
#undef MAXIMUM_URL_LENGTH #undef MAXIMUM_URL_LENGTH
return NSERROR_OK; return NSERROR_OK;
@ -3060,7 +3067,8 @@ nserror urldb_save(const char *filename)
fp = fopen(filename, "w"); fp = fopen(filename, "w");
if (!fp) { if (!fp) {
LOG("Failed to open file '%s' for writing", filename); NSLOG(netsurf, INFO, "Failed to open file '%s' for writing",
filename);
return NSERROR_SAVE_FAILED; return NSERROR_SAVE_FAILED;
} }
@ -3472,7 +3480,7 @@ bool urldb_set_thumbnail(nsurl *url, struct bitmap *bitmap)
return false; return false;
} }
LOG("Setting bitmap on %s", nsurl_access(url)); NSLOG(netsurf, INFO, "Setting bitmap on %s", nsurl_access(url));
if ((p->thumb) && (p->thumb != bitmap)) { if ((p->thumb) && (p->thumb != bitmap)) {
guit->bitmap->destroy(p->thumb); guit->bitmap->destroy(p->thumb);
@ -3754,7 +3762,8 @@ bool urldb_set_cookie(const char *header, nsurl *url, nsurl *referer)
} }
suffix = nspsl_getpublicsuffix(dot); suffix = nspsl_getpublicsuffix(dot);
if (suffix == NULL) { if (suffix == NULL) {
LOG("domain %s was a public suffix domain", dot); NSLOG(netsurf, INFO,
"domain %s was a public suffix domain", dot);
urldb_free_cookie(c); urldb_free_cookie(c);
goto error; goto error;
} }
@ -4161,7 +4170,7 @@ void urldb_load_cookies(const char *filename)
for (; *p && *p != '\t'; p++) \ for (; *p && *p != '\t'; p++) \
; /* do nothing */ \ ; /* do nothing */ \
if (p >= end) { \ if (p >= end) { \
LOG("Overran input"); \ NSLOG(netsurf, INFO, "Overran input"); \
continue; \ continue; \
} \ } \
*p++ = '\0'; \ *p++ = '\0'; \
@ -4171,7 +4180,7 @@ void urldb_load_cookies(const char *filename)
for (; *p && *p == '\t'; p++) \ for (; *p && *p == '\t'; p++) \
; /* do nothing */ \ ; /* do nothing */ \
if (p >= end) { \ if (p >= end) { \
LOG("Overran input"); \ NSLOG(netsurf, INFO, "Overran input"); \
continue; \ continue; \
} \ } \
} }
@ -4200,7 +4209,8 @@ void urldb_load_cookies(const char *filename)
if (loaded_cookie_file_version < if (loaded_cookie_file_version <
MIN_COOKIE_FILE_VERSION) { MIN_COOKIE_FILE_VERSION) {
LOG("Unsupported Cookie file version"); NSLOG(netsurf, INFO,
"Unsupported Cookie file version");
break; break;
} }

View File

@ -171,7 +171,7 @@ browser_window_redraw(struct browser_window *bw,
nserror res; nserror res;
if (bw == NULL) { if (bw == NULL) {
LOG("NULL browser window"); NSLOG(netsurf, INFO, "NULL browser window");
return false; return false;
} }
@ -336,7 +336,7 @@ browser_window_redraw(struct browser_window *bw,
bool browser_window_redraw_ready(struct browser_window *bw) bool browser_window_redraw_ready(struct browser_window *bw)
{ {
if (bw == NULL) { if (bw == NULL) {
LOG("NULL browser window"); NSLOG(netsurf, INFO, "NULL browser window");
return false; return false;
} else if (bw->current_content != NULL) { } else if (bw->current_content != NULL) {
/* Can't render locked contents */ /* Can't render locked contents */
@ -415,7 +415,8 @@ void browser_window_set_position(struct browser_window *bw, int x, int y)
bw->x = x; bw->x = x;
bw->y = y; bw->y = y;
} else { } else {
LOG("Asked to set position of front end window."); NSLOG(netsurf, INFO,
"Asked to set position of front end window.");
assert(0); assert(0);
} }
} }
@ -811,7 +812,7 @@ nserror browser_window_debug(struct browser_window *bw, enum content_debug op)
static bool slow_script(void *ctx) static bool slow_script(void *ctx)
{ {
static int count = 0; static int count = 0;
LOG("Continuing execution %d", count); NSLOG(netsurf, INFO, "Continuing execution %d", count);
count++; count++;
if (count > 1) { if (count > 1) {
count = 0; count = 0;
@ -982,11 +983,12 @@ browser_window_download(struct browser_window *bw,
/* no internal handler for this type, call out to frontend */ /* no internal handler for this type, call out to frontend */
error = guit->misc->launch_url(url); error = guit->misc->launch_url(url);
} else if (error != NSERROR_OK) { } else if (error != NSERROR_OK) {
LOG("Failed to fetch download: %d", error); NSLOG(netsurf, INFO, "Failed to fetch download: %d", error);
} else { } else {
error = download_context_create(l, root->window); error = download_context_create(l, root->window);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
LOG("Failed creating download context: %d", error); NSLOG(netsurf, INFO,
"Failed creating download context: %d", error);
llcache_handle_abort(l); llcache_handle_abort(l);
llcache_handle_release(l); llcache_handle_release(l);
} }
@ -1114,7 +1116,8 @@ browser_window_favicon_callback(hlcache_handle *c,
error = nsurl_create("resource:favicon.ico", &nsurl); error = nsurl_create("resource:favicon.ico", &nsurl);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
LOG("Unable to create default location url"); NSLOG(netsurf, INFO,
"Unable to create default location url");
} else { } else {
hlcache_handle_retrieve(nsurl, hlcache_handle_retrieve(nsurl,
HLCACHE_RETRIEVE_SNIFF_TYPE, HLCACHE_RETRIEVE_SNIFF_TYPE,
@ -1204,7 +1207,8 @@ browser_window_update_favicon(hlcache_handle *c,
error = nsurl_create("resource:favicon.ico", &nsurl); error = nsurl_create("resource:favicon.ico", &nsurl);
} }
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
LOG("Unable to create default location url"); NSLOG(netsurf, INFO,
"Unable to create default location url");
return; return;
} }
} else { } else {
@ -1212,9 +1216,11 @@ browser_window_update_favicon(hlcache_handle *c,
} }
if (link == NULL) { if (link == NULL) {
LOG("fetching general favicon from '%s'", nsurl_access(nsurl)); NSLOG(netsurf, INFO, "fetching general favicon from '%s'",
nsurl_access(nsurl));
} else { } else {
LOG("fetching favicon rel:%s '%s'", lwc_string_data(link->rel), nsurl_access(nsurl)); NSLOG(netsurf, INFO, "fetching favicon rel:%s '%s'",
lwc_string_data(link->rel), nsurl_access(nsurl));
} }
hlcache_handle_retrieve(nsurl, HLCACHE_RETRIEVE_SNIFF_TYPE, hlcache_handle_retrieve(nsurl, HLCACHE_RETRIEVE_SNIFF_TYPE,
@ -1811,7 +1817,7 @@ static void browser_window_destroy_internal(struct browser_window *bw)
{ {
assert(bw); assert(bw);
LOG("Destroying window"); NSLOG(netsurf, INFO, "Destroying window");
if (bw->children != NULL || bw->iframes != NULL) { if (bw->children != NULL || bw->iframes != NULL) {
browser_window_destroy_children(bw); browser_window_destroy_children(bw);
@ -1831,7 +1837,8 @@ static void browser_window_destroy_internal(struct browser_window *bw)
/* The ugly cast here is so the reformat function can be /* The ugly cast here is so the reformat function can be
* passed a gui window pointer in its API rather than void* * passed a gui window pointer in its API rather than void*
*/ */
LOG("Clearing reformat schedule for browser window %p", bw); NSLOG(netsurf, INFO,
"Clearing reformat schedule for browser window %p", bw);
guit->misc->schedule(-1, scheduled_reformat, bw); guit->misc->schedule(-1, scheduled_reformat, bw);
/* If this brower window is not the root window, and has focus, unset /* If this brower window is not the root window, and has focus, unset
@ -1911,7 +1918,8 @@ static void browser_window_destroy_internal(struct browser_window *bw)
free(bw->name); free(bw->name);
free(bw->status.text); free(bw->status.text);
bw->status.text = NULL; bw->status.text = NULL;
LOG("Status text cache match:miss %d:%d", bw->status.match, bw->status.miss); NSLOG(netsurf, INFO, "Status text cache match:miss %d:%d",
bw->status.match, bw->status.miss);
} }
/** /**
@ -2004,14 +2012,14 @@ browser_window_navigate(struct browser_window *bw,
assert(bw); assert(bw);
assert(url); assert(url);
LOG("bw %p, url %s", bw, nsurl_access(url)); NSLOG(netsurf, INFO, "bw %p, url %s", bw, nsurl_access(url));
/* don't allow massively nested framesets */ /* don't allow massively nested framesets */
for (cur = bw; cur->parent; cur = cur->parent) { for (cur = bw; cur->parent; cur = cur->parent) {
depth++; depth++;
} }
if (depth > FRAME_DEPTH) { if (depth > FRAME_DEPTH) {
LOG("frame depth too high."); NSLOG(netsurf, INFO, "frame depth too high.");
return NSERROR_FRAME_DEPTH; return NSERROR_FRAME_DEPTH;
} }
@ -2103,7 +2111,7 @@ browser_window_navigate(struct browser_window *bw,
browser_window_remove_caret(bw, false); browser_window_remove_caret(bw, false);
browser_window_destroy_children(bw); browser_window_destroy_children(bw);
LOG("Loading '%s'", nsurl_access(url)); NSLOG(netsurf, INFO, "Loading '%s'", nsurl_access(url));
browser_window_set_status(bw, messages_get("Loading")); browser_window_set_status(bw, messages_get("Loading"));
bw->history_add = (flags & BW_NAVIGATE_HISTORY); bw->history_add = (flags & BW_NAVIGATE_HISTORY);
@ -2319,7 +2327,8 @@ void browser_window_set_dimensions(struct browser_window *bw,
bw->width = width; bw->width = width;
bw->height = height; bw->height = height;
} else { } else {
LOG("Asked to set dimensions of front end window."); NSLOG(netsurf, INFO,
"Asked to set dimensions of front end window.");
assert(0); assert(0);
} }
} }

View File

@ -286,7 +286,7 @@ nserror browser_window_history_clone(const struct browser_window *existing,
new_history->start = browser_window_history__clone_entry(new_history, new_history->start = browser_window_history__clone_entry(new_history,
new_history->start); new_history->start);
if (!new_history->start) { if (!new_history->start) {
LOG("Insufficient memory to clone history"); NSLOG(netsurf, INFO, "Insufficient memory to clone history");
browser_window_history_destroy(clone); browser_window_history_destroy(clone);
clone->history = NULL; clone->history = NULL;
return NSERROR_NOMEM; return NSERROR_NOMEM;
@ -351,7 +351,8 @@ nserror browser_window_history_add(struct browser_window *bw,
* loading */ * loading */
bitmap = urldb_get_thumbnail(nsurl); bitmap = urldb_get_thumbnail(nsurl);
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("Creating thumbnail for %s", nsurl_access(nsurl)); NSLOG(netsurf, INFO, "Creating thumbnail for %s",
nsurl_access(nsurl));
bitmap = guit->bitmap->create(WIDTH, HEIGHT, bitmap = guit->bitmap->create(WIDTH, HEIGHT,
BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_NEW | BITMAP_CLEAR_MEMORY |
BITMAP_OPAQUE); BITMAP_OPAQUE);
@ -366,7 +367,7 @@ nserror browser_window_history_add(struct browser_window *bw,
/* Thumbnailing failed. Ignore it /* Thumbnailing failed. Ignore it
* silently but clean up bitmap. * silently but clean up bitmap.
*/ */
LOG("Thumbnail renderfailed"); NSLOG(netsurf, INFO, "Thumbnail renderfailed");
guit->bitmap->destroy(bitmap); guit->bitmap->destroy(bitmap);
bitmap = NULL; bitmap = NULL;
} }

View File

@ -718,7 +718,8 @@ static void cookie_manager_delete_entry(struct cookie_manager_entry *e)
urldb_delete_cookie(domain, path, name); urldb_delete_cookie(domain, path, name);
} else { } else {
LOG("Delete cookie fail: ""need domain, path, and name."); NSLOG(netsurf, INFO,
"Delete cookie fail: ""need domain, path, and name.");
} }
} }
@ -788,7 +789,7 @@ nserror cookie_manager_init(struct core_window_callback_table *cw_t,
return err; return err;
} }
LOG("Generating cookie manager data"); NSLOG(netsurf, INFO, "Generating cookie manager data");
/* Init. cookie manager treeview entry fields */ /* Init. cookie manager treeview entry fields */
err = cookie_manager_init_entry_fields(); err = cookie_manager_init_entry_fields();
@ -825,7 +826,7 @@ nserror cookie_manager_init(struct core_window_callback_table *cw_t,
/* Inform client of window height */ /* Inform client of window height */
treeview_get_height(cm_ctx.tree); treeview_get_height(cm_ctx.tree);
LOG("Generated cookie manager data"); NSLOG(netsurf, INFO, "Generated cookie manager data");
return NSERROR_OK; return NSERROR_OK;
} }
@ -837,7 +838,7 @@ nserror cookie_manager_fini(void)
int i; int i;
nserror err; nserror err;
LOG("Finalising cookie manager"); NSLOG(netsurf, INFO, "Finalising cookie manager");
cm_ctx.built = false; cm_ctx.built = false;
@ -860,7 +861,7 @@ nserror cookie_manager_fini(void)
return err; return err;
} }
LOG("Finalised cookie manager"); NSLOG(netsurf, INFO, "Finalised cookie manager");
return err; return err;
} }

View File

@ -74,7 +74,10 @@ const struct font_functions haru_nsfont = {
static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no,
void *user_data) void *user_data)
{ {
LOG("ERROR: in font_haru \n\terror_no=%x\n\tdetail_no=%d\n", (HPDF_UINT)error_no, (HPDF_UINT)detail_no); NSLOG(netsurf, INFO,
"ERROR: in font_haru \n\terror_no=%x\n\tdetail_no=%d\n",
(HPDF_UINT)error_no,
(HPDF_UINT)detail_no);
#ifdef FONT_HARU_DEBUG #ifdef FONT_HARU_DEBUG
exit(1); exit(1);
#endif #endif
@ -143,7 +146,9 @@ bool haru_nsfont_width(const plot_font_style_t *fstyle,
*width = width_real; *width = width_real;
#ifdef FONT_HARU_DEBUG #ifdef FONT_HARU_DEBUG
LOG("Measuring string: %s ; Calculated width: %f %i", string_nt, width_real, *width); NSLOG(netsurf, INFO,
"Measuring string: %s ; Calculated width: %f %i", string_nt,
width_real, *width);
#endif #endif
free(string_nt); free(string_nt);
HPDF_Free(pdf); HPDF_Free(pdf);
@ -201,7 +206,11 @@ bool haru_nsfont_position_in_string(const plot_font_style_t *fstyle,
*actual_x = real_width; *actual_x = real_width;
#ifdef FONT_HARU_DEBUG #ifdef FONT_HARU_DEBUG
LOG("Position in string: %s at x: %i; Calculated position: %i", string_nt, x, *char_offset); NSLOG(netsurf, INFO,
"Position in string: %s at x: %i; Calculated position: %i",
string_nt,
x,
*char_offset);
#endif #endif
free(string_nt); free(string_nt);
HPDF_Free(pdf); HPDF_Free(pdf);
@ -246,7 +255,12 @@ bool haru_nsfont_split(const plot_font_style_t *fstyle,
HPDF_TRUE, &real_width); HPDF_TRUE, &real_width);
#ifdef FONT_HARU_DEBUG #ifdef FONT_HARU_DEBUG
LOG("Splitting string: %s for width: %i ; Calculated position: %i Calculated real_width: %f", string_nt, x, *char_offset, real_width); NSLOG(netsurf, INFO,
"Splitting string: %s for width: %i ; Calculated position: %i Calculated real_width: %f",
string_nt,
x,
*char_offset,
real_width);
#endif #endif
*char_offset = offset - 1; *char_offset = offset - 1;
@ -327,7 +341,7 @@ bool haru_nsfont_apply_style(const plot_font_style_t *fstyle,
strcat(font_name, "-Roman"); strcat(font_name, "-Roman");
#ifdef FONT_HARU_DEBUG #ifdef FONT_HARU_DEBUG
LOG("Setting font: %s", font_name); NSLOG(netsurf, INFO, "Setting font: %s", font_name);
#endif #endif
size = fstyle->size; size = fstyle->size;

View File

@ -354,9 +354,11 @@ nserror browser_window_create_frameset(struct browser_window *bw,
window->parent = bw; window->parent = bw;
if (window->name) if (window->name)
LOG("Created frame '%s'", window->name); NSLOG(netsurf, INFO, "Created frame '%s'",
window->name);
else else
LOG("Created frame (unnamed)"); NSLOG(netsurf, INFO,
"Created frame (unnamed)");
} }
} }

View File

@ -596,7 +596,7 @@ static nserror global_history_initialise_time(void)
/* get the current time */ /* get the current time */
t = time(NULL); t = time(NULL);
if (t == -1) { if (t == -1) {
LOG("time info unaviable"); NSLOG(netsurf, INFO, "time info unaviable");
return NSERROR_UNKNOWN; return NSERROR_UNKNOWN;
} }
@ -607,7 +607,7 @@ static nserror global_history_initialise_time(void)
full_time->tm_hour = 0; full_time->tm_hour = 0;
t = mktime(full_time); t = mktime(full_time);
if (t == -1) { if (t == -1) {
LOG("mktime failed"); NSLOG(netsurf, INFO, "mktime failed");
return NSERROR_UNKNOWN; return NSERROR_UNKNOWN;
} }
@ -729,7 +729,7 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
return err; return err;
} }
LOG("Loading global history"); NSLOG(netsurf, INFO, "Loading global history");
/* Init. global history treeview time */ /* Init. global history treeview time */
err = global_history_initialise_time(); err = global_history_initialise_time();
@ -785,7 +785,7 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
/* Inform client of window height */ /* Inform client of window height */
treeview_get_height(gh_ctx.tree); treeview_get_height(gh_ctx.tree);
LOG("Loaded global history"); NSLOG(netsurf, INFO, "Loaded global history");
return NSERROR_OK; return NSERROR_OK;
} }
@ -797,7 +797,7 @@ nserror global_history_fini(void)
int i; int i;
nserror err; nserror err;
LOG("Finalising global history"); NSLOG(netsurf, INFO, "Finalising global history");
gh_ctx.built = false; gh_ctx.built = false;
@ -815,7 +815,7 @@ nserror global_history_fini(void)
return err; return err;
} }
LOG("Finalised global history"); NSLOG(netsurf, INFO, "Finalised global history");
return err; return err;
} }
@ -832,7 +832,8 @@ nserror global_history_add(nsurl *url)
data = urldb_get_url_data(url); data = urldb_get_url_data(url);
if (data == NULL) { if (data == NULL) {
LOG("Can't add URL to history that's not present in urldb."); NSLOG(netsurf, INFO,
"Can't add URL to history that's not present in urldb.");
return NSERROR_BAD_PARAMETER; return NSERROR_BAD_PARAMETER;
} }

View File

@ -138,7 +138,8 @@ static nserror hotlist_save(const char *path)
/* Replace any old hotlist file with the one we just saved */ /* Replace any old hotlist file with the one we just saved */
if (rename(temp_path, path) != 0) { if (rename(temp_path, path) != 0) {
res = NSERROR_SAVE_FAILED; res = NSERROR_SAVE_FAILED;
LOG("Error renaming hotlist: %s.", strerror(errno)); NSLOG(netsurf, INFO, "Error renaming hotlist: %s.",
strerror(errno));
goto cleanup; goto cleanup;
} }
@ -652,20 +653,20 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
/* The li must contain an "a" element */ /* The li must contain an "a" element */
a = libdom_find_first_element(li, corestring_lwc_a); a = libdom_find_first_element(li, corestring_lwc_a);
if (a == NULL) { if (a == NULL) {
LOG("Missing <a> in <li>"); NSLOG(netsurf, INFO, "Missing <a> in <li>");
return NSERROR_INVALID; return NSERROR_INVALID;
} }
derror = dom_node_get_text_content(a, &title1); derror = dom_node_get_text_content(a, &title1);
if (derror != DOM_NO_ERR) { if (derror != DOM_NO_ERR) {
LOG("No title"); NSLOG(netsurf, INFO, "No title");
dom_node_unref(a); dom_node_unref(a);
return NSERROR_INVALID; return NSERROR_INVALID;
} }
derror = dom_element_get_attribute(a, corestring_dom_href, &url1); derror = dom_element_get_attribute(a, corestring_dom_href, &url1);
if (derror != DOM_NO_ERR || url1 == NULL) { if (derror != DOM_NO_ERR || url1 == NULL) {
LOG("No URL"); NSLOG(netsurf, INFO, "No URL");
dom_string_unref(title1); dom_string_unref(title1);
dom_node_unref(a); dom_node_unref(a);
return NSERROR_INVALID; return NSERROR_INVALID;
@ -683,7 +684,8 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
dom_string_unref(url1); dom_string_unref(url1);
if (err != NSERROR_OK) { if (err != NSERROR_OK) {
LOG("Failed normalising '%s'", dom_string_data(url1)); NSLOG(netsurf, INFO, "Failed normalising '%s'",
dom_string_data(url1));
if (title1 != NULL) { if (title1 != NULL) {
dom_string_unref(title1); dom_string_unref(title1);
@ -763,7 +765,8 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx)
error = dom_node_get_text_content(node, &title); error = dom_node_get_text_content(node, &title);
if (error != DOM_NO_ERR || title == NULL) { if (error != DOM_NO_ERR || title == NULL) {
LOG("Empty <h4> or memory exhausted."); NSLOG(netsurf, INFO,
"Empty <h4> or memory exhausted.");
dom_string_unref(name); dom_string_unref(name);
return NSERROR_DOM; return NSERROR_DOM;
} }
@ -861,7 +864,7 @@ static nserror hotlist_load(const char *path, bool *loaded)
/* Handle no path */ /* Handle no path */
if (path == NULL) { if (path == NULL) {
LOG("No hotlist file path provided."); NSLOG(netsurf, INFO, "No hotlist file path provided.");
return NSERROR_OK; return NSERROR_OK;
} }
@ -1283,7 +1286,7 @@ nserror hotlist_init(
return err; return err;
} }
LOG("Loading hotlist"); NSLOG(netsurf, INFO, "Loading hotlist");
hl_ctx.tree = NULL; hl_ctx.tree = NULL;
hl_ctx.built = false; hl_ctx.built = false;
@ -1329,7 +1332,7 @@ nserror hotlist_init(
* the treeview is built. */ * the treeview is built. */
hl_ctx.built = true; hl_ctx.built = true;
LOG("Loaded hotlist"); NSLOG(netsurf, INFO, "Loaded hotlist");
return NSERROR_OK; return NSERROR_OK;
} }
@ -1375,7 +1378,7 @@ nserror hotlist_fini(void)
int i; int i;
nserror err; nserror err;
LOG("Finalising hotlist"); NSLOG(netsurf, INFO, "Finalising hotlist");
/* Remove any existing scheduled save callback */ /* Remove any existing scheduled save callback */
guit->misc->schedule(-1, hotlist_schedule_save_cb, NULL); guit->misc->schedule(-1, hotlist_schedule_save_cb, NULL);
@ -1384,7 +1387,7 @@ nserror hotlist_fini(void)
/* Save the hotlist */ /* Save the hotlist */
err = hotlist_save(hl_ctx.save_path); err = hotlist_save(hl_ctx.save_path);
if (err != NSERROR_OK) { if (err != NSERROR_OK) {
LOG("Problem saving the hotlist."); NSLOG(netsurf, INFO, "Problem saving the hotlist.");
} }
free(hl_ctx.save_path); free(hl_ctx.save_path);
@ -1403,7 +1406,7 @@ nserror hotlist_fini(void)
return err; return err;
} }
LOG("Finalised hotlist"); NSLOG(netsurf, INFO, "Finalised hotlist");
return err; return err;
} }

View File

@ -267,7 +267,9 @@ static nserror knockout_plot_flush(const struct redraw_context *ctx)
/* debugging information */ /* debugging information */
#ifdef KNOCKOUT_DEBUG #ifdef KNOCKOUT_DEBUG
LOG("Entries are %i/%i, %i/%i, %i/%i", knockout_entry_cur, KNOCKOUT_ENTRIES, knockout_box_cur, KNOCKOUT_BOXES, knockout_polygon_cur, KNOCKOUT_POLYGONS); NSLOG(netsurf, INFO, "Entries are %i/%i, %i/%i, %i/%i",
knockout_entry_cur, KNOCKOUT_ENTRIES, knockout_box_cur,
KNOCKOUT_BOXES, knockout_polygon_cur, KNOCKOUT_POLYGONS);
#endif #endif
for (i = 0; i < knockout_entry_cur; i++) { for (i = 0; i < knockout_entry_cur; i++) {
@ -702,8 +704,8 @@ knockout_plot_clip(const struct redraw_context *ctx, const struct rect *clip)
if (clip->x1 < clip->x0 || clip->y0 > clip->y1) { if (clip->x1 < clip->x0 || clip->y0 > clip->y1) {
#ifdef KNOCKOUT_DEBUG #ifdef KNOCKOUT_DEBUG
LOG("bad clip rectangle %i %i %i %i", NSLOG(netsurf, INFO, "bad clip rectangle %i %i %i %i",
clip->x0, clip->y0, clip->x1, clip->y1); clip->x0, clip->y0, clip->x1, clip->y1);
#endif #endif
return NSERROR_BAD_SIZE; return NSERROR_BAD_SIZE;
} }

View File

@ -30,5 +30,5 @@
*/ */
void browser_mouse_state_dump(browser_mouse_state mouse) void browser_mouse_state_dump(browser_mouse_state mouse)
{ {
LOG("mouse state: %s %s %s %s %s %s %s %s %s %s %s %s %s %s", mouse & BROWSER_MOUSE_PRESS_1 ? "P1" : " ", mouse & BROWSER_MOUSE_PRESS_2 ? "P2" : " ", mouse & BROWSER_MOUSE_CLICK_1 ? "C1" : " ", mouse & BROWSER_MOUSE_CLICK_2 ? "C2" : " ", mouse & BROWSER_MOUSE_DOUBLE_CLICK ? "DC" : " ", mouse & BROWSER_MOUSE_TRIPLE_CLICK ? "TC" : " ", mouse & BROWSER_MOUSE_DRAG_1 ? "D1" : " ", mouse & BROWSER_MOUSE_DRAG_2 ? "D2" : " ", mouse & BROWSER_MOUSE_DRAG_ON ? "DO" : " ", mouse & BROWSER_MOUSE_HOLDING_1 ? "H1" : " ", mouse & BROWSER_MOUSE_HOLDING_2 ? "H2" : " ", mouse & BROWSER_MOUSE_MOD_1 ? "M1" : " ", mouse & BROWSER_MOUSE_MOD_2 ? "M2" : " ", mouse & BROWSER_MOUSE_MOD_3 ? "M3" : " "); NSLOG(netsurf, INFO, "mouse state: %s %s %s %s %s %s %s %s %s %s %s %s %s %s", mouse & BROWSER_MOUSE_PRESS_1 ? "P1" : " ", mouse & BROWSER_MOUSE_PRESS_2 ? "P2" : " ", mouse & BROWSER_MOUSE_CLICK_1 ? "C1" : " ", mouse & BROWSER_MOUSE_CLICK_2 ? "C2" : " ", mouse & BROWSER_MOUSE_DOUBLE_CLICK ? "DC" : " ", mouse & BROWSER_MOUSE_TRIPLE_CLICK ? "TC" : " ", mouse & BROWSER_MOUSE_DRAG_1 ? "D1" : " ", mouse & BROWSER_MOUSE_DRAG_2 ? "D2" : " ", mouse & BROWSER_MOUSE_DRAG_ON ? "DO" : " ", mouse & BROWSER_MOUSE_HOLDING_1 ? "H1" : " ", mouse & BROWSER_MOUSE_HOLDING_2 ? "H2" : " ", mouse & BROWSER_MOUSE_MOD_1 ? "M1" : " ", mouse & BROWSER_MOUSE_MOD_2 ? "M2" : " ", mouse & BROWSER_MOUSE_MOD_3 ? "M3" : " ");
} }

View File

@ -89,7 +89,8 @@
static void netsurf_lwc_iterator(lwc_string *str, void *pw) static void netsurf_lwc_iterator(lwc_string *str, void *pw)
{ {
LOG("[%3u] %.*s", str->refcnt, (int)lwc_string_length(str), lwc_string_data(str)); NSLOG(netsurf, INFO, "[%3u] %.*s", str->refcnt,
(int)lwc_string_length(str), lwc_string_data(str));
} }
/** /**
@ -165,8 +166,9 @@ nserror netsurf_init(const char *store_path)
if (hlcache_parameters.llcache.limit < MINIMUM_MEMORY_CACHE_SIZE) { if (hlcache_parameters.llcache.limit < MINIMUM_MEMORY_CACHE_SIZE) {
hlcache_parameters.llcache.limit = MINIMUM_MEMORY_CACHE_SIZE; hlcache_parameters.llcache.limit = MINIMUM_MEMORY_CACHE_SIZE;
LOG("Setting minimum memory cache size %" PRIsizet, NSLOG(netsurf, INFO,
hlcache_parameters.llcache.limit); "Setting minimum memory cache size %"PRIsizet,
hlcache_parameters.llcache.limit);
} }
/* Set up the max attempts made to fetch a timing out resource */ /* Set up the max attempts made to fetch a timing out resource */
@ -243,19 +245,19 @@ void netsurf_exit(void)
{ {
hlcache_stop(); hlcache_stop();
LOG("Closing GUI"); NSLOG(netsurf, INFO, "Closing GUI");
guit->misc->quit(); guit->misc->quit();
LOG("Finalising JavaScript"); NSLOG(netsurf, INFO, "Finalising JavaScript");
js_finalise(); js_finalise();
LOG("Finalising Web Search"); NSLOG(netsurf, INFO, "Finalising Web Search");
search_web_finalise(); search_web_finalise();
LOG("Finalising high-level cache"); NSLOG(netsurf, INFO, "Finalising high-level cache");
hlcache_finalise(); hlcache_finalise();
LOG("Closing fetches"); NSLOG(netsurf, INFO, "Closing fetches");
fetcher_quit(); fetcher_quit();
/* dump any remaining cache entries */ /* dump any remaining cache entries */
@ -264,21 +266,21 @@ void netsurf_exit(void)
/* Clean up after content handlers */ /* Clean up after content handlers */
content_factory_fini(); content_factory_fini();
LOG("Closing utf8"); NSLOG(netsurf, INFO, "Closing utf8");
utf8_finalise(); utf8_finalise();
LOG("Destroying URLdb"); NSLOG(netsurf, INFO, "Destroying URLdb");
urldb_destroy(); urldb_destroy();
LOG("Destroying System colours"); NSLOG(netsurf, INFO, "Destroying System colours");
ns_system_colour_finalize(); ns_system_colour_finalize();
LOG("Destroying Messages"); NSLOG(netsurf, INFO, "Destroying Messages");
messages_destroy(); messages_destroy();
corestrings_fini(); corestrings_fini();
LOG("Remaining lwc strings:"); NSLOG(netsurf, INFO, "Remaining lwc strings:");
lwc_iterate_strings(netsurf_lwc_iterator, NULL); lwc_iterate_strings(netsurf_lwc_iterator, NULL);
LOG("Exited successfully"); NSLOG(netsurf, INFO, "Exited successfully");
} }

View File

@ -126,8 +126,10 @@ print_apply_settings(hlcache_handle *content, struct print_settings *settings)
content_reformat(content, false, page_content_width, 0); content_reformat(content, false, page_content_width, 0);
LOG("New layout applied.New height = %d ; New width = %d ", NSLOG(netsurf, INFO,
content_get_height(content), content_get_width(content)); "New layout applied.New height = %d ; New width = %d ",
content_get_height(content),
content_get_width(content));
return true; return true;
} }

View File

@ -168,7 +168,7 @@ static bool save_complete_save_buffer(save_complete_ctx *ctx,
fp = fopen(fname, "wb"); fp = fopen(fname, "wb");
if (fp == NULL) { if (fp == NULL) {
free(fname); free(fname);
LOG("fopen(): errno = %i", errno); NSLOG(netsurf, INFO, "fopen(): errno = %i", errno);
guit->misc->warning("SaveError", strerror(errno)); guit->misc->warning("SaveError", strerror(errno));
return false; return false;
} }
@ -1044,7 +1044,7 @@ static bool save_complete_node_handler(dom_node *node,
} else if (type == DOM_DOCUMENT_NODE) { } else if (type == DOM_DOCUMENT_NODE) {
/* Do nothing */ /* Do nothing */
} else { } else {
LOG("Unhandled node type: %d", type); NSLOG(netsurf, INFO, "Unhandled node type: %d", type);
} }
return true; return true;
@ -1075,7 +1075,7 @@ static bool save_complete_save_html_document(save_complete_ctx *ctx,
fp = fopen(fname, "wb"); fp = fopen(fname, "wb");
if (fp == NULL) { if (fp == NULL) {
free(fname); free(fname);
LOG("fopen(): errno = %i", errno); NSLOG(netsurf, INFO, "fopen(): errno = %i", errno);
guit->misc->warning("SaveError", strerror(errno)); guit->misc->warning("SaveError", strerror(errno));
return false; return false;
} }
@ -1154,7 +1154,7 @@ static bool save_complete_inventory(save_complete_ctx *ctx)
fp = fopen(fname, "w"); fp = fopen(fname, "w");
free(fname); free(fname);
if (fp == NULL) { if (fp == NULL) {
LOG("fopen(): errno = %i", errno); NSLOG(netsurf, INFO, "fopen(): errno = %i", errno);
guit->misc->warning("SaveError", strerror(errno)); guit->misc->warning("SaveError", strerror(errno));
return false; return false;
} }
@ -1182,7 +1182,8 @@ static nserror regcomp_wrapper(regex_t *preg, const char *regex, int cflags)
if (r) { if (r) {
char errbuf[200]; char errbuf[200];
regerror(r, preg, errbuf, sizeof errbuf); regerror(r, preg, errbuf, sizeof errbuf);
LOG("Failed to compile regexp '%s': %s\n", regex, errbuf); NSLOG(netsurf, INFO, "Failed to compile regexp '%s': %s\n",
regex, errbuf);
return NSERROR_INIT_FAILED; return NSERROR_INIT_FAILED;
} }
return NSERROR_OK; return NSERROR_OK;

View File

@ -171,7 +171,8 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty
{ {
DashPattern_e dash; DashPattern_e dash;
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("%d %d %d %d %f %X", x0, y0, x1, y1, page_height - y0, pstyle->fill_colour); NSLOG(netsurf, INFO, "%d %d %d %d %f %X", x0, y0, x1, y1,
page_height - y0, pstyle->fill_colour);
#endif #endif
if (pstyle->fill_type != PLOT_OP_TYPE_NONE) { if (pstyle->fill_type != PLOT_OP_TYPE_NONE) {
@ -262,7 +263,7 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
int pmaxx = p[0], pmaxy = p[1]; int pmaxx = p[0], pmaxy = p[1];
int pminx = p[0], pminy = p[1]; int pminx = p[0], pminy = p[1];
LOG("."); NSLOG(netsurf, INFO, ".");
#endif #endif
if (n == 0) if (n == 0)
return true; return true;
@ -281,7 +282,8 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
} }
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("%d %d %d %d %f", pminx, pminy, pmaxx, pmaxy, page_height - pminy); NSLOG(netsurf, INFO, "%d %d %d %d %f", pminx, pminy, pmaxx, pmaxy,
page_height - pminy);
#endif #endif
HPDF_Page_Fill(pdf_page); HPDF_Page_Fill(pdf_page);
@ -294,7 +296,8 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
bool pdf_plot_clip(const struct rect *clip) bool pdf_plot_clip(const struct rect *clip)
{ {
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("%d %d %d %d", clip->x0, clip->y0, clip->x1, clip->y1); NSLOG(netsurf, INFO, "%d %d %d %d", clip->x0, clip->y0, clip->x1,
clip->y1);
#endif #endif
/*Normalize cllipping area - to prevent overflows. /*Normalize cllipping area - to prevent overflows.
@ -314,7 +317,7 @@ bool pdf_plot_text(int x, int y, const char *text, size_t length,
const plot_font_style_t *fstyle) const plot_font_style_t *fstyle)
{ {
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG(". %d %d %.*s", x, y, (int)length, text); NSLOG(netsurf, INFO, ". %d %d %.*s", x, y, (int)length, text);
#endif #endif
char *word; char *word;
HPDF_Font pdf_font; HPDF_Font pdf_font;
@ -347,7 +350,7 @@ bool pdf_plot_text(int x, int y, const char *text, size_t length,
bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style) bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style)
{ {
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("."); NSLOG(netsurf, INFO, ".");
#endif #endif
if (style->fill_type != PLOT_OP_TYPE_NONE) { if (style->fill_type != PLOT_OP_TYPE_NONE) {
apply_clip_and_mode(false, apply_clip_and_mode(false,
@ -378,7 +381,8 @@ bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style)
bool pdf_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style) bool pdf_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style)
{ {
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("%d %d %d %d %d %X", x, y, radius, angle1, angle2, style->stroke_colour); NSLOG(netsurf, INFO, "%d %d %d %d %d %X", x, y, radius, angle1,
angle2, style->stroke_colour);
#endif #endif
/* FIXME: line width 1 is ok ? */ /* FIXME: line width 1 is ok ? */
@ -406,7 +410,8 @@ bool pdf_plot_bitmap_tile(int x, int y, int width, int height,
HPDF_REAL max_width, max_height; HPDF_REAL max_width, max_height;
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("%d %d %d %d %p 0x%x", x, y, width, height, bitmap, bg); NSLOG(netsurf, INFO, "%d %d %d %d %p 0x%x", x, y, width, height,
bitmap, bg);
#endif #endif
if (width == 0 || height == 0) if (width == 0 || height == 0)
return true; return true;
@ -483,7 +488,8 @@ HPDF_Image pdf_extract_image(struct bitmap *bitmap)
rgb_buffer = (unsigned char *)malloc(3 * img_width * img_height); rgb_buffer = (unsigned char *)malloc(3 * img_width * img_height);
alpha_buffer = (unsigned char *)malloc(img_width * img_height); alpha_buffer = (unsigned char *)malloc(img_width * img_height);
if (rgb_buffer == NULL || alpha_buffer == NULL) { if (rgb_buffer == NULL || alpha_buffer == NULL) {
LOG("Not enough memory to create RGB buffer"); NSLOG(netsurf, INFO,
"Not enough memory to create RGB buffer");
free(rgb_buffer); free(rgb_buffer);
free(alpha_buffer); free(alpha_buffer);
return NULL; return NULL;
@ -607,7 +613,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
bool empty_path; bool empty_path;
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("."); NSLOG(netsurf, INFO, ".");
#endif #endif
if (n == 0) if (n == 0)
@ -649,7 +655,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
i += 7; i += 7;
empty_path = false; empty_path = false;
} else { } else {
LOG("bad path command %f", p[i]); NSLOG(netsurf, INFO, "bad path command %f", p[i]);
return false; return false;
} }
} }
@ -685,7 +691,7 @@ bool pdf_begin(struct print_settings *print_settings)
HPDF_Free(pdf_doc); HPDF_Free(pdf_doc);
pdf_doc = HPDF_New(error_handler, NULL); pdf_doc = HPDF_New(error_handler, NULL);
if (!pdf_doc) { if (!pdf_doc) {
LOG("Error creating pdf_doc"); NSLOG(netsurf, INFO, "Error creating pdf_doc");
return false; return false;
} }
@ -708,7 +714,7 @@ bool pdf_begin(struct print_settings *print_settings)
pdf_page = NULL; pdf_page = NULL;
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("pdf_begin finishes"); NSLOG(netsurf, INFO, "pdf_begin finishes");
#endif #endif
return true; return true;
} }
@ -717,7 +723,7 @@ bool pdf_begin(struct print_settings *print_settings)
bool pdf_next_page(void) bool pdf_next_page(void)
{ {
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("pdf_next_page begins"); NSLOG(netsurf, INFO, "pdf_next_page begins");
#endif #endif
clip_update_needed = false; clip_update_needed = false;
if (pdf_page != NULL) { if (pdf_page != NULL) {
@ -745,7 +751,7 @@ bool pdf_next_page(void)
pdfw_gs_save(pdf_page); pdfw_gs_save(pdf_page);
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("%f %f", page_width, page_height); NSLOG(netsurf, INFO, "%f %f", page_width, page_height);
#endif #endif
return true; return true;
@ -755,7 +761,7 @@ bool pdf_next_page(void)
void pdf_end(void) void pdf_end(void)
{ {
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("pdf_end begins"); NSLOG(netsurf, INFO, "pdf_end begins");
#endif #endif
clip_update_needed = false; clip_update_needed = false;
if (pdf_page != NULL) { if (pdf_page != NULL) {
@ -780,7 +786,7 @@ void pdf_end(void)
else else
save_pdf(settings->output); save_pdf(settings->output);
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
LOG("pdf_end finishes"); NSLOG(netsurf, INFO, "pdf_end finishes");
#endif #endif
} }
@ -819,7 +825,8 @@ nserror save_pdf(const char *path)
static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no,
void *user_data) void *user_data)
{ {
LOG("ERROR:\n\terror_no=%x\n\tdetail_no=%d\n", (HPDF_UINT)error_no, (HPDF_UINT)detail_no); NSLOG(netsurf, INFO, "ERROR:\n\terror_no=%x\n\tdetail_no=%d\n",
(HPDF_UINT)error_no, (HPDF_UINT)detail_no);
#ifdef PDF_DEBUG #ifdef PDF_DEBUG
exit(1); exit(1);
#endif #endif

View File

@ -75,7 +75,8 @@ void save_as_text(struct hlcache_handle *c, char *path)
free(save.block); free(save.block);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
LOG("failed to convert to local encoding, return %d", ret); NSLOG(netsurf, INFO,
"failed to convert to local encoding, return %d", ret);
return; return;
} }
@ -84,12 +85,13 @@ void save_as_text(struct hlcache_handle *c, char *path)
int res = fputs(result, out); int res = fputs(result, out);
if (res < 0) { if (res < 0) {
LOG("Warning: write failed"); NSLOG(netsurf, INFO, "Warning: write failed");
} }
res = fputs("\n", out); res = fputs("\n", out);
if (res < 0) { if (res < 0) {
LOG("Warning: failed writing trailing newline"); NSLOG(netsurf, INFO,
"Warning: failed writing trailing newline");
} }
fclose(out); fclose(out);

View File

@ -289,13 +289,16 @@ search_web_ico_callback(hlcache_handle *ico,
switch (event->type) { switch (event->type) {
case CONTENT_MSG_DONE: case CONTENT_MSG_DONE:
LOG("icon '%s' retrieved", nsurl_access(hlcache_handle_get_url(ico))); NSLOG(netsurf, INFO, "icon '%s' retrieved",
nsurl_access(hlcache_handle_get_url(ico)));
guit->search_web->provider_update(provider->name, guit->search_web->provider_update(provider->name,
content_get_bitmap(ico)); content_get_bitmap(ico));
break; break;
case CONTENT_MSG_ERROR: case CONTENT_MSG_ERROR:
LOG("icon %s error: %s", nsurl_access(hlcache_handle_get_url(ico)), event->data.error); NSLOG(netsurf, INFO, "icon %s error: %s",
nsurl_access(hlcache_handle_get_url(ico)),
event->data.error);
case CONTENT_MSG_ERRORCODE: case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(ico); hlcache_handle_release(ico);
/* clear reference to released handle */ /* clear reference to released handle */
@ -439,7 +442,8 @@ default_ico_callback(hlcache_handle *ico,
switch (event->type) { switch (event->type) {
case CONTENT_MSG_DONE: case CONTENT_MSG_DONE:
LOG("default icon '%s' retrieved", nsurl_access(hlcache_handle_get_url(ico))); NSLOG(netsurf, INFO, "default icon '%s' retrieved",
nsurl_access(hlcache_handle_get_url(ico)));
/* only set to default icon if providers icon has no handle */ /* only set to default icon if providers icon has no handle */
if (ctx->providers[search_web_ctx.current].ico_handle == NULL) { if (ctx->providers[search_web_ctx.current].ico_handle == NULL) {
@ -450,7 +454,9 @@ default_ico_callback(hlcache_handle *ico,
break; break;
case CONTENT_MSG_ERROR: case CONTENT_MSG_ERROR:
LOG("icon %s error: %s", nsurl_access(hlcache_handle_get_url(ico)), event->data.error); NSLOG(netsurf, INFO, "icon %s error: %s",
nsurl_access(hlcache_handle_get_url(ico)),
event->data.error);
case CONTENT_MSG_ERRORCODE: case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(ico); hlcache_handle_release(ico);
/* clear reference to released handle */ /* clear reference to released handle */

View File

@ -391,7 +391,7 @@ sslcert_viewer_init(struct core_window_callback_table *cw_t,
return err; return err;
} }
LOG("Building certificate viewer"); NSLOG(netsurf, INFO, "Building certificate viewer");
/* Init. certificate chain treeview entry fields */ /* Init. certificate chain treeview entry fields */
err = sslcert_init_entry_fields(ssl_d); err = sslcert_init_entry_fields(ssl_d);
@ -417,7 +417,7 @@ sslcert_viewer_init(struct core_window_callback_table *cw_t,
} }
} }
LOG("Built certificate viewer"); NSLOG(netsurf, INFO, "Built certificate viewer");
return NSERROR_OK; return NSERROR_OK;
} }
@ -452,7 +452,7 @@ nserror sslcert_viewer_fini(struct sslcert_session_data *ssl_d)
int i; int i;
nserror err; nserror err;
LOG("Finalising ssl certificate viewer"); NSLOG(netsurf, INFO, "Finalising ssl certificate viewer");
/* Destroy the treeview */ /* Destroy the treeview */
err = treeview_destroy(ssl_d->tree); err = treeview_destroy(ssl_d->tree);
@ -470,7 +470,7 @@ nserror sslcert_viewer_fini(struct sslcert_session_data *ssl_d)
return err; return err;
} }
LOG("Finalised ssl certificate viewer"); NSLOG(netsurf, INFO, "Finalised ssl certificate viewer");
return err; return err;
} }

View File

@ -828,7 +828,7 @@ static bool textarea_reflow_singleline(struct textarea *ta, size_t b_off,
ta->lines = ta->lines =
malloc(LINE_CHUNK_SIZE * sizeof(struct line_info)); malloc(LINE_CHUNK_SIZE * sizeof(struct line_info));
if (ta->lines == NULL) { if (ta->lines == NULL) {
LOG("malloc failed"); NSLOG(netsurf, INFO, "malloc failed");
return false; return false;
} }
ta->lines_alloc_size = LINE_CHUNK_SIZE; ta->lines_alloc_size = LINE_CHUNK_SIZE;
@ -852,7 +852,7 @@ static bool textarea_reflow_singleline(struct textarea *ta, size_t b_off,
char *temp = realloc(ta->password.data, char *temp = realloc(ta->password.data,
b_len + TA_ALLOC_STEP); b_len + TA_ALLOC_STEP);
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
@ -936,7 +936,8 @@ static bool textarea_reflow_multiline(struct textarea *ta,
if (ta->lines == NULL) { if (ta->lines == NULL) {
ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE); ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE);
if (ta->lines == NULL) { if (ta->lines == NULL) {
LOG("Failed to allocate memory for textarea lines"); NSLOG(netsurf, INFO,
"Failed to allocate memory for textarea lines");
return false; return false;
} }
ta->lines_alloc_size = LINE_CHUNK_SIZE; ta->lines_alloc_size = LINE_CHUNK_SIZE;
@ -1053,7 +1054,7 @@ static bool textarea_reflow_multiline(struct textarea *ta,
(line + 2 + LINE_CHUNK_SIZE) * (line + 2 + LINE_CHUNK_SIZE) *
sizeof(struct line_info)); sizeof(struct line_info));
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
@ -1334,7 +1335,7 @@ static bool textarea_insert_text(struct textarea *ta, const char *text,
char *temp = realloc(ta->text.data, b_len + ta->text.len + char *temp = realloc(ta->text.data, b_len + ta->text.len +
TA_ALLOC_STEP); TA_ALLOC_STEP);
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
@ -1484,7 +1485,7 @@ static bool textarea_replace_text_internal(struct textarea *ta, size_t b_start,
rep_len + ta->text.len - (b_end - b_start) + rep_len + ta->text.len - (b_end - b_start) +
TA_ALLOC_STEP); TA_ALLOC_STEP);
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
@ -1561,7 +1562,7 @@ static bool textarea_copy_to_undo_buffer(struct textarea *ta,
char *temp = realloc(undo->text.data, char *temp = realloc(undo->text.data,
b_offset + len + TA_ALLOC_STEP); b_offset + len + TA_ALLOC_STEP);
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
@ -1575,7 +1576,7 @@ static bool textarea_copy_to_undo_buffer(struct textarea *ta,
(undo->next_detail + 128) * (undo->next_detail + 128) *
sizeof(struct textarea_undo_detail)); sizeof(struct textarea_undo_detail));
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
@ -1835,13 +1836,13 @@ struct textarea *textarea_create(const textarea_flags flags,
flags & TEXTAREA_PASSWORD)); flags & TEXTAREA_PASSWORD));
if (callback == NULL) { if (callback == NULL) {
LOG("no callback provided"); NSLOG(netsurf, INFO, "no callback provided");
return NULL; return NULL;
} }
ret = malloc(sizeof(struct textarea)); ret = malloc(sizeof(struct textarea));
if (ret == NULL) { if (ret == NULL) {
LOG("malloc failed"); NSLOG(netsurf, INFO, "malloc failed");
return NULL; return NULL;
} }
@ -1888,7 +1889,7 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->text.data = malloc(TA_ALLOC_STEP); ret->text.data = malloc(TA_ALLOC_STEP);
if (ret->text.data == NULL) { if (ret->text.data == NULL) {
LOG("malloc failed"); NSLOG(netsurf, INFO, "malloc failed");
free(ret); free(ret);
return NULL; return NULL;
} }
@ -1900,7 +1901,7 @@ struct textarea *textarea_create(const textarea_flags flags,
if (flags & TEXTAREA_PASSWORD) { if (flags & TEXTAREA_PASSWORD) {
ret->password.data = malloc(TA_ALLOC_STEP); ret->password.data = malloc(TA_ALLOC_STEP);
if (ret->password.data == NULL) { if (ret->password.data == NULL) {
LOG("malloc failed"); NSLOG(netsurf, INFO, "malloc failed");
free(ret->text.data); free(ret->text.data);
free(ret); free(ret);
return NULL; return NULL;
@ -1975,7 +1976,7 @@ bool textarea_set_text(struct textarea *ta, const char *text)
if (len >= ta->text.alloc) { if (len >= ta->text.alloc) {
char *temp = realloc(ta->text.data, len + TA_ALLOC_STEP); char *temp = realloc(ta->text.data, len + TA_ALLOC_STEP);
if (temp == NULL) { if (temp == NULL) {
LOG("realloc failed"); NSLOG(netsurf, INFO, "realloc failed");
return false; return false;
} }
ta->text.data = temp; ta->text.data = temp;
@ -2062,7 +2063,7 @@ int textarea_get_text(struct textarea *ta, char *buf, unsigned int len)
} }
if (len < ta->text.len) { if (len < ta->text.len) {
LOG("buffer too small"); NSLOG(netsurf, INFO, "buffer too small");
return -1; return -1;
} }

View File

@ -1601,7 +1601,7 @@ treeview_cw_attach(treeview *tree,
assert(cw != NULL); assert(cw != NULL);
if (tree->cw_t != NULL || tree->cw_h != NULL) { if (tree->cw_t != NULL || tree->cw_h != NULL) {
LOG("Treeview already attached."); NSLOG(netsurf, INFO, "Treeview already attached.");
return NSERROR_UNKNOWN; return NSERROR_UNKNOWN;
} }
tree->cw_t = cw_t; tree->cw_t = cw_t;
@ -1666,7 +1666,7 @@ treeview_node_expand_internal(treeview *tree, treeview_node *node)
if (node->flags & TV_NFLAGS_EXPANDED) { if (node->flags & TV_NFLAGS_EXPANDED) {
/* What madness is this? */ /* What madness is this? */
LOG("Tried to expand an expanded node."); NSLOG(netsurf, INFO, "Tried to expand an expanded node.");
return NSERROR_OK; return NSERROR_OK;
} }
@ -1824,7 +1824,7 @@ treeview_node_contract_internal(treeview *tree, treeview_node *node)
if ((node->flags & TV_NFLAGS_EXPANDED) == false) { if ((node->flags & TV_NFLAGS_EXPANDED) == false) {
/* What madness is this? */ /* What madness is this? */
LOG("Tried to contract a contracted node."); NSLOG(netsurf, INFO, "Tried to contract a contracted node.");
return NSERROR_OK; return NSERROR_OK;
} }
@ -2771,7 +2771,7 @@ static nserror treeview_move_selection(treeview *tree, struct rect *rect)
break; break;
default: default:
LOG("Bad drop target for move."); NSLOG(netsurf, INFO, "Bad drop target for move.");
return NSERROR_BAD_PARAMETER; return NSERROR_BAD_PARAMETER;
} }
@ -4403,7 +4403,7 @@ nserror treeview_init(void)
return NSERROR_OK; return NSERROR_OK;
} }
LOG("Initialising treeview module"); NSLOG(netsurf, INFO, "Initialising treeview module");
font_pt_size = nsoption_int(treeview_font_size); font_pt_size = nsoption_int(treeview_font_size);
if (font_pt_size <= 0) { if (font_pt_size <= 0) {
@ -4434,7 +4434,7 @@ nserror treeview_init(void)
tree_g.initialised++; tree_g.initialised++;
LOG("Initialised treeview module"); NSLOG(netsurf, INFO, "Initialised treeview module");
return NSERROR_OK; return NSERROR_OK;
} }
@ -4450,11 +4450,12 @@ nserror treeview_fini(void)
return NSERROR_OK; return NSERROR_OK;
} else if (tree_g.initialised == 0) { } else if (tree_g.initialised == 0) {
LOG("Warning: tried to finalise uninitialised treeview module"); NSLOG(netsurf, INFO,
"Warning: tried to finalise uninitialised treeview module");
return NSERROR_OK; return NSERROR_OK;
} }
LOG("Finalising treeview module"); NSLOG(netsurf, INFO, "Finalising treeview module");
for (i = 0; i < TREE_RES_LAST; i++) { for (i = 0; i < TREE_RES_LAST; i++) {
hlcache_handle_release(treeview_res[i].c); hlcache_handle_release(treeview_res[i].c);
@ -4471,7 +4472,7 @@ nserror treeview_fini(void)
tree_g.initialised--; tree_g.initialised--;
LOG("Finalised treeview module"); NSLOG(netsurf, INFO, "Finalised treeview module");
return NSERROR_OK; return NSERROR_OK;
} }

View File

@ -173,7 +173,7 @@ void ami_arexx_execute(char *script)
if((lock = Lock(script, ACCESS_READ))) { if((lock = Lock(script, ACCESS_READ))) {
DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH); DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH);
LOG("Executing script: %s", full_script_path); NSLOG(netsurf, INFO, "Executing script: %s", full_script_path);
ami_arexx_command(full_script_path, NULL); ami_arexx_command(full_script_path, NULL);
UnLock(lock); UnLock(lock);
} }

View File

@ -161,7 +161,10 @@ static void amiga_bitmap_unmap_buffer(void *p)
struct bitmap *bm = p; struct bitmap *bm = p;
if((nsoption_bool(use_extmem) == true) && (bm->pixdata != NULL)) { if((nsoption_bool(use_extmem) == true) && (bm->pixdata != NULL)) {
LOG("Unmapping ExtMem object %p for bitmap %p", bm->iextmem, bm); NSLOG(netsurf, INFO,
"Unmapping ExtMem object %p for bitmap %p",
bm->iextmem,
bm);
bm->iextmem->Unmap(bm->pixdata, bm->size); bm->iextmem->Unmap(bm->pixdata, bm->size);
bm->pixdata = NULL; bm->pixdata = NULL;
} }
@ -176,7 +179,10 @@ unsigned char *amiga_bitmap_get_buffer(void *bitmap)
#ifdef __amigaos4__ #ifdef __amigaos4__
if(nsoption_bool(use_extmem) == true) { if(nsoption_bool(use_extmem) == true) {
if(bm->pixdata == NULL) { if(bm->pixdata == NULL) {
LOG("Mapping ExtMem object %p for bitmap %p", bm->iextmem, bm); NSLOG(netsurf, INFO,
"Mapping ExtMem object %p for bitmap %p",
bm->iextmem,
bm);
bm->pixdata = bm->iextmem->Map(NULL, bm->size, 0LL, 0); bm->pixdata = bm->iextmem->Map(NULL, bm->size, 0LL, 0);
} }
@ -723,7 +729,7 @@ void ami_bitmap_fini(void)
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content) static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
{ {
#ifdef __amigaos4__ #ifdef __amigaos4__
LOG("Entering bitmap_render"); NSLOG(netsurf, INFO, "Entering bitmap_render");
int plot_width; int plot_width;
int plot_height; int plot_height;

View File

@ -364,7 +364,7 @@ nserror ami_cookies_present(void)
res = ami_cookies_create_window(ncwin); res = ami_cookies_create_window(ncwin);
if (res != NSERROR_OK) { if (res != NSERROR_OK) {
LOG("SSL UI builder init failed"); NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle); ami_utf8_free(ncwin->core.wintitle);
free(ncwin); free(ncwin);
return res; return res;

View File

@ -315,7 +315,7 @@ static void ami_cw_redraw_queue(struct ami_corewindow *ami_cw, bool draw)
if(IsMinListEmpty(ami_cw->deferred_rects)) return; if(IsMinListEmpty(ami_cw->deferred_rects)) return;
if(draw == false) { if(draw == false) {
LOG("Ignoring deferred box redraw queue"); NSLOG(netsurf, INFO, "Ignoring deferred box redraw queue");
} // else should probably show busy pointer } // else should probably show busy pointer
node = (struct nsObject *)GetHead((struct List *)ami_cw->deferred_rects); node = (struct nsObject *)GetHead((struct List *)ami_cw->deferred_rects);
@ -378,7 +378,8 @@ ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r)
nsobj = AddObject(ami_cw->deferred_rects, AMINS_RECT); nsobj = AddObject(ami_cw->deferred_rects, AMINS_RECT);
nsobj->objstruct = deferred_rect; nsobj->objstruct = deferred_rect;
} else { } else {
LOG("Ignoring duplicate or subset of queued box redraw"); NSLOG(netsurf, INFO,
"Ignoring duplicate or subset of queued box redraw");
} }
ami_schedule(1, ami_cw_redraw_cb, ami_cw); ami_schedule(1, ami_cw_redraw_cb, ami_cw);
} }

View File

@ -188,7 +188,8 @@ void ami_drag_save(struct Window *win)
break; break;
default: default:
LOG("Unsupported drag save operation %d", drag_save); NSLOG(netsurf, INFO,
"Unsupported drag save operation %d", drag_save);
break; break;
} }

View File

@ -162,7 +162,7 @@ nserror amiga_dt_anim_create(const content_handler *handler,
bool amiga_dt_anim_convert(struct content *c) bool amiga_dt_anim_convert(struct content *c)
{ {
LOG("amiga_dt_anim_convert"); NSLOG(netsurf, INFO, "amiga_dt_anim_convert");
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
union content_msg_data msg_data; union content_msg_data msg_data;
@ -246,7 +246,7 @@ void amiga_dt_anim_destroy(struct content *c)
{ {
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
LOG("amiga_dt_anim_destroy"); NSLOG(netsurf, INFO, "amiga_dt_anim_destroy");
if (plugin->bitmap != NULL) if (plugin->bitmap != NULL)
amiga_bitmap_destroy(plugin->bitmap); amiga_bitmap_destroy(plugin->bitmap);
@ -263,7 +263,7 @@ bool amiga_dt_anim_redraw(struct content *c,
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
bitmap_flags_t flags = BITMAPF_NONE; bitmap_flags_t flags = BITMAPF_NONE;
LOG("amiga_dt_anim_redraw"); NSLOG(netsurf, INFO, "amiga_dt_anim_redraw");
if (data->repeat_x) if (data->repeat_x)
flags |= BITMAPF_REPEAT_X; flags |= BITMAPF_REPEAT_X;
@ -290,20 +290,20 @@ bool amiga_dt_anim_redraw(struct content *c,
void amiga_dt_anim_open(struct content *c, struct browser_window *bw, void amiga_dt_anim_open(struct content *c, struct browser_window *bw,
struct content *page, struct object_params *params) struct content *page, struct object_params *params)
{ {
LOG("amiga_dt_anim_open"); NSLOG(netsurf, INFO, "amiga_dt_anim_open");
return; return;
} }
void amiga_dt_anim_close(struct content *c) void amiga_dt_anim_close(struct content *c)
{ {
LOG("amiga_dt_anim_close"); NSLOG(netsurf, INFO, "amiga_dt_anim_close");
return; return;
} }
void amiga_dt_anim_reformat(struct content *c, int width, int height) void amiga_dt_anim_reformat(struct content *c, int width, int height)
{ {
LOG("amiga_dt_anim_reformat"); NSLOG(netsurf, INFO, "amiga_dt_anim_reformat");
return; return;
} }
@ -312,7 +312,7 @@ nserror amiga_dt_anim_clone(const struct content *old, struct content **newc)
amiga_dt_anim_content *plugin; amiga_dt_anim_content *plugin;
nserror error; nserror error;
LOG("amiga_dt_anim_clone"); NSLOG(netsurf, INFO, "amiga_dt_anim_clone");
plugin = calloc(1, sizeof(amiga_dt_anim_content)); plugin = calloc(1, sizeof(amiga_dt_anim_content));
if (plugin == NULL) if (plugin == NULL)

View File

@ -174,7 +174,7 @@ static char *amiga_dt_picture_datatype(struct content *c)
static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
{ {
LOG("amiga_dt_picture_cache_convert"); NSLOG(netsurf, INFO, "amiga_dt_picture_cache_convert");
union content_msg_data msg_data; union content_msg_data msg_data;
UBYTE *bm_buffer; UBYTE *bm_buffer;
@ -210,7 +210,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
bool amiga_dt_picture_convert(struct content *c) bool amiga_dt_picture_convert(struct content *c)
{ {
LOG("amiga_dt_picture_convert"); NSLOG(netsurf, INFO, "amiga_dt_picture_convert");
int width, height; int width, height;
char *title; char *title;
@ -256,7 +256,7 @@ nserror amiga_dt_picture_clone(const struct content *old, struct content **newc)
struct content *adt; struct content *adt;
nserror error; nserror error;
LOG("amiga_dt_picture_clone"); NSLOG(netsurf, INFO, "amiga_dt_picture_clone");
adt = calloc(1, sizeof(struct content)); adt = calloc(1, sizeof(struct content));
if (adt == NULL) if (adt == NULL)

View File

@ -76,7 +76,7 @@ static const content_handler amiga_dt_sound_content_handler = {
static void amiga_dt_sound_play(Object *dto) static void amiga_dt_sound_play(Object *dto)
{ {
LOG("Playing..."); NSLOG(netsurf, INFO, "Playing...");
IDoMethod(dto, DTM_TRIGGER, NULL, STM_PLAY, NULL); IDoMethod(dto, DTM_TRIGGER, NULL, STM_PLAY, NULL);
} }
@ -126,7 +126,7 @@ nserror amiga_dt_sound_create(const content_handler *handler,
amiga_dt_sound_content *plugin; amiga_dt_sound_content *plugin;
nserror error; nserror error;
LOG("amiga_dt_sound_create"); NSLOG(netsurf, INFO, "amiga_dt_sound_create");
plugin = calloc(1, sizeof(amiga_dt_sound_content)); plugin = calloc(1, sizeof(amiga_dt_sound_content));
if (plugin == NULL) if (plugin == NULL)
@ -146,7 +146,7 @@ nserror amiga_dt_sound_create(const content_handler *handler,
bool amiga_dt_sound_convert(struct content *c) bool amiga_dt_sound_convert(struct content *c)
{ {
LOG("amiga_dt_sound_convert"); NSLOG(netsurf, INFO, "amiga_dt_sound_convert");
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
int width = 50, height = 50; int width = 50, height = 50;
@ -180,7 +180,7 @@ void amiga_dt_sound_destroy(struct content *c)
{ {
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
LOG("amiga_dt_sound_destroy"); NSLOG(netsurf, INFO, "amiga_dt_sound_destroy");
DisposeDTObject(plugin->dto); DisposeDTObject(plugin->dto);
@ -199,7 +199,7 @@ bool amiga_dt_sound_redraw(struct content *c,
}; };
struct rect rect; struct rect rect;
LOG("amiga_dt_sound_redraw"); NSLOG(netsurf, INFO, "amiga_dt_sound_redraw");
rect.x0 = data->x; rect.x0 = data->x;
rect.y0 = data->y; rect.y0 = data->y;
@ -226,7 +226,7 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
struct object_param *param; struct object_param *param;
LOG("amiga_dt_sound_open"); NSLOG(netsurf, INFO, "amiga_dt_sound_open");
plugin->immediate = false; plugin->immediate = false;
@ -234,7 +234,8 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
{ {
do do
{ {
LOG("%s = %s", param->name, param->value); NSLOG(netsurf, INFO, "%s = %s", param->name,
param->value);
if((strcmp(param->name, "autoplay") == 0) && if((strcmp(param->name, "autoplay") == 0) &&
(strcmp(param->value, "true") == 0)) plugin->immediate = true; (strcmp(param->value, "true") == 0)) plugin->immediate = true;
if((strcmp(param->name, "autoStart") == 0) && if((strcmp(param->name, "autoStart") == 0) &&
@ -255,7 +256,7 @@ nserror amiga_dt_sound_clone(const struct content *old, struct content **newc)
amiga_dt_sound_content *plugin; amiga_dt_sound_content *plugin;
nserror error; nserror error;
LOG("amiga_dt_sound_clone"); NSLOG(netsurf, INFO, "amiga_dt_sound_clone");
plugin = calloc(1, sizeof(amiga_dt_sound_content)); plugin = calloc(1, sizeof(amiga_dt_sound_content));
if (plugin == NULL) if (plugin == NULL)

View File

@ -185,7 +185,7 @@ nserror ami_mime_init(const char *mimefile)
struct nsObject *node; struct nsObject *node;
struct ami_mime_entry *mimeentry; struct ami_mime_entry *mimeentry;
LOG("mimetypes file: %s", mimefile); NSLOG(netsurf, INFO, "mimetypes file: %s", mimefile);
if(ami_mime_list == NULL) if(ami_mime_list == NULL)
ami_mime_list = NewObjList(); ami_mime_list = NewObjList();
@ -642,6 +642,10 @@ void ami_mime_dump(void)
struct ami_mime_entry *mimeentry; struct ami_mime_entry *mimeentry;
while((mimeentry = ami_mime_entry_locate(NULL, AMI_MIME_MIMETYPE, &node))) { while((mimeentry = ami_mime_entry_locate(NULL, AMI_MIME_MIMETYPE, &node))) {
LOG("%s DT=\"%s\" TYPE=\"%s\" CMD=\"%s\"", mimeentry->mimetype ? lwc_string_data(mimeentry->mimetype) : "", mimeentry->datatype ? lwc_string_data(mimeentry->datatype) : "", mimeentry->filetype ? lwc_string_data(mimeentry->filetype) : "", mimeentry->plugincmd ? lwc_string_data(mimeentry->plugincmd) : ""); NSLOG(netsurf, INFO, "%s DT=\"%s\" TYPE=\"%s\" CMD=\"%s\"",
mimeentry->mimetype ? lwc_string_data(mimeentry->mimetype) : "",
mimeentry->datatype ? lwc_string_data(mimeentry->datatype) : "",
mimeentry->filetype ? lwc_string_data(mimeentry->filetype) : "",
mimeentry->plugincmd ? lwc_string_data(mimeentry->plugincmd) : "");
}; };
} }

View File

@ -51,7 +51,8 @@ void ami_font_setdevicedpi(int id)
struct DisplayInfo dinfo; struct DisplayInfo dinfo;
if(nsoption_bool(bitmap_fonts) == true) { if(nsoption_bool(bitmap_fonts) == true) {
LOG("WARNING: Using diskfont.library for text. Forcing DPI to 72."); NSLOG(netsurf, INFO,
"WARNING: Using diskfont.library for text. Forcing DPI to 72.");
nsoption_set_int(screen_ydpi, 72); nsoption_set_int(screen_ydpi, 72);
} }
@ -79,7 +80,14 @@ void ami_font_setdevicedpi(int id)
xdpi = (yres * ydpi) / xres; xdpi = (yres * ydpi) / xres;
LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x %d)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres); NSLOG(netsurf, INFO,
"XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x %d)",
xdpi,
ydpi,
dinfo.Resolution.x,
dinfo.Resolution.y,
xres,
yres);
} }
} }
} }

View File

@ -361,7 +361,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical
if(!nodedata->font) if(!nodedata->font)
{ {
LOG("Requested font not found: %s", font); NSLOG(netsurf, INFO, "Requested font not found: %s", font);
if(critical == true) amiga_warn_user("CompError", font); if(critical == true) amiga_warn_user("CompError", font);
free(nodedata); free(nodedata);
return NULL; return NULL;
@ -369,21 +369,28 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical
nodedata->bold = (char *)GetTagData(OT_BName, 0, nodedata->font->olf_OTagList); nodedata->bold = (char *)GetTagData(OT_BName, 0, nodedata->font->olf_OTagList);
if(nodedata->bold) if(nodedata->bold)
LOG("Bold font defined for %s is %s", font, nodedata->bold); NSLOG(netsurf, INFO, "Bold font defined for %s is %s", font,
nodedata->bold);
else else
LOG("Warning: No designed bold font defined for %s", font); NSLOG(netsurf, INFO,
"Warning: No designed bold font defined for %s", font);
nodedata->italic = (char *)GetTagData(OT_IName, 0, nodedata->font->olf_OTagList); nodedata->italic = (char *)GetTagData(OT_IName, 0, nodedata->font->olf_OTagList);
if(nodedata->italic) if(nodedata->italic)
LOG("Italic font defined for %s is %s", font, nodedata->italic); NSLOG(netsurf, INFO, "Italic font defined for %s is %s",
font, nodedata->italic);
else else
LOG("Warning: No designed italic font defined for %s", font); NSLOG(netsurf, INFO,
"Warning: No designed italic font defined for %s", font);
nodedata->bolditalic = (char *)GetTagData(OT_BIName, 0, nodedata->font->olf_OTagList); nodedata->bolditalic = (char *)GetTagData(OT_BIName, 0, nodedata->font->olf_OTagList);
if(nodedata->bolditalic) if(nodedata->bolditalic)
LOG("Bold-italic font defined for %s is %s", font, nodedata->bolditalic); NSLOG(netsurf, INFO, "Bold-italic font defined for %s is %s",
font, nodedata->bolditalic);
else else
LOG("Warning: No designed bold-italic font defined for %s", font); NSLOG(netsurf, INFO,
"Warning: No designed bold-italic font defined for %s",
font);
ami_font_cache_insert(nodedata, font); ami_font_cache_insert(nodedata, font);
return nodedata; return nodedata;

View File

@ -69,7 +69,10 @@ static void ami_font_cache_cleanup(struct SkipList *skiplist)
SubTime(&curtime, &node->lastused); SubTime(&curtime, &node->lastused);
if(curtime.Seconds > 300) if(curtime.Seconds > 300)
{ {
LOG("Freeing font %p not used for %ld seconds", node->skip_node.sn_Key, curtime.Seconds); NSLOG(netsurf, INFO,
"Freeing font %p not used for %ld seconds",
node->skip_node.sn_Key,
curtime.Seconds);
ami_font_bullet_close(node); ami_font_bullet_close(node);
RemoveSkipNode(skiplist, node->skip_node.sn_Key); RemoveSkipNode(skiplist, node->skip_node.sn_Key);
} }
@ -98,7 +101,10 @@ static void ami_font_cache_cleanup(struct MinList *ami_font_cache_list)
SubTime(&curtime, &fnode->lastused); SubTime(&curtime, &fnode->lastused);
if(curtime.Seconds > 300) if(curtime.Seconds > 300)
{ {
LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name, curtime.Seconds); NSLOG(netsurf, INFO,
"Freeing %s not used for %ld seconds",
node->dtz_Node.ln_Name,
curtime.Seconds);
DelObject(node); DelObject(node);
} }
} while((node=nnode)); } while((node=nnode));
@ -146,7 +152,7 @@ struct ami_font_cache_node *ami_font_cache_locate(const char *font)
return nodedata; return nodedata;
} }
LOG("Font cache miss: %s (%lx)", font, hash); NSLOG(netsurf, INFO, "Font cache miss: %s (%lx)", font, hash);
return NULL; return NULL;
} }
@ -180,7 +186,7 @@ void ami_font_cache_insert(struct ami_font_cache_node *nodedata, const char *fon
void ami_font_cache_fini(void) void ami_font_cache_fini(void)
{ {
LOG("Cleaning up font cache"); NSLOG(netsurf, INFO, "Cleaning up font cache");
ami_schedule(-1, (void *)ami_font_cache_cleanup, ami_font_cache_list); ami_schedule(-1, (void *)ami_font_cache_cleanup, ami_font_cache_list);
#ifdef __amigaos4__ #ifdef __amigaos4__
ami_font_cache_del_skiplist(ami_font_cache_list); ami_font_cache_del_skiplist(ami_font_cache_list);

View File

@ -55,7 +55,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st
(fstyle->size == prev_fstyle->size) && (fstyle->size == prev_fstyle->size) &&
(fstyle->flags == prev_fstyle->flags) && (fstyle->flags == prev_fstyle->flags) &&
(fstyle->weight == prev_fstyle->weight)) { (fstyle->weight == prev_fstyle->weight)) {
LOG("(using current font)"); NSLOG(netsurf, INFO, "(using current font)");
return prev_font; return prev_font;
} }
@ -99,7 +99,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st
snprintf(font, MAX_FONT_NAME_SIZE, "%s.font", fontname); snprintf(font, MAX_FONT_NAME_SIZE, "%s.font", fontname);
tattr.ta_Name = font; tattr.ta_Name = font;
tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE; tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE;
LOG("font: %s/%d", tattr.ta_Name, tattr.ta_YSize); NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize);
if(prev_font != NULL) CloseFont(prev_font); if(prev_font != NULL) CloseFont(prev_font);

View File

@ -255,7 +255,8 @@ static ULONG ami_font_scan_font(const char *fontname, lwc_string **glypharray)
#ifdef __amigaos4__ #ifdef __amigaos4__
if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) { if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) {
if(unicoderanges & UCR_SURROGATES) { if(unicoderanges & UCR_SURROGATES) {
LOG("%s supports UTF-16 surrogates", fontname); NSLOG(netsurf, INFO, "%s supports UTF-16 surrogates",
fontname);
if (nsoption_charp(font_surrogate) == NULL) { if (nsoption_charp(font_surrogate) == NULL) {
nsoption_set_charp(font_surrogate, (char *)strdup(fontname)); nsoption_set_charp(font_surrogate, (char *)strdup(fontname));
} }
@ -292,10 +293,11 @@ static ULONG ami_font_scan_fonts(struct MinList *list,
do { do {
nnode = (struct nsObject *)GetSucc((struct Node *)node); nnode = (struct nsObject *)GetSucc((struct Node *)node);
ami_font_scan_gui_update(win, node->dtz_Node.ln_Name, font_num, total); ami_font_scan_gui_update(win, node->dtz_Node.ln_Name, font_num, total);
LOG("Scanning %s", node->dtz_Node.ln_Name); NSLOG(netsurf, INFO, "Scanning %s", node->dtz_Node.ln_Name);
found = ami_font_scan_font(node->dtz_Node.ln_Name, glypharray); found = ami_font_scan_font(node->dtz_Node.ln_Name, glypharray);
total += found; total += found;
LOG("Found %ld new glyphs (total = %ld)", found, total); NSLOG(netsurf, INFO, "Found %ld new glyphs (total = %ld)",
found, total);
font_num++; font_num++;
} while((node = nnode)); } while((node = nnode));
@ -344,7 +346,9 @@ static ULONG ami_font_scan_list(struct MinList *list)
if(node) { if(node) {
node->dtz_Node.ln_Name = strdup(af[i].af_Attr.ta_Name); node->dtz_Node.ln_Name = strdup(af[i].af_Attr.ta_Name);
found++; found++;
LOG("Added %s", af[i].af_Attr.ta_Name); NSLOG(netsurf, INFO,
"Added %s",
af[i].af_Attr.ta_Name);
} }
} }
} }
@ -382,7 +386,8 @@ static ULONG ami_font_scan_load(const char *filename, lwc_string **glypharray)
rargs = AllocDosObjectTags(DOS_RDARGS, TAG_DONE); rargs = AllocDosObjectTags(DOS_RDARGS, TAG_DONE);
if((fh = FOpen(filename, MODE_OLDFILE, 0))) { if((fh = FOpen(filename, MODE_OLDFILE, 0))) {
LOG("Loading font glyph cache from %s", filename); NSLOG(netsurf, INFO, "Loading font glyph cache from %s",
filename);
while(FGets(fh, (STRPTR)&buffer, 256) != 0) while(FGets(fh, (STRPTR)&buffer, 256) != 0)
{ {
@ -423,7 +428,8 @@ void ami_font_scan_save(const char *filename, lwc_string **glypharray)
BPTR fh = 0; BPTR fh = 0;
if((fh = FOpen(filename, MODE_NEWFILE, 0))) { if((fh = FOpen(filename, MODE_NEWFILE, 0))) {
LOG("Writing font glyph cache to %s", filename); NSLOG(netsurf, INFO, "Writing font glyph cache to %s",
filename);
FPrintf(fh, "; This file is auto-generated. To re-create the cache, delete this file.\n"); FPrintf(fh, "; This file is auto-generated. To re-create the cache, delete this file.\n");
FPrintf(fh, "; This file is parsed using ReadArgs() with the following template:\n"); FPrintf(fh, "; This file is parsed using ReadArgs() with the following template:\n");
FPrintf(fh, "; CODE/A,FONT/A\n;\n"); FPrintf(fh, "; CODE/A,FONT/A\n;\n");
@ -482,7 +488,7 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save,
found = ami_font_scan_load(filename, glypharray); found = ami_font_scan_load(filename, glypharray);
if(found == 0) { if(found == 0) {
LOG("Creating new font glyph cache"); NSLOG(netsurf, INFO, "Creating new font glyph cache");
if((list = NewObjList())) { if((list = NewObjList())) {
/* add preferred fonts list */ /* add preferred fonts list */
@ -504,7 +510,7 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save,
if(nsoption_bool(font_unicode_only) == false) if(nsoption_bool(font_unicode_only) == false)
entries += ami_font_scan_list(list); entries += ami_font_scan_list(list);
LOG("Found %ld fonts", entries); NSLOG(netsurf, INFO, "Found %ld fonts", entries);
win = ami_font_scan_gui_open(entries); win = ami_font_scan_gui_open(entries);
found = ami_font_scan_fonts(list, win, glypharray); found = ami_font_scan_fonts(list, win, glypharray);
@ -517,6 +523,6 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save,
} }
} }
LOG("Initialised with %ld glyphs", found); NSLOG(netsurf, INFO, "Initialised with %ld glyphs", found);
} }

View File

@ -342,7 +342,9 @@ bool ami_gui_map_filename(char **remapped, const char *restrict path,
} }
if(found == false) *remapped = strdup(file); if(found == false) *remapped = strdup(file);
else LOG("Remapped %s to %s in path %s using %s", file, *remapped, path, map); else NSLOG(netsurf, INFO,
"Remapped %s to %s in path %s using %s", file,
*remapped, path, map);
free(mapfile); free(mapfile);
@ -365,7 +367,7 @@ static bool ami_gui_check_resource(char *fullpath, const char *file)
found = true; found = true;
} }
if(found) LOG("Found %s", fullpath); if(found) NSLOG(netsurf, INFO, "Found %s", fullpath);
free(remapped); free(remapped);
return found; return found;
@ -842,7 +844,7 @@ static void ami_openscreen(void)
} }
if(screen_signal == -1) screen_signal = AllocSignal(-1); if(screen_signal == -1) screen_signal = AllocSignal(-1);
LOG("Screen signal %d", screen_signal); NSLOG(netsurf, INFO, "Screen signal %d", screen_signal);
scrn = OpenScreenTags(NULL, scrn = OpenScreenTags(NULL,
/**\todo specify screen depth */ /**\todo specify screen depth */
SA_DisplayID, id, SA_DisplayID, id,
@ -918,19 +920,22 @@ static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
if((args = ReadArgs(template, rarray, NULL))) { if((args = ReadArgs(template, rarray, NULL))) {
if(rarray[A_URL]) { if(rarray[A_URL]) {
LOG("URL %s specified on command line", NSLOG(netsurf, INFO,
(char *)rarray[A_URL]); "URL %s specified on command line",
(char *)rarray[A_URL]);
temp_homepage_url = strdup((char *)rarray[A_URL]); /**\todo allow IDNs */ temp_homepage_url = strdup((char *)rarray[A_URL]); /**\todo allow IDNs */
} }
if(rarray[A_USERSDIR]) { if(rarray[A_USERSDIR]) {
LOG("USERSDIR %s specified on command line", NSLOG(netsurf, INFO,
(char *)rarray[A_USERSDIR]); "USERSDIR %s specified on command line",
(char *)rarray[A_USERSDIR]);
users_dir = ASPrintf("%s", rarray[A_USERSDIR]); users_dir = ASPrintf("%s", rarray[A_USERSDIR]);
} }
if(rarray[A_FORCE]) { if(rarray[A_FORCE]) {
LOG("FORCE specified on command line"); NSLOG(netsurf, INFO,
"FORCE specified on command line");
cli_force = true; cli_force = true;
} }
@ -950,7 +955,7 @@ static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
*/ */
} }
} else { } else {
LOG("ReadArgs failed to parse command line"); NSLOG(netsurf, INFO, "ReadArgs failed to parse command line");
} }
FreeArgs(args); FreeArgs(args);
@ -2790,7 +2795,9 @@ static void ami_handle_applib(void)
{ {
struct ApplicationCustomMsg *applibcustmsg = struct ApplicationCustomMsg *applibcustmsg =
(struct ApplicationCustomMsg *)applibmsg; (struct ApplicationCustomMsg *)applibmsg;
LOG("Ringhio BackMsg received: %s", applibcustmsg->customMsg); NSLOG(netsurf, INFO,
"Ringhio BackMsg received: %s",
applibcustmsg->customMsg);
ami_download_parse_backmsg(applibcustmsg->customMsg); ami_download_parse_backmsg(applibcustmsg->customMsg);
} }
@ -2826,7 +2833,7 @@ void ami_get_msg(void)
NULL, (unsigned int *)&signalmask) != -1) { NULL, (unsigned int *)&signalmask) != -1) {
signal = signalmask; signal = signalmask;
} else { } else {
LOG("waitselect() returned error"); NSLOG(netsurf, INFO, "waitselect() returned error");
/* \todo Fix Ctrl-C handling. /* \todo Fix Ctrl-C handling.
* WaitSelect() from bsdsocket.library returns -1 if the task was * WaitSelect() from bsdsocket.library returns -1 if the task was
* signalled with a Ctrl-C. waitselect() from newlib.library does not. * signalled with a Ctrl-C. waitselect() from newlib.library does not.
@ -3035,11 +3042,13 @@ static void ami_gui_close_screen(struct Screen *scrn, BOOL locked_screen, BOOL d
if(donotwait == TRUE) return; if(donotwait == TRUE) return;
ULONG scrnsig = 1 << screen_signal; ULONG scrnsig = 1 << screen_signal;
LOG("Waiting for visitor windows to close... (signal)"); NSLOG(netsurf, INFO,
"Waiting for visitor windows to close... (signal)");
Wait(scrnsig); Wait(scrnsig);
while (CloseScreen(scrn) == FALSE) { while (CloseScreen(scrn) == FALSE) {
LOG("Waiting for visitor windows to close... (polling)"); NSLOG(netsurf, INFO,
"Waiting for visitor windows to close... (polling)");
Delay(50); Delay(50);
} }
@ -3081,11 +3090,11 @@ static void gui_quit(void)
ami_font_fini(); ami_font_fini();
ami_help_free(); ami_help_free();
LOG("Freeing menu items"); NSLOG(netsurf, INFO, "Freeing menu items");
ami_ctxmenu_free(); ami_ctxmenu_free();
ami_menu_free_glyphs(); ami_menu_free_glyphs();
LOG("Freeing mouse pointers"); NSLOG(netsurf, INFO, "Freeing mouse pointers");
ami_mouse_pointers_free(); ami_mouse_pointers_free();
ami_file_req_free(); ami_file_req_free();
@ -3099,7 +3108,7 @@ static void gui_quit(void)
ami_clipboard_free(); ami_clipboard_free();
ami_gui_resources_free(); ami_gui_resources_free();
LOG("Closing screen"); NSLOG(netsurf, INFO, "Closing screen");
ami_gui_close_screen(scrn, locked_screen, FALSE); ami_gui_close_screen(scrn, locked_screen, FALSE);
if(nsscreentitle) FreeVec(nsscreentitle); if(nsscreentitle) FreeVec(nsscreentitle);
} }
@ -3109,7 +3118,7 @@ char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail)
STRPTR filename = NULL; STRPTR filename = NULL;
if ((filename = ASPrintf("%s/%x", current_user_faviconcache, nsurl_hash(url)))) { if ((filename = ASPrintf("%s/%x", current_user_faviconcache, nsurl_hash(url)))) {
LOG("favicon cache location: %s", filename); NSLOG(netsurf, INFO, "favicon cache location: %s", filename);
if (only_if_avail == true) { if (only_if_avail == true) {
BPTR lock = 0; BPTR lock = 0;
@ -3723,7 +3732,8 @@ static nserror amiga_window_invalidate_area(struct gui_window *g,
nsobj = AddObject(g->deferred_rects, AMINS_RECT); nsobj = AddObject(g->deferred_rects, AMINS_RECT);
nsobj->objstruct = deferred_rect; nsobj->objstruct = deferred_rect;
} else { } else {
LOG("Ignoring duplicate or subset of queued box redraw"); NSLOG(netsurf, INFO,
"Ignoring duplicate or subset of queued box redraw");
} }
} }
ami_schedule_redraw(g->shared, false); ami_schedule_redraw(g->shared, false);
@ -3912,7 +3922,7 @@ gui_window_create(struct browser_window *bw,
ULONG defer_layout = TRUE; ULONG defer_layout = TRUE;
ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY; ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY;
LOG("Creating window"); NSLOG(netsurf, INFO, "Creating window");
if (!scrn) ami_openscreenfirst(); if (!scrn) ami_openscreenfirst();
@ -4056,7 +4066,7 @@ gui_window_create(struct browser_window *bw,
(strcmp(nsoption_charp(pubscreen_name), "Workbench") == 0)) (strcmp(nsoption_charp(pubscreen_name), "Workbench") == 0))
iconifygadget = TRUE; iconifygadget = TRUE;
LOG("Creating menu"); NSLOG(netsurf, INFO, "Creating menu");
struct Menu *menu = ami_gui_menu_create(g->shared); struct Menu *menu = ami_gui_menu_create(g->shared);
NewList(&g->shared->tab_list); NewList(&g->shared->tab_list);
@ -4178,7 +4188,7 @@ gui_window_create(struct browser_window *bw,
BitMapEnd; BitMapEnd;
} }
LOG("Creating window object"); NSLOG(netsurf, INFO, "Creating window object");
g->shared->objects[OID_MAIN] = WindowObj, g->shared->objects[OID_MAIN] = WindowObj,
WA_ScreenTitle, ami_gui_get_screen_title(), WA_ScreenTitle, ami_gui_get_screen_title(),
@ -4456,11 +4466,11 @@ gui_window_create(struct browser_window *bw,
EndWindow; EndWindow;
} }
LOG("Opening window"); NSLOG(netsurf, INFO, "Opening window");
g->shared->win = (struct Window *)RA_OpenWindow(g->shared->objects[OID_MAIN]); g->shared->win = (struct Window *)RA_OpenWindow(g->shared->objects[OID_MAIN]);
LOG("Window opened, adding border gadgets"); NSLOG(netsurf, INFO, "Window opened, adding border gadgets");
if(!g->shared->win) if(!g->shared->win)
{ {
@ -4796,7 +4806,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
if(draw == true) { if(draw == true) {
ami_set_pointer(g->shared, GUI_POINTER_WAIT, false); ami_set_pointer(g->shared, GUI_POINTER_WAIT, false);
} else { } else {
LOG("Ignoring deferred box redraw queue"); NSLOG(netsurf, INFO, "Ignoring deferred box redraw queue");
} }
node = (struct nsObject *)GetHead((struct List *)g->deferred_rects); node = (struct nsObject *)GetHead((struct List *)g->deferred_rects);
@ -4841,7 +4851,8 @@ bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects,
(new_rect->y0 <= rect->y0) && (new_rect->y0 <= rect->y0) &&
(new_rect->x1 >= rect->x1) && (new_rect->x1 >= rect->x1) &&
(new_rect->y1 >= rect->y1)) { (new_rect->y1 >= rect->y1)) {
LOG("Removing queued redraw that is a subset of new box redraw"); NSLOG(netsurf, INFO,
"Removing queued redraw that is a subset of new box redraw");
ami_memory_itempool_free(mempool, node->objstruct, sizeof(struct rect)); ami_memory_itempool_free(mempool, node->objstruct, sizeof(struct rect));
DelObjectNoFree(node); DelObjectNoFree(node);
/* Don't return - we might find more */ /* Don't return - we might find more */
@ -5414,20 +5425,20 @@ Object *ami_gui_splash_open(void)
EndWindow; EndWindow;
if(win_obj == NULL) { if(win_obj == NULL) {
LOG("Splash window object not created"); NSLOG(netsurf, INFO, "Splash window object not created");
return NULL; return NULL;
} }
LOG("Attempting to open splash window..."); NSLOG(netsurf, INFO, "Attempting to open splash window...");
win = RA_OpenWindow(win_obj); win = RA_OpenWindow(win_obj);
if(win == NULL) { if(win == NULL) {
LOG("Splash window did not open"); NSLOG(netsurf, INFO, "Splash window did not open");
return NULL; return NULL;
} }
if(bm_obj == NULL) { if(bm_obj == NULL) {
LOG("BitMap object not created"); NSLOG(netsurf, INFO, "BitMap object not created");
return NULL; return NULL;
} }
@ -5489,14 +5500,14 @@ void ami_gui_splash_close(Object *win_obj)
{ {
if(win_obj == NULL) return; if(win_obj == NULL) return;
LOG("Closing splash window"); NSLOG(netsurf, INFO, "Closing splash window");
DisposeObject(win_obj); DisposeObject(win_obj);
} }
static void gui_file_gadget_open(struct gui_window *g, struct hlcache_handle *hl, static void gui_file_gadget_open(struct gui_window *g, struct hlcache_handle *hl,
struct form_control *gadget) struct form_control *gadget)
{ {
LOG("File open dialog request for %p/%p", g, gadget); NSLOG(netsurf, INFO, "File open dialog request for %p/%p", g, gadget);
if(AslRequestTags(filereq, if(AslRequestTags(filereq,
ASLFR_Window, g->shared->win, ASLFR_Window, g->shared->win,
@ -5531,7 +5542,7 @@ static char *ami_gui_get_user_dir(STRPTR current_user)
user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY); user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY);
current_user = ASPrintf("%s", (user == -1) ? "Default" : temp); current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
} }
LOG("User: %s", current_user); NSLOG(netsurf, INFO, "User: %s", current_user);
if(users_dir == NULL) { if(users_dir == NULL) {
users_dir = ASPrintf("%s", USERS_DIR); users_dir = ASPrintf("%s", USERS_DIR);
@ -5583,7 +5594,7 @@ static char *ami_gui_get_user_dir(STRPTR current_user)
FreeVec(users_dir); FreeVec(users_dir);
FreeVec(current_user); FreeVec(current_user);
LOG("User dir: %s", current_user_dir); NSLOG(netsurf, INFO, "User dir: %s", current_user_dir);
if((lock = CreateDirTree(current_user_dir))) if((lock = CreateDirTree(current_user_dir)))
UnLock(lock); UnLock(lock);
@ -5810,7 +5821,7 @@ int main(int argc, char** argv)
AddPart(script, nsoption_charp(arexx_startup), 1024); AddPart(script, nsoption_charp(arexx_startup), 1024);
ami_arexx_execute(script); ami_arexx_execute(script);
LOG("Entering main loop"); NSLOG(netsurf, INFO, "Entering main loop");
while (!ami_quit) { while (!ami_quit) {
ami_get_msg(); ami_get_msg();

View File

@ -584,7 +584,8 @@ ULONG ami_gui_menu_number(int item)
break; break;
default: default:
LOG("WARNING: Unrecognised menu item %d", item); NSLOG(netsurf, INFO,
"WARNING: Unrecognised menu item %d", item);
menu_num = 0; menu_num = 0;
break; break;
} }

View File

@ -438,7 +438,7 @@ nserror ami_history_global_present(void)
res = ami_history_global_create_window(ncwin); res = ami_history_global_create_window(ncwin);
if (res != NSERROR_OK) { if (res != NSERROR_OK) {
LOG("SSL UI builder init failed"); NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle); ami_utf8_free(ncwin->core.wintitle);
free(ncwin); free(ncwin);
return res; return res;

View File

@ -261,7 +261,7 @@ nserror ami_history_local_present(struct gui_window *gw)
res = ami_history_local_create_window(ncwin); res = ami_history_local_create_window(ncwin);
if (res != NSERROR_OK) { if (res != NSERROR_OK) {
LOG("SSL UI builder init failed"); NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle); ami_utf8_free(ncwin->core.wintitle);
free(ncwin); free(ncwin);
return res; return res;

View File

@ -563,7 +563,7 @@ nserror ami_hotlist_present(void)
res = ami_hotlist_create_window(ncwin); res = ami_hotlist_create_window(ncwin);
if (res != NSERROR_OK) { if (res != NSERROR_OK) {
LOG("SSL UI builder init failed"); NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle); ami_utf8_free(ncwin->core.wintitle);
free(ncwin); free(ncwin);
return res; return res;

View File

@ -50,23 +50,38 @@ void *ami_memory_clear_alloc(size_t size, UBYTE value)
static int ami_memory_slab_usage_cb(const struct __slab_usage_information * sui) static int ami_memory_slab_usage_cb(const struct __slab_usage_information * sui)
{ {
if(sui->sui_slab_index <= 1) { if(sui->sui_slab_index <= 1) {
LOG("clib2 slab usage:"); NSLOG(netsurf, INFO, "clib2 slab usage:");
LOG(" The size of all slabs, in bytes: %ld", sui->sui_slab_size); NSLOG(netsurf, INFO,
LOG(" Number of allocations which are not managed by slabs: %ld", " The size of all slabs, in bytes: %ld",
sui->sui_num_single_allocations); sui->sui_slab_size);
LOG(" Total number of bytes allocated for memory not managed by slabs: %ld", NSLOG(netsurf, INFO,
sui->sui_total_single_allocation_size); " Number of allocations which are not managed by slabs: %ld",
LOG(" Number of slabs currently in play: %ld", sui->sui_num_slabs); sui->sui_num_single_allocations);
LOG(" Number of currently unused slabs: %ld", sui->sui_num_empty_slabs); NSLOG(netsurf, INFO,
LOG(" Number of slabs in use which are completely filled with data: %ld", " Total number of bytes allocated for memory not managed by slabs: %ld",
sui->sui_num_full_slabs); sui->sui_total_single_allocation_size);
LOG(" Total number of bytes allocated for all slabs: %ld", NSLOG(netsurf, INFO,
sui->sui_total_slab_allocation_size); " Number of slabs currently in play: %ld",
sui->sui_num_slabs);
NSLOG(netsurf, INFO,
" Number of currently unused slabs: %ld",
sui->sui_num_empty_slabs);
NSLOG(netsurf, INFO,
" Number of slabs in use which are completely filled with data: %ld",
sui->sui_num_full_slabs);
NSLOG(netsurf, INFO,
" Total number of bytes allocated for all slabs: %ld",
sui->sui_total_slab_allocation_size);
} }
LOG("Slab %d", sui->sui_slab_index); NSLOG(netsurf, INFO, "Slab %d", sui->sui_slab_index);
LOG(" Memory chunk size managed by this slab: %ld", sui->sui_chunk_size); NSLOG(netsurf, INFO, " Memory chunk size managed by this slab: %ld",
LOG(" Number of memory chunks that fit in this slab: %ld", sui->sui_num_chunks); sui->sui_chunk_size);
LOG(" Number of memory chunks used in this slab: %ld", sui->sui_num_chunks_used); NSLOG(netsurf, INFO,
" Number of memory chunks that fit in this slab: %ld",
sui->sui_num_chunks);
NSLOG(netsurf, INFO,
" Number of memory chunks used in this slab: %ld",
sui->sui_num_chunks_used);
return 0; return 0;
} }
@ -74,16 +89,20 @@ static int ami_memory_slab_usage_cb(const struct __slab_usage_information * sui)
static int ami_memory_slab_alloc_cb(const struct __slab_allocation_information *sai) static int ami_memory_slab_alloc_cb(const struct __slab_allocation_information *sai)
{ {
if(sai->sai_allocation_index <= 1) { if(sai->sai_allocation_index <= 1) {
LOG("clib2 allocation usage:"); NSLOG(netsurf, INFO, "clib2 allocation usage:");
LOG(" Number of allocations which are not managed by slabs: %ld", NSLOG(netsurf, INFO,
sai->sai_num_single_allocations); " Number of allocations which are not managed by slabs: %ld",
LOG(" Total number of bytes allocated for memory not managed by slabs: %ld", sai->sai_num_single_allocations);
sai->sai_total_single_allocation_size); NSLOG(netsurf, INFO,
" Total number of bytes allocated for memory not managed by slabs: %ld",
sai->sai_total_single_allocation_size);
} }
LOG("Alloc %d", sai->sai_allocation_index); NSLOG(netsurf, INFO, "Alloc %d", sai->sai_allocation_index);
LOG(" Size of this allocation, as requested: %ld", sai->sai_allocation_size); NSLOG(netsurf, INFO, " Size of this allocation, as requested: %ld",
LOG(" Total size of this allocation, including management data: %ld", sai->sai_allocation_size);
sai->sai_total_allocation_size); NSLOG(netsurf, INFO,
" Total size of this allocation, including management data: %ld",
sai->sai_total_allocation_size);
return 0; return 0;
} }
@ -111,13 +130,13 @@ void ami_memory_slab_dump(BPTR fh)
static void ami_memory_low_mem_handler(void *p) static void ami_memory_low_mem_handler(void *p)
{ {
if(low_mem_status == PURGE_STEP1) { if(low_mem_status == PURGE_STEP1) {
LOG("Purging llcache"); NSLOG(netsurf, INFO, "Purging llcache");
llcache_clean(true); llcache_clean(true);
low_mem_status = PURGE_DONE_STEP1; low_mem_status = PURGE_DONE_STEP1;
} }
if(low_mem_status == PURGE_STEP2) { if(low_mem_status == PURGE_STEP2) {
LOG("Purging unused slabs"); NSLOG(netsurf, INFO, "Purging unused slabs");
__free_unused_slabs(); __free_unused_slabs();
low_mem_status = PURGE_DONE_STEP2; low_mem_status = PURGE_DONE_STEP2;
} }

View File

@ -46,7 +46,7 @@ static LONG ami_misc_req(const char *message, uint32 type)
{ {
LONG ret = 0; LONG ret = 0;
LOG("%s", message); NSLOG(netsurf, INFO, "%s", message);
#ifdef __amigaos4__ #ifdef __amigaos4__
ret = TimedDosRequesterTags( ret = TimedDosRequesterTags(
TDR_TitleString, messages_get("NetSurf"), TDR_TitleString, messages_get("NetSurf"),

View File

@ -216,13 +216,13 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
fh = Open(fontpath, MODE_OLDFILE); fh = Open(fontpath, MODE_OLDFILE);
if(fh == 0) { if(fh == 0) {
LOG("Unable to open FONT %s", fontpath); NSLOG(netsurf, INFO, "Unable to open FONT %s", fontpath);
FreeVec(fontpath); FreeVec(fontpath);
return NULL; return NULL;
} }
if(Read(fh, &fch, sizeof(struct FontContentsHeader)) != sizeof(struct FontContentsHeader)) { if(Read(fh, &fch, sizeof(struct FontContentsHeader)) != sizeof(struct FontContentsHeader)) {
LOG("Unable to read FONT %s", fontpath); NSLOG(netsurf, INFO, "Unable to read FONT %s", fontpath);
FreeVec(fontpath); FreeVec(fontpath);
Close(fh); Close(fh);
return NULL; return NULL;
@ -231,7 +231,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
Close(fh); Close(fh);
if(fch.fch_FileID != OFCH_ID) { if(fch.fch_FileID != OFCH_ID) {
LOG("%s is not an outline font!", fontpath); NSLOG(netsurf, INFO, "%s is not an outline font!", fontpath);
FreeVec(fontpath); FreeVec(fontpath);
return NULL; return NULL;
} }
@ -242,7 +242,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
if(p) *p = '.'; if(p) *p = '.';
if(fh == 0) { if(fh == 0) {
LOG("Unable to open OTAG %s", otagpath); NSLOG(netsurf, INFO, "Unable to open OTAG %s", otagpath);
FreeVec(otagpath); FreeVec(otagpath);
return NULL; return NULL;
} }
@ -250,7 +250,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
size = GetFileSize(fh); size = GetFileSize(fh);
buffer = (UBYTE *)malloc(size); buffer = (UBYTE *)malloc(size);
if(buffer == NULL) { if(buffer == NULL) {
LOG("Unable to allocate memory"); NSLOG(netsurf, INFO, "Unable to allocate memory");
Close(fh); Close(fh);
FreeVec(otagpath); FreeVec(otagpath);
return NULL; return NULL;
@ -262,7 +262,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
/* The first tag is supposed to be OT_FileIdent and should equal 'size' */ /* The first tag is supposed to be OT_FileIdent and should equal 'size' */
struct TagItem *tag = (struct TagItem *)buffer; struct TagItem *tag = (struct TagItem *)buffer;
if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) { if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) {
LOG("Invalid OTAG file"); NSLOG(netsurf, INFO, "Invalid OTAG file");
free(buffer); free(buffer);
FreeVec(otagpath); FreeVec(otagpath);
return NULL; return NULL;
@ -277,10 +277,10 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
/* Find OT_Engine and open the font engine */ /* Find OT_Engine and open the font engine */
if(ti = FindTagItem(OT_Engine, buffer)) { if(ti = FindTagItem(OT_Engine, buffer)) {
LOG("Using font engine %s", ti->ti_Data); NSLOG(netsurf, INFO, "Using font engine %s", ti->ti_Data);
fname = ASPrintf("%s.library", ti->ti_Data); fname = ASPrintf("%s.library", ti->ti_Data);
} else { } else {
LOG("Cannot find OT_Engine tag"); NSLOG(netsurf, INFO, "Cannot find OT_Engine tag");
free(buffer); free(buffer);
FreeVec(otagpath); FreeVec(otagpath);
return NULL; return NULL;
@ -289,7 +289,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
BulletBase = (struct BulletBase *)OpenLibrary(fname, 0L); BulletBase = (struct BulletBase *)OpenLibrary(fname, 0L);
if(BulletBase == NULL) { if(BulletBase == NULL) {
LOG("Unable to open font engine %s", fname); NSLOG(netsurf, INFO, "Unable to open font engine %s", fname);
free(buffer); free(buffer);
FreeVec(fname); FreeVec(fname);
FreeVec(otagpath); FreeVec(otagpath);

View File

@ -131,7 +131,7 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit
struct gui_globals *gg = malloc(sizeof(struct gui_globals)); struct gui_globals *gg = malloc(sizeof(struct gui_globals));
if(force32bit == false) depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH); if(force32bit == false) depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
LOG("Screen depth = %d", depth); NSLOG(netsurf, INFO, "Screen depth = %d", depth);
#ifdef __amigaos4__ #ifdef __amigaos4__
if(depth < 16) { if(depth < 16) {
@ -241,7 +241,8 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit
gg->open_num = -1; gg->open_num = -1;
init_layers_count++; init_layers_count++;
LOG("Layer initialised (total: %d)", init_layers_count); NSLOG(netsurf, INFO, "Layer initialised (total: %d)",
init_layers_count);
return gg; return gg;
} }
@ -328,7 +329,8 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
(colr & 0x00ff0000) << 8, (colr & 0x00ff0000) << 8,
NULL); NULL);
if(pen == -1) LOG("WARNING: Cannot allocate pen for ABGR:%lx", colr); if(pen == -1) NSLOG(netsurf, INFO,
"WARNING: Cannot allocate pen for ABGR:%lx", colr);
if((shared_pens != NULL) && (pool_pens != NULL)) { if((shared_pens != NULL) && (pool_pens != NULL)) {
if((node = (struct ami_plot_pen *)ami_memory_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) { if((node = (struct ami_plot_pen *)ami_memory_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) {
@ -849,17 +851,17 @@ ami_polygon(const struct redraw_context *ctx,
ami_plot_setapen(glob, glob->rp, style->fill_colour); ami_plot_setapen(glob, glob->rp, style->fill_colour);
if (AreaMove(glob->rp,p[0],p[1]) == -1) { if (AreaMove(glob->rp,p[0],p[1]) == -1) {
LOG("AreaMove: vector list full"); NSLOG(netsurf, INFO, "AreaMove: vector list full");
} }
for (uint32 k = 1; k < n; k++) { for (uint32 k = 1; k < n; k++) {
if (AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1) { if (AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1) {
LOG("AreaDraw: vector list full"); NSLOG(netsurf, INFO, "AreaDraw: vector list full");
} }
} }
if (AreaEnd(glob->rp) == -1) { if (AreaEnd(glob->rp) == -1) {
LOG("AreaEnd: error"); NSLOG(netsurf, INFO, "AreaEnd: error");
} }
return NSERROR_OK; return NSERROR_OK;
@ -900,7 +902,7 @@ ami_path(const struct redraw_context *ctx,
} }
if (p[0] != PLOTTER_PATH_MOVE) { if (p[0] != PLOTTER_PATH_MOVE) {
LOG("Path does not start with move"); NSLOG(netsurf, INFO, "Path does not start with move");
return NSERROR_INVALID; return NSERROR_INVALID;
} }
@ -922,7 +924,8 @@ ami_path(const struct redraw_context *ctx,
if (p[i] == PLOTTER_PATH_MOVE) { if (p[i] == PLOTTER_PATH_MOVE) {
if (pstyle->fill_colour != NS_TRANSPARENT) { if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaMove(glob->rp, p[i+1], p[i+2]) == -1) { if (AreaMove(glob->rp, p[i+1], p[i+2]) == -1) {
LOG("AreaMove: vector list full"); NSLOG(netsurf, INFO,
"AreaMove: vector list full");
} }
} else { } else {
Move(glob->rp, p[i+1], p[i+2]); Move(glob->rp, p[i+1], p[i+2]);
@ -936,7 +939,7 @@ ami_path(const struct redraw_context *ctx,
} else if (p[i] == PLOTTER_PATH_CLOSE) { } else if (p[i] == PLOTTER_PATH_CLOSE) {
if (pstyle->fill_colour != NS_TRANSPARENT) { if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaEnd(glob->rp) == -1) { if (AreaEnd(glob->rp) == -1) {
LOG("AreaEnd: error"); NSLOG(netsurf, INFO, "AreaEnd: error");
} }
} else { } else {
Draw(glob->rp, start_p.x, start_p.y); Draw(glob->rp, start_p.x, start_p.y);
@ -945,7 +948,8 @@ ami_path(const struct redraw_context *ctx,
} else if (p[i] == PLOTTER_PATH_LINE) { } else if (p[i] == PLOTTER_PATH_LINE) {
if (pstyle->fill_colour != NS_TRANSPARENT) { if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaDraw(glob->rp, p[i+1], p[i+2]) == -1) { if (AreaDraw(glob->rp, p[i+1], p[i+2]) == -1) {
LOG("AreaDraw: vector list full"); NSLOG(netsurf, INFO,
"AreaDraw: vector list full");
} }
} else { } else {
Draw(glob->rp, p[i+1], p[i+2]); Draw(glob->rp, p[i+1], p[i+2]);
@ -965,7 +969,8 @@ ami_path(const struct redraw_context *ctx,
ami_bezier(&cur_p, &p_a, &p_b, &p_c, t, &p_r); ami_bezier(&cur_p, &p_a, &p_b, &p_c, t, &p_r);
if (pstyle->fill_colour != NS_TRANSPARENT) { if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaDraw(glob->rp, p_r.x, p_r.y) == -1) { if (AreaDraw(glob->rp, p_r.x, p_r.y) == -1) {
LOG("AreaDraw: vector list full"); NSLOG(netsurf, INFO,
"AreaDraw: vector list full");
} }
} else { } else {
Draw(glob->rp, p_r.x, p_r.y); Draw(glob->rp, p_r.x, p_r.y);
@ -975,7 +980,7 @@ ami_path(const struct redraw_context *ctx,
cur_p.y = p_c.y; cur_p.y = p_c.y;
i += 7; i += 7;
} else { } else {
LOG("bad path command %f", p[i]); NSLOG(netsurf, INFO, "bad path command %f", p[i]);
/* End path for safety if using Area commands */ /* End path for safety if using Area commands */
if (pstyle->fill_colour != NS_TRANSPARENT) { if (pstyle->fill_colour != NS_TRANSPARENT) {
AreaEnd(glob->rp); AreaEnd(glob->rp);

View File

@ -82,7 +82,8 @@ nserror amiga_plugin_hack_init(void)
if(node) if(node)
{ {
LOG("plugin_hack registered %s", lwc_string_data(type)); NSLOG(netsurf, INFO, "plugin_hack registered %s",
lwc_string_data(type));
error = content_factory_register_handler( error = content_factory_register_handler(
lwc_string_data(type), lwc_string_data(type),
@ -123,7 +124,7 @@ nserror amiga_plugin_hack_create(const content_handler *handler,
bool amiga_plugin_hack_convert(struct content *c) bool amiga_plugin_hack_convert(struct content *c)
{ {
LOG("amiga_plugin_hack_convert"); NSLOG(netsurf, INFO, "amiga_plugin_hack_convert");
content_set_ready(c); content_set_ready(c);
content_set_done(c); content_set_done(c);
@ -137,7 +138,7 @@ void amiga_plugin_hack_destroy(struct content *c)
{ {
amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c; amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c;
LOG("amiga_plugin_hack_destroy %p", plugin); NSLOG(netsurf, INFO, "amiga_plugin_hack_destroy %p", plugin);
return; return;
} }
@ -155,7 +156,7 @@ bool amiga_plugin_hack_redraw(struct content *c,
struct rect rect; struct rect rect;
nserror res; nserror res;
LOG("amiga_plugin_hack_redraw"); NSLOG(netsurf, INFO, "amiga_plugin_hack_redraw");
rect.x0 = data->x; rect.x0 = data->x;
rect.y0 = data->y; rect.y0 = data->y;
@ -187,7 +188,8 @@ bool amiga_plugin_hack_redraw(struct content *c,
void amiga_plugin_hack_open(struct content *c, struct browser_window *bw, void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
struct content *page, struct object_params *params) struct content *page, struct object_params *params)
{ {
LOG("amiga_plugin_hack_open %s", nsurl_access(content_get_url(c))); NSLOG(netsurf, INFO, "amiga_plugin_hack_open %s",
nsurl_access(content_get_url(c)));
if(c) if(c)
{ {
@ -201,13 +203,13 @@ void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
void amiga_plugin_hack_close(struct content *c) void amiga_plugin_hack_close(struct content *c)
{ {
LOG("amiga_plugin_hack_close"); NSLOG(netsurf, INFO, "amiga_plugin_hack_close");
return; return;
} }
void amiga_plugin_hack_reformat(struct content *c, int width, int height) void amiga_plugin_hack_reformat(struct content *c, int width, int height)
{ {
LOG("amiga_plugin_hack_reformat"); NSLOG(netsurf, INFO, "amiga_plugin_hack_reformat");
c->width = width; c->width = width;
c->height = height; c->height = height;
@ -220,7 +222,7 @@ nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc
amiga_plugin_hack_content *plugin; amiga_plugin_hack_content *plugin;
nserror error; nserror error;
LOG("amiga_plugin_hack_clone"); NSLOG(netsurf, INFO, "amiga_plugin_hack_clone");
plugin = calloc(1, sizeof(amiga_plugin_hack_content)); plugin = calloc(1, sizeof(amiga_plugin_hack_content));
if (plugin == NULL) if (plugin == NULL)
@ -267,7 +269,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
if(full_cmd) if(full_cmd)
{ {
#ifdef __amigaos4__ #ifdef __amigaos4__
LOG("Attempting to execute %s", full_cmd); NSLOG(netsurf, INFO, "Attempting to execute %s", full_cmd);
in = Open("NIL:", MODE_OLDFILE); in = Open("NIL:", MODE_OLDFILE);
out = Open("NIL:", MODE_NEWFILE); out = Open("NIL:", MODE_NEWFILE);

View File

@ -218,9 +218,10 @@ static void ami_schedule_dump(void)
GetSysTime(&tv); GetSysTime(&tv);
Amiga2Date(tv.Seconds, &clockdata); Amiga2Date(tv.Seconds, &clockdata);
LOG("Current time = %d-%d-%d %d:%d:%d.%d", clockdata.mday, clockdata.month, clockdata.year, NSLOG(netsurf, INFO, "Current time = %d-%d-%d %d:%d:%d.%d",
clockdata.hour, clockdata.min, clockdata.sec, tv.Microseconds); clockdata.mday, clockdata.month, clockdata.year,
LOG("Events remaining in queue:"); clockdata.hour, clockdata.min, clockdata.sec, tv.Microseconds);
NSLOG(netsurf, INFO, "Events remaining in queue:");
iterator = pblHeapIterator(schedule_list); iterator = pblHeapIterator(schedule_list);
@ -231,9 +232,9 @@ static void ami_schedule_dump(void)
nscb, clockdata.mday, clockdata.month, clockdata.year, clockdata.hour, clockdata.min, clockdata.sec, nscb, clockdata.mday, clockdata.month, clockdata.year, clockdata.hour, clockdata.min, clockdata.sec,
nscb->tv.Microseconds, nscb->callback, nscb->p); nscb->tv.Microseconds, nscb->callback, nscb->p);
if(CheckIO((struct IORequest *)nscb) == NULL) { if(CheckIO((struct IORequest *)nscb) == NULL) {
LOG("-> ACTIVE"); NSLOG(netsurf, INFO, "-> ACTIVE");
} else { } else {
LOG("-> COMPLETE"); NSLOG(netsurf, INFO, "-> COMPLETE");
} }
}; };

View File

@ -58,7 +58,8 @@ BOOL ami_selectmenu_is_safe(void)
BOOL popupmenu_lib_ok = FALSE; BOOL popupmenu_lib_ok = FALSE;
if((PopupMenuBase = OpenLibrary("popupmenu.library", 53))) { if((PopupMenuBase = OpenLibrary("popupmenu.library", 53))) {
LOG("popupmenu.library v%d.%d", PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision); NSLOG(netsurf, INFO, "popupmenu.library v%d.%d",
PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision);
if(LIB_IS_AT_LEAST((struct Library *)PopupMenuBase, 53, 11)) if(LIB_IS_AT_LEAST((struct Library *)PopupMenuBase, 53, 11))
popupmenu_lib_ok = TRUE; popupmenu_lib_ok = TRUE;
CloseLibrary(PopupMenuBase); CloseLibrary(PopupMenuBase);

View File

@ -317,7 +317,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = ami_crtvrfy_create_window(ncwin); res = ami_crtvrfy_create_window(ncwin);
if (res != NSERROR_OK) { if (res != NSERROR_OK) {
LOG("SSL UI builder init failed"); NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle); ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr); ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept); ami_utf8_free(ncwin->sslaccept);

View File

@ -81,7 +81,9 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns
{ {
struct bitmap * bitmap; struct bitmap * bitmap;
LOG("width %d (rowstride: %d, bpp: %d), height %d, state %u", w, rowstride, bpp, h, state); NSLOG(netsurf, INFO,
"width %d (rowstride: %d, bpp: %d), height %d, state %u", w,
rowstride, bpp, h, state);
if( rowstride == 0) { if( rowstride == 0) {
rowstride = bpp * w; rowstride = bpp * w;
@ -107,10 +109,10 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns
} else { } else {
free(bitmap); free(bitmap);
bitmap=NULL; bitmap=NULL;
LOG("Out of memory!"); NSLOG(netsurf, INFO, "Out of memory!");
} }
} }
LOG("bitmap %p", bitmap); NSLOG(netsurf, INFO, "bitmap %p", bitmap);
return bitmap; return bitmap;
} }
@ -194,7 +196,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return NULL; return NULL;
} }
@ -218,7 +220,7 @@ size_t atari_bitmap_get_rowstride(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return 0; return 0;
} }
return bm->rowstride; return bm->rowstride;
@ -231,7 +233,7 @@ void atari_bitmap_destroy(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return; return;
} }
@ -272,11 +274,12 @@ static void bitmap_set_opaque(void *bitmap, bool opaque)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return; return;
} }
LOG("setting bitmap %p to %s", bm, opaque ? "opaque" : "transparent"); NSLOG(netsurf, INFO, "setting bitmap %p to %s", bm,
opaque ? "opaque" : "transparent");
bm->opaque = opaque; bm->opaque = opaque;
} }
@ -293,7 +296,7 @@ static bool bitmap_test_opaque(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return false; return false;
} }
@ -305,11 +308,12 @@ static bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) { while (tst-- > 0) {
if (bm->pixdata[(tst << 2) + 3] != 0xff) { if (bm->pixdata[(tst << 2) + 3] != 0xff) {
LOG("bitmap %p has transparency", bm); NSLOG(netsurf, INFO,
"bitmap %p has transparency", bm);
return false; return false;
} }
} }
LOG("bitmap %p is opaque", bm); NSLOG(netsurf, INFO, "bitmap %p is opaque", bm);
return true; return true;
} }
@ -320,7 +324,7 @@ bool atari_bitmap_get_opaque(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return false; return false;
} }
@ -334,7 +338,7 @@ int atari_bitmap_get_width(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return 0; return 0;
} }
@ -348,7 +352,7 @@ int atari_bitmap_get_height(void *bitmap)
struct bitmap *bm = bitmap; struct bitmap *bm = bitmap;
if (bitmap == NULL) { if (bitmap == NULL) {
LOG("NULL bitmap!"); NSLOG(netsurf, INFO, "NULL bitmap!");
return 0; return 0;
} }
return(bm->height); return(bm->height);

View File

@ -81,7 +81,7 @@ static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
assert(ssl_d); assert(ssl_d);
LOG("cw %p", cw); NSLOG(netsurf, INFO, "cw %p", cw);
return(sslcert_viewer_init(cb_t, cw, ssl_d)); return(sslcert_viewer_init(cb_t, cw, ssl_d));
} }
@ -97,7 +97,7 @@ static void atari_sslcert_viewer_finish(struct core_window *cw)
/* This will also free the session data: */ /* This will also free the session data: */
sslcert_viewer_fini(cvwin->ssl_session_data); sslcert_viewer_fini(cvwin->ssl_session_data);
LOG("cw %p", cw); NSLOG(netsurf, INFO, "cw %p", cw);
} }
static void atari_sslcert_viewer_draw(struct core_window *cw, int x, static void atari_sslcert_viewer_draw(struct core_window *cw, int x,
@ -123,7 +123,7 @@ static void atari_sslcert_viewer_keypress(struct core_window *cw, uint32_t ucs4)
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw); cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
LOG("ucs4: %"PRIu32, ucs4); NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4);
sslcert_viewer_keypress(cvwin->ssl_session_data, ucs4); sslcert_viewer_keypress(cvwin->ssl_session_data, ucs4);
} }
@ -150,14 +150,14 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
short retval = 0; short retval = 0;
OBJECT *toolbar; OBJECT *toolbar;
LOG("win %p", win); NSLOG(netsurf, INFO, "win %p", win);
if(ev_out->emo_events & MU_MESAG){ if(ev_out->emo_events & MU_MESAG){
switch (msg[0]) { switch (msg[0]) {
case WM_TOOLBAR: case WM_TOOLBAR:
toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT); toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
LOG("CERTVIEWER WM_TOOLBAR"); NSLOG(netsurf, INFO, "CERTVIEWER WM_TOOLBAR");
tv = (struct core_window*) gemtk_wm_get_user_data(win); tv = (struct core_window*) gemtk_wm_get_user_data(win);
assert(tv); assert(tv);
cvwin = (struct atari_sslcert_viewer_s *) cvwin = (struct atari_sslcert_viewer_s *)
@ -238,7 +238,7 @@ static void atari_sslcert_viewer_init(struct atari_sslcert_viewer_s * cvwin,
if (cvwin->tv == NULL) { if (cvwin->tv == NULL) {
/* handle it properly, clean up previous allocs */ /* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview"); NSLOG(netsurf, INFO, "Failed to allocate treeview");
return; return;
} }
@ -280,7 +280,7 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
assert(cvwin->init); assert(cvwin->init);
assert(cvwin->window); assert(cvwin->window);
LOG("cvwin %p", cvwin); NSLOG(netsurf, INFO, "cvwin %p", cvwin);
if (atari_treeview_is_open(cvwin->tv)) if (atari_treeview_is_open(cvwin->tv))
atari_treeview_close(cvwin->tv); atari_treeview_close(cvwin->tv);
@ -289,5 +289,5 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
cvwin->window = NULL; cvwin->window = NULL;
atari_treeview_delete(cvwin->tv); atari_treeview_delete(cvwin->tv);
free(cvwin); free(cvwin);
LOG("done"); NSLOG(netsurf, INFO, "done");
} }

View File

@ -63,7 +63,7 @@ static nserror
atari_cookie_manager_init_phase2(struct core_window *cw, atari_cookie_manager_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t) struct core_window_callback_table *cb_t)
{ {
LOG("cw %p",cw); NSLOG(netsurf, INFO, "cw %p", cw);
return(cookie_manager_init(cb_t, cw)); return(cookie_manager_init(cb_t, cw));
} }
@ -71,7 +71,7 @@ atari_cookie_manager_init_phase2(struct core_window *cw,
static void static void
atari_cookie_manager_finish(struct core_window *cw) atari_cookie_manager_finish(struct core_window *cw)
{ {
LOG("cw %p",cw); NSLOG(netsurf, INFO, "cw %p", cw);
cookie_manager_fini(); cookie_manager_fini();
} }
@ -89,7 +89,7 @@ atari_cookie_manager_draw(struct core_window *cw,
static void static void
atari_cookie_manager_keypress(struct core_window *cw, uint32_t ucs4) atari_cookie_manager_keypress(struct core_window *cw, uint32_t ucs4)
{ {
LOG("ucs4: %"PRIu32, ucs4); NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4);
cookie_manager_keypress(ucs4); cookie_manager_keypress(ucs4);
} }
@ -108,13 +108,13 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{ {
short retval = 0; short retval = 0;
LOG("win %p", win); NSLOG(netsurf, INFO, "win %p", win);
if (ev_out->emo_events & MU_MESAG) { if (ev_out->emo_events & MU_MESAG) {
switch (msg[0]) { switch (msg[0]) {
case WM_TOOLBAR: case WM_TOOLBAR:
LOG("WM_TOOLBAR"); NSLOG(netsurf, INFO, "WM_TOOLBAR");
break; break;
case WM_CLOSED: case WM_CLOSED:
@ -158,7 +158,8 @@ void atari_cookie_manager_init(void)
if (atari_cookie_manager.tv == NULL) { if (atari_cookie_manager.tv == NULL) {
/* handle it properly, clean up previous allocs */ /* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview"); NSLOG(netsurf, INFO,
"Failed to allocate treeview");
return; return;
} }
@ -209,7 +210,7 @@ void atari_cookie_manager_destroy(void)
atari_treeview_delete(atari_cookie_manager.tv); atari_treeview_delete(atari_cookie_manager.tv);
atari_cookie_manager.init = false; atari_cookie_manager.init = false;
} }
LOG("done"); NSLOG(netsurf, INFO, "done");
} }

View File

@ -288,7 +288,9 @@ void context_popup(struct gui_window * gw, short x, short y)
/* the GEMDOS cmdline contains the length of the commandline /* the GEMDOS cmdline contains the length of the commandline
in the first byte: */ in the first byte: */
cmdline[0] = (unsigned char)strlen(tempfile); cmdline[0] = (unsigned char)strlen(tempfile);
LOG("Creating temporay source file: %s\n", tempfile); NSLOG(netsurf, INFO,
"Creating temporay source file: %s\n",
tempfile);
fp_tmpfile = fopen(tempfile, "w"); fp_tmpfile = fopen(tempfile, "w");
if (fp_tmpfile != NULL){ if (fp_tmpfile != NULL){
fwrite(data, size, 1, fp_tmpfile); fwrite(data, size, 1, fp_tmpfile);
@ -306,7 +308,8 @@ void context_popup(struct gui_window * gw, short x, short y)
} }
} else { } else {
LOG("Invalid content!"); NSLOG(netsurf, INFO,
"Invalid content!");
} }
} else { } else {
form_alert(0, "[1][Set option \"atari_editor\".][OK]"); form_alert(0, "[1][Set option \"atari_editor\".][OK]");

View File

@ -208,7 +208,7 @@ static void __CDECL menu_new_win(short item, short title, void *data)
nserror error; nserror error;
const char *addr; const char *addr;
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (nsoption_charp(homepage_url) != NULL) { if (nsoption_charp(homepage_url) != NULL) {
addr = nsoption_charp(homepage_url); addr = nsoption_charp(homepage_url);
@ -236,7 +236,7 @@ static void __CDECL menu_open_url(short item, short title, void *data)
{ {
struct gui_window * gw; struct gui_window * gw;
struct browser_window * bw ; struct browser_window * bw ;
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
gw = input_window; gw = input_window;
if( gw == NULL ) { if( gw == NULL ) {
@ -251,7 +251,7 @@ static void __CDECL menu_open_url(short item, short title, void *data)
static void __CDECL menu_open_file(short item, short title, void *data) static void __CDECL menu_open_file(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
const char * filename = file_select(messages_get("OpenFile"), ""); const char * filename = file_select(messages_get("OpenFile"), "");
if( filename != NULL ){ if( filename != NULL ){
@ -280,7 +280,7 @@ static void __CDECL menu_open_file(short item, short title, void *data)
static void __CDECL menu_close_win(short item, short title, void *data) static void __CDECL menu_close_win(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL ) if( input_window == NULL )
return; return;
gui_window_destroy( input_window ); gui_window_destroy( input_window );
@ -288,7 +288,7 @@ static void __CDECL menu_close_win(short item, short title, void *data)
static void __CDECL menu_save_page(short item, short title, void *data) static void __CDECL menu_save_page(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
static bool init = true; static bool init = true;
bool is_folder=false; bool is_folder=false;
const char * path; const char * path;
@ -319,7 +319,7 @@ static void __CDECL menu_quit(short item, short title, void *data)
{ {
short buff[8]; short buff[8];
memset( &buff, 0, sizeof(short)*8 ); memset( &buff, 0, sizeof(short)*8 );
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0); gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
} }
@ -331,21 +331,21 @@ static void __CDECL menu_cut(short item, short title, void *data)
static void __CDECL menu_copy(short item, short title, void *data) static void __CDECL menu_copy(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window != NULL ) if( input_window != NULL )
browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION); browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION);
} }
static void __CDECL menu_paste(short item, short title, void *data) static void __CDECL menu_paste(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window != NULL ) if( input_window != NULL )
browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE); browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE);
} }
static void __CDECL menu_find(short item, short title, void *data) static void __CDECL menu_find(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (input_window != NULL) { if (input_window != NULL) {
if (input_window->search) { if (input_window->search) {
window_close_search(input_window->root); window_close_search(input_window->root);
@ -358,13 +358,13 @@ static void __CDECL menu_find(short item, short title, void *data)
static void __CDECL menu_choices(short item, short title, void *data) static void __CDECL menu_choices(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
open_settings(); open_settings();
} }
static void __CDECL menu_stop(short item, short title, void *data) static void __CDECL menu_stop(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL ) if( input_window == NULL )
return; return;
@ -378,7 +378,7 @@ static void __CDECL menu_reload(short item, short title, void *data)
if(input_window == NULL) if(input_window == NULL)
return; return;
toolbar_reload_click(input_window->root->toolbar); toolbar_reload_click(input_window->root->toolbar);
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
} }
@ -408,7 +408,7 @@ static void __CDECL menu_dec_scale(short item, short title, void *data)
static void __CDECL menu_toolbars(short item, short title, void *data) static void __CDECL menu_toolbars(short item, short title, void *data)
{ {
static int state = 0; static int state = 0;
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window != null && input_window->root->toolbar != null ){ if( input_window != null && input_window->root->toolbar != null ){
state = !state; state = !state;
// TODO: implement toolbar hide // TODO: implement toolbar hide
@ -418,7 +418,7 @@ static void __CDECL menu_toolbars(short item, short title, void *data)
static void __CDECL menu_savewin(short item, short title, void *data) static void __CDECL menu_savewin(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (input_window && input_window->browser) { if (input_window && input_window->browser) {
GRECT rect; GRECT rect;
wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH, wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH,
@ -438,7 +438,7 @@ static void __CDECL menu_savewin(short item, short title, void *data)
static void __CDECL menu_debug_render(short item, short title, void *data) static void __CDECL menu_debug_render(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
html_redraw_debug = !html_redraw_debug; html_redraw_debug = !html_redraw_debug;
if( input_window != NULL ) { if( input_window != NULL ) {
if ( input_window->browser != NULL if ( input_window->browser != NULL
@ -469,7 +469,7 @@ static void __CDECL menu_bg_images(short item, short title, void *data)
static void __CDECL menu_back(short item, short title, void *data) static void __CDECL menu_back(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL ) if( input_window == NULL )
return; return;
toolbar_back_click(input_window->root->toolbar); toolbar_back_click(input_window->root->toolbar);
@ -477,7 +477,7 @@ static void __CDECL menu_back(short item, short title, void *data)
static void __CDECL menu_forward(short item, short title, void *data) static void __CDECL menu_forward(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL ) if( input_window == NULL )
return; return;
toolbar_forward_click(input_window->root->toolbar); toolbar_forward_click(input_window->root->toolbar);
@ -485,7 +485,7 @@ static void __CDECL menu_forward(short item, short title, void *data)
static void __CDECL menu_home(short item, short title, void *data) static void __CDECL menu_home(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL ) if( input_window == NULL )
return; return;
toolbar_home_click(input_window->root->toolbar); toolbar_home_click(input_window->root->toolbar);
@ -493,20 +493,20 @@ static void __CDECL menu_home(short item, short title, void *data)
static void __CDECL menu_lhistory(short item, short title, void *data) static void __CDECL menu_lhistory(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL ) if( input_window == NULL )
return; return;
} }
static void __CDECL menu_ghistory(short item, short title, void *data) static void __CDECL menu_ghistory(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
atari_global_history_open(); atari_global_history_open();
} }
static void __CDECL menu_add_bookmark(short item, short title, void *data) static void __CDECL menu_add_bookmark(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (input_window) { if (input_window) {
if( browser_window_has_content(input_window->browser->bw) ){ if( browser_window_has_content(input_window->browser->bw) ){
atari_hotlist_add_page( atari_hotlist_add_page(
@ -519,26 +519,26 @@ static void __CDECL menu_add_bookmark(short item, short title, void *data)
static void __CDECL menu_bookmarks(short item, short title, void *data) static void __CDECL menu_bookmarks(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
atari_hotlist_open(); atari_hotlist_open();
} }
static void __CDECL menu_cookies(short item, short title, void *data) static void __CDECL menu_cookies(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
atari_cookie_manager_open(); atari_cookie_manager_open();
} }
static void __CDECL menu_vlog(short item, short title, void *data) static void __CDECL menu_vlog(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
verbose_log = !verbose_log; verbose_log = !verbose_log;
menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0); menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0);
} }
static void __CDECL menu_help_content(short item, short title, void *data) static void __CDECL menu_help_content(short item, short title, void *data)
{ {
LOG("%s", __FUNCTION__); NSLOG(netsurf, INFO, "%s", __FUNCTION__);
} }
/* /*
@ -580,14 +580,16 @@ static void register_menu_str( struct s_menu_item_evnt * mi )
while (i > 2) { while (i > 2) {
if ((strncmp(" ", &str[i], 2) == 0) && (strlen(&str[i]) > 2)) { if ((strncmp(" ", &str[i], 2) == 0) && (strlen(&str[i]) > 2)) {
// "Standard" Keyboard Shortcut Element found: // "Standard" Keyboard Shortcut Element found:
LOG("Standard Keyboard Shortcut: \"%s\"\n", &str[i]); NSLOG(netsurf, INFO,
"Standard Keyboard Shortcut: \"%s\"\n", &str[i]);
x = i+2; x = i+2;
is_std_shortcut = true; is_std_shortcut = true;
break; break;
} }
if( str[i] == '['){ if( str[i] == '['){
LOG("Keyboard Shortcut: \"%s\"\n", &str[i]); NSLOG(netsurf, INFO, "Keyboard Shortcut: \"%s\"\n",
&str[i]);
// "Custom" Keyboard Shortcut Element found (identified by [): // "Custom" Keyboard Shortcut Element found (identified by [):
x = i; x = i;
break; break;
@ -662,8 +664,12 @@ static void register_menu_str( struct s_menu_item_evnt * mi )
} }
} }
LOG("Registered keyboard shortcut for \"%s\" => mod: %d, ""keycode: %ld, ascii: %c\n", NSLOG(netsurf, INFO,
str, accel->mod, accel->keycode, accel->ascii); "Registered keyboard shortcut for \"%s\" => mod: %d, ""keycode: %ld, ascii: %c\n",
str,
accel->mod,
accel->keycode,
accel->ascii);
} }
} }

View File

@ -194,7 +194,7 @@ static void on_close(struct gui_download_window * dw)
static void gui_download_window_destroy( struct gui_download_window * gdw) static void gui_download_window_destroy( struct gui_download_window * gdw)
{ {
LOG("gdw %p", gdw); NSLOG(netsurf, INFO, "gdw %p", gdw);
if (gdw->status == NSATARI_DOWNLOAD_WORKING) { if (gdw->status == NSATARI_DOWNLOAD_WORKING) {
download_context_abort(gdw->ctx); download_context_abort(gdw->ctx);
@ -253,7 +253,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
char alert[200]; char alert[200];
LOG("Creating download window for gui window: %p", parent); NSLOG(netsurf, INFO, "Creating download window for gui window: %p",
parent);
/* TODO: Implement real form and use messages file strings! */ /* TODO: Implement real form and use messages file strings! */
@ -330,7 +331,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb); gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb);
strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1); strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
LOG("created download: %s (total size: %d)", gdw->destination, gdw->size_total); NSLOG(netsurf, INFO, "created download: %s (total size: %d)",
gdw->destination, gdw->size_total);
GRECT work, curr; GRECT work, curr;
work.g_x = 0; work.g_x = 0;
@ -357,7 +359,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw,
uint32_t tnow = clck / (CLOCKS_PER_SEC>>3); uint32_t tnow = clck / (CLOCKS_PER_SEC>>3);
uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start; uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start;
LOG("dw %p",dw); NSLOG(netsurf, INFO, "dw %p", dw);
if (dw->abort == true){ if (dw->abort == true){
dw->status = NSATARI_DOWNLOAD_CANCELED; dw->status = NSATARI_DOWNLOAD_CANCELED;
@ -405,7 +407,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw,
static void gui_download_window_error(struct gui_download_window *dw, static void gui_download_window_error(struct gui_download_window *dw,
const char *error_msg) const char *error_msg)
{ {
LOG("%s", error_msg); NSLOG(netsurf, INFO, "%s", error_msg);
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1); strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
dw->status = NSATARI_DOWNLOAD_ERROR; dw->status = NSATARI_DOWNLOAD_ERROR;
@ -416,7 +418,7 @@ static void gui_download_window_error(struct gui_download_window *dw,
static void gui_download_window_done(struct gui_download_window *dw) static void gui_download_window_done(struct gui_download_window *dw)
{ {
LOG("dw %p", dw); NSLOG(netsurf, INFO, "dw %p", dw);
// TODO: change abort to close // TODO: change abort to close
dw->status = NSATARI_DOWNLOAD_COMPLETE; dw->status = NSATARI_DOWNLOAD_COMPLETE;

View File

@ -36,7 +36,7 @@ const char *fetch_filetype(const char *unix_path)
char * res = (char*)"text/html"; char * res = (char*)"text/html";
l = strlen(unix_path); l = strlen(unix_path);
LOG("unix path: %s", unix_path); NSLOG(netsurf, INFO, "unix path: %s", unix_path);
/* This line is added for devlopment versions running from the root dir: */ /* This line is added for devlopment versions running from the root dir: */
if( strchr( unix_path, (int)'.' ) ){ if( strchr( unix_path, (int)'.' ) ){
@ -85,6 +85,6 @@ const char *fetch_filetype(const char *unix_path)
} }
} }
LOG("mime type: %s", res); NSLOG(netsurf, INFO, "mime type: %s", res);
return( res ); return( res );
} }

View File

@ -31,7 +31,7 @@ char * local_file_to_url( const char * filename )
#define BACKSLASH 0x5C #define BACKSLASH 0x5C
char * url; char * url;
LOG("in: %s", filename); NSLOG(netsurf, INFO, "in: %s", filename);
if( strlen(filename) <= 2){ if( strlen(filename) <= 2){
return( NULL ); return( NULL );
@ -55,7 +55,7 @@ char * local_file_to_url( const char * filename )
free(fname_local); free(fname_local);
LOG("out: %s", url); NSLOG(netsurf, INFO, "out: %s", url);
return( url ); return( url );
#undef BACKSLASH #undef BACKSLASH
@ -81,10 +81,10 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
{ {
char *cdir = NULL; char *cdir = NULL;
char t[PATH_MAX]; char t[PATH_MAX];
LOG("%s (def: %s)", filename, def); NSLOG(netsurf, INFO, "%s (def: %s)", filename, def);
strcpy(t, NETSURF_GEM_RESPATH); strcpy(t, NETSURF_GEM_RESPATH);
strcat(t, filename); strcat(t, filename);
LOG("checking %s", (char *)&t); NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) { if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) { if (access(buf, R_OK) == 0) {
return buf; return buf;
@ -92,7 +92,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
} }
strcpy(t, "./"); strcpy(t, "./");
strcat(t, filename); strcat(t, filename);
LOG("checking %s", (char *)&t); NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) { if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) { if (access(buf, R_OK) == 0) {
return buf; return buf;
@ -104,7 +104,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
strcpy(t, cdir); strcpy(t, cdir);
strcat(t, "/.netsurf/"); strcat(t, "/.netsurf/");
strcat(t, filename); strcat(t, filename);
LOG("checking %s", (char *)&t); NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) { if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) if (access(buf, R_OK) == 0)
return buf; return buf;
@ -116,19 +116,19 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
if (gemdos_realpath(cdir, buf) != NULL) { if (gemdos_realpath(cdir, buf) != NULL) {
strcat(buf, "/"); strcat(buf, "/");
strcat(buf, filename); strcat(buf, filename);
LOG("checking %s", (char *)&t); NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (access(buf, R_OK) == 0) if (access(buf, R_OK) == 0)
return buf; return buf;
} }
} }
if (def[0] == '~') { if (def[0] == '~') {
snprintf(t, PATH_MAX, "%s%s", getenv("HOME"), def + 1); snprintf(t, PATH_MAX, "%s%s", getenv("HOME"), def + 1);
LOG("checking %s", (char *)&t); NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) == NULL) { if (gemdos_realpath(t, buf) == NULL) {
strcpy(buf, t); strcpy(buf, t);
} }
} else { } else {
LOG("checking %s", (char *)def); NSLOG(netsurf, INFO, "checking %s", (char *)def);
if (gemdos_realpath(def, buf) == NULL) { if (gemdos_realpath(def, buf) == NULL) {
strcpy(buf, def); strcpy(buf, def);
} }

View File

@ -139,11 +139,11 @@ static void atari_poll(void)
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out); evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) { if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
if( (aes_event_out.emo_events & MU_MESAG) != 0 ) { if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
LOG("WM: %d\n", aes_msg_out[0]); NSLOG(netsurf, INFO, "WM: %d\n", aes_msg_out[0]);
switch(aes_msg_out[0]) { switch(aes_msg_out[0]) {
case MN_SELECTED: case MN_SELECTED:
LOG("Menu Item: %d\n", aes_msg_out[4]); NSLOG(netsurf, INFO, "Menu Item: %d\n", aes_msg_out[4]);
deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]); deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
break; break;
@ -195,13 +195,14 @@ gui_window_create(struct browser_window *bw,
gui_window_create_flags flags) gui_window_create_flags flags)
{ {
struct gui_window *gw=NULL; struct gui_window *gw=NULL;
LOG("gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw, existing, (int)flags); NSLOG(netsurf, INFO, "gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw,
existing, (int)flags);
gw = calloc(1, sizeof(struct gui_window)); gw = calloc(1, sizeof(struct gui_window));
if (gw == NULL) if (gw == NULL)
return NULL; return NULL;
LOG("new window: %p, bw: %p\n", gw, bw); NSLOG(netsurf, INFO, "new window: %p, bw: %p\n", gw, bw);
window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\ window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
|WIDGET_SCROLL); |WIDGET_SCROLL);
if (gw->root->win) { if (gw->root->win) {
@ -253,7 +254,7 @@ void gui_window_destroy(struct gui_window *gw)
if (gw == NULL) if (gw == NULL)
return; return;
LOG("%s\n", __FUNCTION__); NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
if (input_window == gw) { if (input_window == gw) {
gui_set_input_gui_window(NULL); gui_set_input_gui_window(NULL);
@ -444,7 +445,8 @@ gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
return NSERROR_BAD_PARAMETER; return NSERROR_BAD_PARAMETER;
} }
LOG("scroll (gui_window: %p) %d, %d\n", gw, rect->x0, rect->y0); NSLOG(netsurf, INFO, "scroll (gui_window: %p) %d, %d\n", gw, rect->x0,
rect->y0);
window_scroll_by(gw->root, rect->x0, rect->y0); window_scroll_by(gw->root, rect->x0, rect->y0);
return NSERROR_OK; return NSERROR_OK;
@ -771,7 +773,8 @@ static void gui_401login_open(nsurl *url, const char *realm,
char * out = NULL; char * out = NULL;
bres = login_form_do( url, (char*)realm, &out); bres = login_form_do( url, (char*)realm, &out);
if (bres) { if (bres) {
LOG("url: %s, realm: %s, auth: %s\n", nsurl_access(url), realm, out); NSLOG(netsurf, INFO, "url: %s, realm: %s, auth: %s\n",
nsurl_access(url), realm, out);
urldb_set_auth_details(url, realm, out); urldb_set_auth_details(url, realm, out);
} }
if (out != NULL) { if (out != NULL) {
@ -789,7 +792,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void *cbpw) void *cbpw)
{ {
struct sslcert_session_data *data; struct sslcert_session_data *data;
LOG("url %s", nsurl_access(url)); NSLOG(netsurf, INFO, "url %s", nsurl_access(url));
// TODO: localize string // TODO: localize string
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]"); int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]");
@ -812,7 +815,8 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void gui_set_input_gui_window(struct gui_window *gw) void gui_set_input_gui_window(struct gui_window *gw)
{ {
LOG("Setting input window from: %p to %p\n", input_window, gw); NSLOG(netsurf, INFO, "Setting input window from: %p to %p\n",
input_window, gw);
input_window = gw; input_window = gw;
} }
@ -823,7 +827,7 @@ struct gui_window * gui_get_input_window(void)
static void gui_quit(void) static void gui_quit(void)
{ {
LOG("quitting"); NSLOG(netsurf, INFO, "quitting");
struct gui_window *gw = window_list; struct gui_window *gw = window_list;
struct gui_window *tmp = window_list; struct gui_window *tmp = window_list;
@ -852,9 +856,9 @@ static void gui_quit(void)
rsrc_free(); rsrc_free();
LOG("Shutting down plotter"); NSLOG(netsurf, INFO, "Shutting down plotter");
plot_finalise(); plot_finalise();
LOG("done"); NSLOG(netsurf, INFO, "done");
} }
/** /**
@ -866,7 +870,7 @@ process_cmdline(int argc, char** argv)
int opt; int opt;
bool set_default_dimensions = true; bool set_default_dimensions = true;
LOG("argc %d, argv %p", argc, argv); NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv);
if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) { if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
@ -959,7 +963,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
/* Set defaults for absent option strings */ /* Set defaults for absent option strings */
nsoption_setnull_charp(cookie_file, strdup("cookies")); nsoption_setnull_charp(cookie_file, strdup("cookies"));
if (nsoption_charp(cookie_file) == NULL) { if (nsoption_charp(cookie_file) == NULL) {
LOG("Failed initialising string options"); NSLOG(netsurf, INFO, "Failed initialising string options");
return NSERROR_BAD_PARAMETER; return NSERROR_BAD_PARAMETER;
} }
return NSERROR_OK; return NSERROR_OK;
@ -976,7 +980,7 @@ static void gui_init(int argc, char** argv)
OBJECT * cursors; OBJECT * cursors;
atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc"); atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc");
LOG("Using RSC file: %s ", (char *)&buf); NSLOG(netsurf, INFO, "Using RSC file: %s ", (char *)&buf);
if (rsrc_load(buf)==0) { if (rsrc_load(buf)==0) {
char msg[1024]; char msg[1024];
@ -1012,15 +1016,16 @@ static void gui_init(int argc, char** argv)
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP, create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP,
cursors, &gem_cursors.help); cursors, &gem_cursors.help);
LOG("Enabling core select menu"); NSLOG(netsurf, INFO, "Enabling core select menu");
nsoption_set_bool(core_select_menu, true); nsoption_set_bool(core_select_menu, true);
LOG("Loading url.db from: %s", nsoption_charp(url_file)); NSLOG(netsurf, INFO, "Loading url.db from: %s", nsoption_charp(url_file));
if( strlen(nsoption_charp(url_file)) ) { if( strlen(nsoption_charp(url_file)) ) {
urldb_load(nsoption_charp(url_file)); urldb_load(nsoption_charp(url_file));
} }
LOG("Loading cookies from: %s", nsoption_charp(cookie_file)); NSLOG(netsurf, INFO, "Loading cookies from: %s",
nsoption_charp(cookie_file));
if( strlen(nsoption_charp(cookie_file)) ) { if( strlen(nsoption_charp(cookie_file)) ) {
urldb_load_cookies(nsoption_charp(cookie_file)); urldb_load_cookies(nsoption_charp(cookie_file));
} }
@ -1028,10 +1033,10 @@ static void gui_init(int argc, char** argv)
if (process_cmdline(argc,argv) != true) if (process_cmdline(argc,argv) != true)
die("unable to process command line.\n"); die("unable to process command line.\n");
LOG("Initializing NKC..."); NSLOG(netsurf, INFO, "Initializing NKC...");
nkc_init(); nkc_init();
LOG("Initializing plotters..."); NSLOG(netsurf, INFO, "Initializing plotters...");
struct redraw_context ctx = { struct redraw_context ctx = {
.interactive = true, .interactive = true,
.background_images = true, .background_images = true,
@ -1172,18 +1177,18 @@ int main(int argc, char** argv)
ret = messages_add_from_file(messages); ret = messages_add_from_file(messages);
/* common initialisation */ /* common initialisation */
LOG("Initialising core..."); NSLOG(netsurf, INFO, "Initialising core...");
ret = netsurf_init(store); ret = netsurf_init(store);
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
die("NetSurf failed to initialise"); die("NetSurf failed to initialise");
} }
LOG("Initializing GUI..."); NSLOG(netsurf, INFO, "Initializing GUI...");
gui_init(argc, argv); gui_init(argc, argv);
graf_mouse( ARROW , NULL); graf_mouse( ARROW , NULL);
LOG("Creating initial browser window..."); NSLOG(netsurf, INFO, "Creating initial browser window...");
addr = option_homepage_url; addr = option_homepage_url;
if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) { if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
if (stat(addr, &stat_buf) == 0) { if (stat(addr, &stat_buf) == 0) {
@ -1205,7 +1210,7 @@ int main(int argc, char** argv)
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
atari_warn_user(messages_get_errorcode(ret), 0); atari_warn_user(messages_get_errorcode(ret), 0);
} else { } else {
LOG("Entering Atari event mainloop..."); NSLOG(netsurf, INFO, "Entering Atari event mainloop...");
while (!atari_quit) { while (!atari_quit) {
atari_poll(); atari_poll();
} }
@ -1219,7 +1224,7 @@ int main(int argc, char** argv)
fclose(stdout); fclose(stdout);
fclose(stderr); fclose(stderr);
#endif #endif
LOG("exit_gem"); NSLOG(netsurf, INFO, "exit_gem");
exit_gem(); exit_gem();
return 0; return 0;

View File

@ -39,13 +39,13 @@ static nserror
atari_global_history_init_phase2(struct core_window *cw, atari_global_history_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t) struct core_window_callback_table *cb_t)
{ {
LOG("cw %p", cw); NSLOG(netsurf, INFO, "cw %p", cw);
return(global_history_init(cb_t, cw)); return(global_history_init(cb_t, cw));
} }
static void atari_global_history_finish(struct core_window *cw) static void atari_global_history_finish(struct core_window *cw)
{ {
LOG("cw %p", cw); NSLOG(netsurf, INFO, "cw %p", cw);
global_history_fini(); global_history_fini();
} }
@ -58,7 +58,7 @@ static void atari_global_history_draw(struct core_window *cw, int x,
static void atari_global_history_keypress(struct core_window *cw, uint32_t ucs4) static void atari_global_history_keypress(struct core_window *cw, uint32_t ucs4)
{ {
LOG("ucs4: %"PRIu32, ucs4); NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4);
global_history_keypress(ucs4); global_history_keypress(ucs4);
} }
@ -67,7 +67,7 @@ atari_global_history_mouse_action(struct core_window *cw,
browser_mouse_state mouse, browser_mouse_state mouse,
int x, int y) int x, int y)
{ {
LOG("x: %d, y: %d\n", x, y); NSLOG(netsurf, INFO, "x: %d, y: %d\n", x, y);
global_history_mouse_action(mouse, x, y); global_history_mouse_action(mouse, x, y);
} }
@ -82,7 +82,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{ {
short retval = 0; short retval = 0;
LOG("win %p", win); NSLOG(netsurf, INFO, "win %p", win);
if (ev_out->emo_events & MU_MESAG) { if (ev_out->emo_events & MU_MESAG) {
switch (msg[0]) { switch (msg[0]) {
@ -134,7 +134,8 @@ void atari_global_history_init(void)
if (atari_global_history.tv == NULL) { if (atari_global_history.tv == NULL) {
/* handle it properly, clean up previous allocs */ /* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview"); NSLOG(netsurf, INFO,
"Failed to allocate treeview");
return; return;
} }
} }
@ -181,7 +182,7 @@ void atari_global_history_destroy(void)
atari_treeview_delete(atari_global_history.tv); atari_treeview_delete(atari_global_history.tv);
atari_global_history.init = false; atari_global_history.init = false;
} }
LOG("done"); NSLOG(netsurf, INFO, "done");
} }
void atari_global_history_redraw(void) void atari_global_history_redraw(void)

View File

@ -72,13 +72,13 @@ static struct atari_treeview_callbacks atari_hotlist_treeview_callbacks = {
static nserror atari_hotlist_init_phase2(struct core_window *cw, static nserror atari_hotlist_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t) struct core_window_callback_table *cb_t)
{ {
LOG("cw:%p", cw); NSLOG(netsurf, INFO, "cw:%p", cw);
return hotlist_manager_init(cb_t, cw); return hotlist_manager_init(cb_t, cw);
} }
static void atari_hotlist_finish(struct core_window *cw) static void atari_hotlist_finish(struct core_window *cw)
{ {
LOG("cw:%p", cw); NSLOG(netsurf, INFO, "cw:%p", cw);
hotlist_fini(); hotlist_fini();
} }
@ -93,7 +93,7 @@ static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4)
{ {
//GUIWIN *gemtk_win; //GUIWIN *gemtk_win;
//GRECT area; //GRECT area;
LOG("ucs4: %"PRIu32 , ucs4); NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4);
hotlist_keypress(ucs4); hotlist_keypress(ucs4);
//gemtk_win = atari_treeview_get_gemtk_window(cw); //gemtk_win = atari_treeview_get_gemtk_window(cw);
//atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area); //atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area);
@ -104,7 +104,7 @@ static void atari_hotlist_mouse_action(struct core_window *cw,
browser_mouse_state mouse, browser_mouse_state mouse,
int x, int y) int x, int y)
{ {
LOG("x: %d, y: %d\n", x, y); NSLOG(netsurf, INFO, "x: %d, y: %d\n", x, y);
hotlist_mouse_action(mouse, x, y); hotlist_mouse_action(mouse, x, y);
} }
@ -123,7 +123,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
GRECT tb_area; GRECT tb_area;
GUIWIN * gemtk_win; GUIWIN * gemtk_win;
LOG("gw:%p", win); NSLOG(netsurf, INFO, "gw:%p", win);
tv = (struct atari_treeview_window*) gemtk_wm_get_user_data(win); tv = (struct atari_treeview_window*) gemtk_wm_get_user_data(win);
cw = (struct core_window *)tv; cw = (struct core_window *)tv;
@ -132,7 +132,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
switch (msg[0]) { switch (msg[0]) {
case WM_TOOLBAR: case WM_TOOLBAR:
LOG("WM_TOOLBAR"); NSLOG(netsurf, INFO, "WM_TOOLBAR");
toolbar = gemtk_obj_get_tree(TOOLBAR_HOTLIST); toolbar = gemtk_obj_get_tree(TOOLBAR_HOTLIST);
@ -198,7 +198,7 @@ void atari_hotlist_init(void)
strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 ); strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
} }
LOG("Hotlist: %s", (char *)&hl.path); NSLOG(netsurf, INFO, "Hotlist: %s", (char *)&hl.path);
hotlist_init(hl.path, hl.path); hotlist_init(hl.path, hl.path);
if( hl.window == NULL ){ if( hl.window == NULL ){
@ -224,7 +224,8 @@ void atari_hotlist_init(void)
if (hl.tv == NULL) { if (hl.tv == NULL) {
/* handle it properly, clean up previous allocs */ /* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview"); NSLOG(netsurf, INFO,
"Failed to allocate treeview");
return; return;
} }
@ -276,7 +277,7 @@ void atari_hotlist_destroy(void)
atari_treeview_delete(hl.tv); atari_treeview_delete(hl.tv);
hl.init = false; hl.init = false;
} }
LOG("done"); NSLOG(netsurf, INFO, "done");
} }
void atari_hotlist_redraw(void) void atari_hotlist_redraw(void)
@ -299,7 +300,7 @@ void atari_hotlist_add_page( const char * url, const char * title )
return; return;
if (hotlist_has_url(nsurl)) { if (hotlist_has_url(nsurl)) {
LOG("URL already added as Bookmark"); NSLOG(netsurf, INFO, "URL already added as Bookmark");
nsurl_unref(nsurl); nsurl_unref(nsurl);
return; return;
} }

View File

@ -119,14 +119,14 @@ char *gemdos_realpath(const char * path, char * rpath)
return(rpath); return(rpath);
} }
LOG("realpath in: %s\n", path); NSLOG(netsurf, INFO, "realpath in: %s\n", path);
r = realpath(path, work); r = realpath(path, work);
if (r != NULL) { if (r != NULL) {
unx2dos((const char *)r, rpath); unx2dos((const char *)r, rpath);
LOG("realpath out: %s\n", rpath); NSLOG(netsurf, INFO, "realpath out: %s\n", rpath);
return(rpath); return(rpath);
} else { } else {
LOG("realpath out: NULL!\n"); NSLOG(netsurf, INFO, "realpath out: NULL!\n");
} }
return (NULL); return (NULL);
} }

View File

@ -154,11 +154,12 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po
error = FT_New_Face(library, ft_face->fontfile, ft_face->index, face); error = FT_New_Face(library, ft_face->fontfile, ft_face->index, face);
if (error) { if (error) {
LOG("Could not find font (code %d)\n", error); NSLOG(netsurf, INFO, "Could not find font (code %d)\n", error);
} else { } else {
error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE); error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE);
if (error) { if (error) {
LOG("Could not select charmap (code %d)\n", error); NSLOG(netsurf, INFO,
"Could not select charmap (code %d)\n", error);
} else { } else {
for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) { for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) {
if ((*face)->charmap == (*face)->charmaps[cidx]) { if ((*face)->charmap == (*face)->charmaps[cidx]) {
@ -168,7 +169,7 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po
} }
} }
} }
LOG("Loaded face from %s\n", ft_face->fontfile); NSLOG(netsurf, INFO, "Loaded face from %s\n", ft_face->fontfile);
return error; return error;
} }
@ -190,7 +191,9 @@ ft_new_face(const char *option, const char *resname, const char *fontfile)
} }
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface); error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface);
if (error) { if (error) {
LOG("Could not find font face %s (code %d)\n", fontfile, error); NSLOG(netsurf, INFO,
"Could not find font face %s (code %d)\n", fontfile,
error);
free(newf); free(newf);
newf = font_faces[FONT_FACE_DEFAULT]; /* use default */ newf = font_faces[FONT_FACE_DEFAULT]; /* use default */
} }
@ -292,7 +295,8 @@ static bool ft_font_init(void)
/* freetype library initialise */ /* freetype library initialise */
error = FT_Init_FreeType( &library ); error = FT_Init_FreeType( &library );
if (error) { if (error) {
LOG("Freetype could not initialised (code %d)\n", error); NSLOG(netsurf, INFO,
"Freetype could not initialised (code %d)\n", error);
return false; return false;
} }
@ -311,7 +315,9 @@ static bool ft_font_init(void)
NULL, NULL,
&ft_cmanager); &ft_cmanager);
if (error) { if (error) {
LOG("Freetype could not initialise cache manager (code %d)\n", error); NSLOG(netsurf, INFO,
"Freetype could not initialise cache manager (code %d)\n",
error);
FT_Done_FreeType(library); FT_Done_FreeType(library);
return false; return false;
} }
@ -330,7 +336,8 @@ static bool ft_font_init(void)
FONT_PKG_PATH FONT_FILE_SANS FONT_PKG_PATH FONT_FILE_SANS
); );
if (font_faces[FONT_FACE_SANS_SERIF] == NULL) { if (font_faces[FONT_FACE_SANS_SERIF] == NULL) {
LOG("Could not find default font (code %d)\n", error); NSLOG(netsurf, INFO,
"Could not find default font (code %d)\n", error);
FTC_Manager_Done(ft_cmanager); FTC_Manager_Done(ft_cmanager);
FT_Done_FreeType(library); FT_Done_FreeType(library);
return false; return false;
@ -688,7 +695,7 @@ int ctor_font_plotter_freetype( FONT_PLOTTER self )
self->draw_glyph = draw_glyph8; self->draw_glyph = draw_glyph8;
} }
LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__); NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) { if( !init ) {
ft_font_init(); ft_font_init();
fontbmp = atari_bitmap_create(48, 48, 0); fontbmp = atari_bitmap_create(48, 48, 0);

View File

@ -96,7 +96,7 @@ int ctor_font_plotter_internal( FONT_PLOTTER self )
self->str_split = str_split; self->str_split = str_split;
self->pixel_pos = pixel_pos; self->pixel_pos = pixel_pos;
self->text = text; self->text = text;
LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__); NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) { if( !init ) {
vdih = self->vdi_handle; vdih = self->vdi_handle;
fontbmp = atari_bitmap_create(48, 48, 0); fontbmp = atari_bitmap_create(48, 48, 0);

View File

@ -70,7 +70,7 @@ int ctor_font_plotter_vdi( FONT_PLOTTER self )
self->str_split = str_split; self->str_split = str_split;
self->pixel_pos = pixel_pos; self->pixel_pos = pixel_pos;
self->text = text; self->text = text;
LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__); NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) { if( !init ) {
vdih = self->vdi_handle; vdih = self->vdi_handle;
} }

View File

@ -1628,7 +1628,7 @@ int plot_init(const struct redraw_context *ctx, char *fdrvrname)
short work_out[57]; short work_out[57];
atari_plot_vdi_handle=graf_handle(&dummy, &dummy, &dummy, &dummy); atari_plot_vdi_handle=graf_handle(&dummy, &dummy, &dummy, &dummy);
v_opnvwk(work_in, &atari_plot_vdi_handle, work_out); v_opnvwk(work_in, &atari_plot_vdi_handle, work_out);
LOG("Plot VDI handle: %d", atari_plot_vdi_handle); NSLOG(netsurf, INFO, "Plot VDI handle: %d", atari_plot_vdi_handle);
} }
read_vdi_sysinfo(atari_plot_vdi_handle, &vdi_sysinfo); read_vdi_sysinfo(atari_plot_vdi_handle, &vdi_sysinfo);
if(verbose_log) { if(verbose_log) {
@ -1640,7 +1640,8 @@ int plot_init(const struct redraw_context *ctx, char *fdrvrname)
atari_font_flags, &err); atari_font_flags, &err);
if (err) { if (err) {
const char * desc = plot_err_str(err); const char * desc = plot_err_str(err);
LOG("Unable to load font plotter %s -> %s", fdrvrname, desc ); NSLOG(netsurf, INFO, "Unable to load font plotter %s -> %s",
fdrvrname, desc);
die("font plotter"); die("font plotter");
} }

View File

@ -105,7 +105,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
switch (msg[0]) { switch (msg[0]) {
case WM_REDRAW: case WM_REDRAW:
LOG("WM_REDRAW"); NSLOG(netsurf, INFO, "WM_REDRAW");
on_redraw(data->rootwin, msg); on_redraw(data->rootwin, msg);
break; break;
@ -113,7 +113,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_SIZED: case WM_SIZED:
case WM_MOVED: case WM_MOVED:
case WM_FULLED: case WM_FULLED:
LOG("WM_SIZED"); NSLOG(netsurf, INFO, "WM_SIZED");
on_resized(data->rootwin); on_resized(data->rootwin);
break; break;
@ -132,7 +132,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_TOPPED: case WM_TOPPED:
case WM_NEWTOP: case WM_NEWTOP:
case WM_UNICONIFY: case WM_UNICONIFY:
LOG("WM_TOPPED"); NSLOG(netsurf, INFO, "WM_TOPPED");
gui_set_input_gui_window(data->rootwin->active_gui_window); gui_set_input_gui_window(data->rootwin->active_gui_window);
//window_restore_active_gui_window(data->rootwin); //window_restore_active_gui_window(data->rootwin);
// TODO: use something like "restore_active_gui_window_state()" // TODO: use something like "restore_active_gui_window_state()"
@ -143,7 +143,8 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
// TODO: this needs to iterate through all gui windows and // TODO: this needs to iterate through all gui windows and
// check if the rootwin is this window... // check if the rootwin is this window...
if (data->rootwin->active_gui_window != NULL) { if (data->rootwin->active_gui_window != NULL) {
LOG("WM_CLOSED initiated destroy for bw %p", data->rootwin->active_gui_window->browser->bw); NSLOG(netsurf, INFO, "WM_CLOSED initiated destroy for bw %p",
data->rootwin->active_gui_window->browser->bw);
browser_window_destroy( browser_window_destroy(
data->rootwin->active_gui_window->browser->bw); data->rootwin->active_gui_window->browser->bw);
} }
@ -166,13 +167,16 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
// handle key // handle key
uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta, uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta,
(short)ev_out->emo_kreturn); (short)ev_out->emo_kreturn);
LOG("rootwin MU_KEYBD input, nkc: %x\n", nkc); NSLOG(netsurf, INFO, "rootwin MU_KEYBD input, nkc: %x\n", nkc);
retval = on_window_key_input(data->rootwin, nkc); retval = on_window_key_input(data->rootwin, nkc);
// printf("on_window_key_input: %d\n", retval); // printf("on_window_key_input: %d\n", retval);
} }
if ((ev_out->emo_events & MU_BUTTON) != 0) { if ((ev_out->emo_events & MU_BUTTON) != 0) {
LOG("rootwin MU_BUTTON input, x: %d, y: %d\n", ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_x); NSLOG(netsurf, INFO,
"rootwin MU_BUTTON input, x: %d, y: %d\n",
ev_out->emo_mouse.p_x,
ev_out->emo_mouse.p_x);
window_get_grect(data->rootwin, BROWSER_AREA_CONTENT, window_get_grect(data->rootwin, BROWSER_AREA_CONTENT,
&area); &area);
if (POINT_WITHIN(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y, if (POINT_WITHIN(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y,
@ -312,13 +316,13 @@ void window_unref_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
struct gui_window *w; struct gui_window *w;
input_window = NULL; input_window = NULL;
LOG("window: %p, gui_window: %p", rootwin, gw); NSLOG(netsurf, INFO, "window: %p, gui_window: %p", rootwin, gw);
w = window_list; w = window_list;
// find the next active tab: // find the next active tab:
while( w != NULL ) { while( w != NULL ) {
if(w->root == rootwin && w != gw) { if(w->root == rootwin && w != gw) {
LOG("activating next tab %p", w); NSLOG(netsurf, INFO, "activating next tab %p", w);
gui_set_input_gui_window(w); gui_set_input_gui_window(w);
break; break;
} }
@ -338,7 +342,7 @@ int window_destroy(ROOTWIN *rootwin)
assert(rootwin != NULL); assert(rootwin != NULL);
LOG("%p", rootwin); NSLOG(netsurf, INFO, "%p", rootwin);
if (gemtk_wm_get_user_data(rootwin->win) != NULL) { if (gemtk_wm_get_user_data(rootwin->win) != NULL) {
free(gemtk_wm_get_user_data(rootwin->win)); free(gemtk_wm_get_user_data(rootwin->win));
@ -404,7 +408,7 @@ void window_restore_active_gui_window(ROOTWIN *rootwin)
GRECT tb_area; GRECT tb_area;
struct gui_window *gw; struct gui_window *gw;
LOG("rootwin %p", rootwin); NSLOG(netsurf, INFO, "rootwin %p", rootwin);
assert(rootwin->active_gui_window); assert(rootwin->active_gui_window);
@ -499,7 +503,7 @@ void window_set_focus(struct s_gui_win_root *rootwin,
assert(rootwin != NULL); assert(rootwin != NULL);
if (rootwin->focus.type != type || rootwin->focus.element != element) { if (rootwin->focus.type != type || rootwin->focus.element != element) {
LOG("Set focus: %p (%d)\n", element, type); NSLOG(netsurf, INFO, "Set focus: %p (%d)\n", element, type);
rootwin->focus.type = type; rootwin->focus.type = type;
rootwin->focus.element = element; rootwin->focus.element = element;
switch( type ) { switch( type ) {
@ -563,11 +567,11 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
{ {
struct gui_window *old_gw = rootwin->active_gui_window; struct gui_window *old_gw = rootwin->active_gui_window;
LOG("gw %p",gw); NSLOG(netsurf, INFO, "gw %p", gw);
if (rootwin->active_gui_window != NULL) { if (rootwin->active_gui_window != NULL) {
if(rootwin->active_gui_window == gw) { if(rootwin->active_gui_window == gw) {
LOG("nothing to do..."); NSLOG(netsurf, INFO, "nothing to do...");
return; return;
} }
} }
@ -576,7 +580,7 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
rootwin->active_gui_window = gw; rootwin->active_gui_window = gw;
if (old_gw != NULL) { if (old_gw != NULL) {
LOG("restoring window..."); NSLOG(netsurf, INFO, "restoring window...");
window_restore_active_gui_window(rootwin); window_restore_active_gui_window(rootwin);
} }
} }
@ -651,7 +655,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat)
GRECT area; GRECT area;
OBJECT *obj; OBJECT *obj;
LOG("rootwin %p", rootwin); NSLOG(netsurf, INFO, "rootwin %p", rootwin);
gw = rootwin->active_gui_window; gw = rootwin->active_gui_window;
bw = gw->browser->bw; bw = gw->browser->bw;
@ -1478,7 +1482,13 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
buff[size] = 0; buff[size] = 0;
LOG("file: %s, ext: %s, size: %ld dropped at: %d,%d\n", (char *)buff, (char *)&ext, size, mx, my); NSLOG(netsurf, INFO,
"file: %s, ext: %s, size: %ld dropped at: %d,%d\n",
(char *)buff,
(char *)&ext,
size,
mx,
my);
gui_window_get_scroll(gw, &sx, &sy); gui_window_get_scroll(gw, &sx, &sy);
@ -1500,7 +1510,8 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
free(buff); free(buff);
/* A bad encoding should never happen */ /* A bad encoding should never happen */
LOG("utf8_from_local_encoding failed"); NSLOG(netsurf, INFO,
"utf8_from_local_encoding failed");
assert(ret != NSERROR_BAD_ENCODING); assert(ret != NSERROR_BAD_ENCODING);
/* no memory */ /* no memory */
goto error; goto error;

View File

@ -71,7 +71,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
return NSERROR_OK; return NSERROR_OK;
} }
LOG("removing %p, %p", callback, p); NSLOG(netsurf, INFO, "removing %p, %p", callback, p);
cur_nscb = schedule_list; cur_nscb = schedule_list;
prev_nscb = NULL; prev_nscb = NULL;
@ -80,7 +80,9 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
if ((cur_nscb->callback == callback) && if ((cur_nscb->callback == callback) &&
(cur_nscb->p == p)) { (cur_nscb->p == p)) {
/* item to remove */ /* item to remove */
LOG("callback entry %p removing %p(%p)", cur_nscb, cur_nscb->callback, cur_nscb->p); NSLOG(netsurf, INFO,
"callback entry %p removing %p(%p)", cur_nscb,
cur_nscb->callback, cur_nscb->p);
/* remove callback */ /* remove callback */
unlnk_nscb = cur_nscb; unlnk_nscb = cur_nscb;
@ -118,7 +120,8 @@ nserror atari_schedule(int ival, void (*callback)(void *p), void *p)
nscb->timeout = MS_NOW() + ival; nscb->timeout = MS_NOW() + ival;
LOG("adding callback %p for %p(%p) at %d ms", nscb, callback, p, nscb->timeout); NSLOG(netsurf, INFO, "adding callback %p for %p(%p) at %d ms", nscb,
callback, p, nscb->timeout);
nscb->callback = callback; nscb->callback = callback;
nscb->p = p; nscb->p = p;
@ -164,7 +167,9 @@ int schedule_run(void)
prev_nscb->next = unlnk_nscb->next; prev_nscb->next = unlnk_nscb->next;
} }
LOG("callback entry %p running %p(%p)", unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p); NSLOG(netsurf, INFO,
"callback entry %p running %p(%p)", unlnk_nscb,
unlnk_nscb->callback, unlnk_nscb->p);
/* call callback */ /* call callback */
unlnk_nscb->callback(unlnk_nscb->p); unlnk_nscb->callback(unlnk_nscb->p);
@ -173,7 +178,7 @@ int schedule_run(void)
/* need to deal with callback modifying the list. */ /* need to deal with callback modifying the list. */
if (schedule_list == NULL) { if (schedule_list == NULL) {
LOG("schedule_list == NULL"); NSLOG(netsurf, INFO, "schedule_list == NULL");
return -1; /* no more callbacks scheduled */ return -1; /* no more callbacks scheduled */
} }
@ -198,7 +203,8 @@ int schedule_run(void)
/* make rettime relative to now and convert to ms */ /* make rettime relative to now and convert to ms */
nexttime = nexttime - now; nexttime = nexttime - now;
LOG("returning time to next event as %ldms", nexttime); NSLOG(netsurf, INFO, "returning time to next event as %ldms",
nexttime);
/*return next event time in milliseconds (24days max wait) */ /*return next event time in milliseconds (24days max wait) */
return nexttime; return nexttime;
@ -210,14 +216,15 @@ void list_schedule(void)
{ {
struct nscallback *cur_nscb; struct nscallback *cur_nscb;
LOG("schedule list at ms clock %ld", MS_NOW()); NSLOG(netsurf, INFO, "schedule list at ms clock %ld", MS_NOW());
cur_nscb = schedule_list; cur_nscb = schedule_list;
while (cur_nscb != NULL) { while (cur_nscb != NULL) {
LOG("Schedule %p at %ld", cur_nscb, cur_nscb->timeout); NSLOG(netsurf, INFO, "Schedule %p at %ld", cur_nscb,
cur_nscb->timeout);
cur_nscb = cur_nscb->next; cur_nscb = cur_nscb->next;
} }
LOG("Maxmium callbacks scheduled: %d", max_scheduled); NSLOG(netsurf, INFO, "Maxmium callbacks scheduled: %d", max_scheduled);
} }

View File

@ -67,7 +67,7 @@ struct gui_search_table *atari_search_table = &search_table;
*/ */
void nsatari_search_set_status(bool found, void *p) void nsatari_search_set_status(bool found, void *p)
{ {
LOG("%p set status: %d\n", p, found); NSLOG(netsurf, INFO, "%p set status: %d\n", p, found);
// TODO: maybe update GUI // TODO: maybe update GUI
} }
@ -80,7 +80,7 @@ void nsatari_search_set_status(bool found, void *p)
void nsatari_search_set_hourglass(bool active, void *p) void nsatari_search_set_hourglass(bool active, void *p)
{ {
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
LOG("active: %d, session: %p", active, p); NSLOG(netsurf, INFO, "active: %d, session: %p", active, p);
if (active) { if (active) {
gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS); gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS);
} else { } else {
@ -99,7 +99,7 @@ void nsatari_search_set_hourglass(bool active, void *p)
*/ */
void nsatari_search_add_recent(const char *string, void *p) void nsatari_search_add_recent(const char *string, void *p)
{ {
LOG("%p add recent: %s\n", p, string); NSLOG(netsurf, INFO, "%p add recent: %s\n", p, string);
} }
@ -115,7 +115,7 @@ void nsatari_search_set_forward_state(bool active, void *p)
GRECT area; GRECT area;
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
/* deactivate back cb */ /* deactivate back cb */
LOG("%p: set forward state: %d\n", p, active); NSLOG(netsurf, INFO, "%p: set forward state: %d\n", p, active);
gw = s->g; gw = s->g;
@ -142,7 +142,7 @@ void nsatari_search_set_back_state(bool active, void *p)
GRECT area; GRECT area;
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
/* deactivate back cb */ /* deactivate back cb */
LOG("%p: set back state: %d\n", p, active); NSLOG(netsurf, INFO, "%p: set back state: %d\n", p, active);
s->state.back_avail = active; s->state.back_avail = active;
gw = s->g; gw = s->g;
@ -224,7 +224,7 @@ void nsatari_search_restore_form( struct s_search_form_session *s, OBJECT *obj)
void nsatari_search_session_destroy(struct s_search_form_session *s) void nsatari_search_session_destroy(struct s_search_form_session *s)
{ {
if (s != NULL) { if (s != NULL) {
LOG("session %p", s); NSLOG(netsurf, INFO, "session %p", s);
browser_window_search_clear(s->g->browser->bw); browser_window_search_clear(s->g->browser->bw);
free(s); free(s);
} }

View File

@ -172,7 +172,7 @@ static char **read_locales(void)
atari_warn_user("Failed to load locales: %s",buf); atari_warn_user("Failed to load locales: %s",buf);
return(NULL); return(NULL);
} else { } else {
LOG("Reading locales from: %s...", buf); NSLOG(netsurf, INFO, "Reading locales from: %s...", buf);
} }
/* Count items: */ /* Count items: */
@ -980,12 +980,12 @@ void open_settings(void)
void close_settings(void) void close_settings(void)
{ {
LOG("closing"); NSLOG(netsurf, INFO, "closing");
gemtk_wm_remove(settings_guiwin); gemtk_wm_remove(settings_guiwin);
settings_guiwin = NULL; settings_guiwin = NULL;
wind_close(h_aes_win); wind_close(h_aes_win);
wind_delete(h_aes_win); wind_delete(h_aes_win);
h_aes_win = 0; h_aes_win = 0;
LOG("Done"); NSLOG(netsurf, INFO, "Done");
} }

View File

@ -166,7 +166,7 @@ CMP_STATUSBAR sb_create( struct gui_window * gw )
void sb_destroy( CMP_STATUSBAR s ) void sb_destroy( CMP_STATUSBAR s )
{ {
LOG("%s\n", __FUNCTION__); NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
if( s ) { if( s ) {
if( s->comp ){ if( s->comp ){
mt_CompDelete( &app, s->comp ); mt_CompDelete( &app, s->comp );
@ -206,7 +206,7 @@ CMP_STATUSBAR sb_create( struct gui_window * gw )
void sb_destroy( CMP_STATUSBAR s ) void sb_destroy( CMP_STATUSBAR s )
{ {
LOG("%s\n", __FUNCTION__); NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
if( s ) { if( s ) {
free( s ); free( s );
} }

View File

@ -269,7 +269,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
int i; int i;
struct s_toolbar *t; struct s_toolbar *t;
LOG("owner %p", owner); NSLOG(netsurf, INFO, "owner %p", owner);
assert(init == true); assert(init == true);
@ -327,8 +327,9 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
t->throbber.max_index = THROBBER_MAX_INDEX; t->throbber.max_index = THROBBER_MAX_INDEX;
t->throbber.running = false; t->throbber.running = false;
LOG("created toolbar: %p, root: %p, textarea: %p, throbber: %p", NSLOG(netsurf, INFO,
t, owner, t->url.textarea, &t->throbber); "created toolbar: %p, root: %p, textarea: %p, throbber: %p", t,
owner, t->url.textarea, &t->throbber);
return( t ); return( t );
} }
@ -458,7 +459,7 @@ toolbar_update_buttons(struct s_toolbar *tb,
struct browser_window *bw, struct browser_window *bw,
short button) short button)
{ {
LOG("tb %p", tb); NSLOG(netsurf, INFO, "tb %p", tb);
struct s_tb_button * bt; struct s_tb_button * bt;
bool enable = false; bool enable = false;
@ -582,7 +583,7 @@ void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area)
void toolbar_set_url(struct s_toolbar *tb, const char *text) void toolbar_set_url(struct s_toolbar *tb, const char *text)
{ {
LOG("tb %p", tb); NSLOG(netsurf, INFO, "tb %p", tb);
textarea_set_text(tb->url.textarea, text); textarea_set_text(tb->url.textarea, text);
@ -668,7 +669,7 @@ bool toolbar_text_input(struct s_toolbar *tb, char *text)
{ {
bool handled = true; bool handled = true;
LOG("tb %p", tb); NSLOG(netsurf, INFO, "tb %p", tb);
return(handled); return(handled);
} }
@ -757,7 +758,7 @@ void toolbar_mouse_input(struct s_toolbar *tb, short obj, short button)
short mx, my, mb, kstat; short mx, my, mb, kstat;
struct gui_window * gw; struct gui_window * gw;
LOG("tb %p", tb); NSLOG(netsurf, INFO, "tb %p", tb);
if (obj==TOOLBAR_AREA_URL) { if (obj==TOOLBAR_AREA_URL) {

View File

@ -362,8 +362,8 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
on_keybd_event(cw, ev_out, msg); on_keybd_event(cw, ev_out, msg);
} }
if ((ev_out->emo_events & MU_BUTTON) != 0 ) { if ((ev_out->emo_events & MU_BUTTON) != 0 ) {
LOG("Treeview click at: %d,%d\n", NSLOG(netsurf, INFO, "Treeview click at: %d,%d\n",
ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y); ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
on_mbutton_event(cw, ev_out, msg); on_mbutton_event(cw, ev_out, msg);
} }
@ -541,7 +541,7 @@ atari_treeview_create(GUIWIN *win, struct atari_treeview_callbacks * callbacks,
tv = calloc(1, sizeof(struct atari_treeview_window)); tv = calloc(1, sizeof(struct atari_treeview_window));
if (tv == NULL) { if (tv == NULL) {
LOG("calloc failed"); NSLOG(netsurf, INFO, "calloc failed");
atari_warn_user(messages_get_errorcode(NSERROR_NOMEM), 0); atari_warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
return NULL; return NULL;
} }

View File

@ -80,7 +80,9 @@ static void __CDECL cert_info_draw( WINDOW * win, short buf[8], void * data)
if( line == NULL ) if( line == NULL )
return; return;
LOG("Cert info draw, win: %p, data: %p, scrollx: %d", win, data, dp->scrollx ); NSLOG(netsurf, INFO,
"Cert info draw, win: %p, data: %p, scrollx: %d", win, data,
dp->scrollx);
WindGet( win, WF_WORKXYWH, &x, &y, &w, &h ); WindGet( win, WF_WORKXYWH, &x, &y, &w, &h );
/*using static values here, as RsrcUserDraw has mem leaks & a very small stack */ /*using static values here, as RsrcUserDraw has mem leaks & a very small stack */
@ -158,7 +160,7 @@ static void do_popup( WINDOW *win, int index, int mode, void *data)
char * items[dp->num_certs]; char * items[dp->num_certs];
short x, y; short x, y;
unsigned int i; unsigned int i;
LOG("do_popup: num certs: %d", dp->num_certs); NSLOG(netsurf, INFO, "do_popup: num certs: %d", dp->num_certs);
for( i = 0; i<dp->num_certs; i++) { for( i = 0; i<dp->num_certs; i++) {
items[i] = malloc( 48 ); items[i] = malloc( 48 );
strncpy(items[i], (char*)&dp->cert_infos_n[i].issuer, 46 ); strncpy(items[i], (char*)&dp->cert_infos_n[i].issuer, 46 );
@ -246,7 +248,7 @@ verify_ssl_form_do(const char * url,
break; break;
case VERIFY_BT_SCROLL_R: case VERIFY_BT_SCROLL_R:
LOG("scroll r!"); NSLOG(netsurf, INFO, "scroll r!");
cont = true; cont = true;
dp.scrollx += 1; dp.scrollx += 1;
if( dp.scrollx > (dp.cols - (272 / 8 )) ) if( dp.scrollx > (dp.cols - (272 / 8 )) )

View File

@ -51,7 +51,8 @@ static void *bitmap_create(int width, int height, unsigned int state)
{ {
nsfb_t *bm; nsfb_t *bm;
LOG("width %d, height %d, state %u", width, height, state); NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height,
state);
bm = nsfb_new(NSFB_SURFACE_RAM); bm = nsfb_new(NSFB_SURFACE_RAM);
if (bm == NULL) { if (bm == NULL) {
@ -69,7 +70,7 @@ static void *bitmap_create(int width, int height, unsigned int state)
return NULL; return NULL;
} }
LOG("bitmap %p", bm); NSLOG(netsurf, INFO, "bitmap %p", bm);
return bm; return bm;
} }
@ -197,11 +198,11 @@ static bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) { while (tst-- > 0) {
if (bmpptr[(tst << 2) + 3] != 0xff) { if (bmpptr[(tst << 2) + 3] != 0xff) {
LOG("bitmap %p has transparency", bm); NSLOG(netsurf, INFO, "bitmap %p has transparency", bm);
return false; return false;
} }
} }
LOG("bitmap %p is opaque", bm); NSLOG(netsurf, INFO, "bitmap %p is opaque", bm);
return true; return true;
} }
@ -282,7 +283,7 @@ bitmap_render(struct bitmap *bitmap,
nsfb_get_geometry(tbm, &width, &height, NULL); nsfb_get_geometry(tbm, &width, &height, NULL);
LOG("width %d, height %d", width, height); NSLOG(netsurf, INFO, "width %d, height %d", width, height);
/* Calculate size of buffer to render the content into */ /* Calculate size of buffer to render the content into */
/* We get the width from the content width, unless it exceeds 1024, /* We get the width from the content width, unless it exceeds 1024,

View File

@ -53,8 +53,8 @@ static void gui_get_clipboard(char **buffer, size_t *length)
if (gui_clipboard.length > 0) { if (gui_clipboard.length > 0) {
assert(gui_clipboard.buffer != NULL); assert(gui_clipboard.buffer != NULL);
LOG("Pasting %zd bytes: \"%s\"\n", NSLOG(netsurf, INFO, "Pasting %zd bytes: \"%s\"\n",
gui_clipboard.length, gui_clipboard.buffer); gui_clipboard.length, gui_clipboard.buffer);
*buffer = malloc(gui_clipboard.length); *buffer = malloc(gui_clipboard.length);

View File

@ -278,7 +278,8 @@ bool generate_font_header(const char *path, struct font_data *data)
fp = fopen(path, "wb"); fp = fopen(path, "wb");
if (fp == NULL) { if (fp == NULL) {
LOG(LOG_ERROR, "Couldn't open header file \"%s\"\n", path); NSLOG(netsurf, INFO, LOG_ERROR,
"Couldn't open header file \"%s\"\n", path);
return false; return false;
} }
@ -315,7 +316,8 @@ bool generate_font_source(const char *path, struct font_data *data)
fp = fopen(path, "wb"); fp = fopen(path, "wb");
if (fp == NULL) { if (fp == NULL) {
LOG(LOG_ERROR, "Couldn't open output file \"%s\"\n", path); NSLOG(netsurf, INFO, LOG_ERROR,
"Couldn't open output file \"%s\"\n", path);
return false; return false;
} }
@ -413,14 +415,14 @@ static bool add_glyph_to_data(glyph_entry *add, int id, int style,
d->e[d->glyphs++] = e; d->e[d->glyphs++] = e;
e->index = d->glyphs; e->index = d->glyphs;
if (d->glyphs >= 0xfffd) { if (d->glyphs >= 0xfffd) {
LOG(LOG_ERROR, " Too many glyphs for internal data " NSLOG(netsurf, INFO, LOG_ERROR,
"representation\n"); " Too many glyphs for internal data ""representation\n");
return false; return false;
} }
} else { } else {
/* Duplicate glyph */ /* Duplicate glyph */
LOG(LOG_DEBUG, " U+%.4X (%s) is duplicate\n", NSLOG(netsurf, INFO, LOG_DEBUG,
id, short_labels[style]); " U+%.4X (%s) is duplicate\n", id, short_labels[style]);
} }
/* Find glyph's section */ /* Find glyph's section */
@ -432,8 +434,8 @@ static bool add_glyph_to_data(glyph_entry *add, int id, int style,
size_t size = (d->sec_count[style] + 1) * SECTION_SIZE; size_t size = (d->sec_count[style] + 1) * SECTION_SIZE;
uint16_t *temp = realloc(d->sections[style], size); uint16_t *temp = realloc(d->sections[style], size);
if (temp == NULL) { if (temp == NULL) {
LOG(LOG_ERROR, " Couldn't increase sections " NSLOG(netsurf, INFO, LOG_ERROR,
"allocation\n"); " Couldn't increase sections ""allocation\n");
return false; return false;
} }
memset(temp + d->sec_count[style] * 256, 0, memset(temp + d->sec_count[style] * 256, 0,
@ -456,47 +458,50 @@ static bool check_glyph_data_valid(int pos, char c)
if (pos == 44) { if (pos == 44) {
if (c != '\n') { if (c != '\n') {
LOG(LOG_ERROR, " Invalid glyph data: " NSLOG(netsurf, INFO, LOG_ERROR,
"expecting '\\n', got '%c' (%i)\n", " Invalid glyph data: ""expecting '\\n', got '%c' (%i)\n",
c, c); c,
c);
return false; return false;
} else { } else {
return true; return true;
} }
} else if (pos < 3) { } else if (pos < 3) {
if (c != ' ') { if (c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: " NSLOG(netsurf, INFO, LOG_ERROR,
"expecting ' ', got '%c' (%i)\n", " Invalid glyph data: ""expecting ' ', got '%c' (%i)\n",
c, c); c,
c);
return false; return false;
} else { } else {
return true; return true;
} }
} else if (offset == 0) { } else if (offset == 0) {
if (c != '\n' && c != ' ') { if (c != '\n' && c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: " NSLOG(netsurf, INFO, LOG_ERROR,
"expecting '\\n' or ' ', " " Invalid glyph data: ""expecting '\\n' or ' ', ""got '%c' (%i)\n",
"got '%c' (%i)\n", c,
c, c); c);
return false; return false;
} else { } else {
return true; return true;
} }
} else if (offset < 3) { } else if (offset < 3) {
if (c != ' ') { if (c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: " NSLOG(netsurf, INFO, LOG_ERROR,
"expecting ' ', got '%c' (%i)\n", " Invalid glyph data: ""expecting ' ', got '%c' (%i)\n",
c, c); c,
c);
return false; return false;
} else { } else {
return true; return true;
} }
} else if (offset >= 3 && pos < 11) { } else if (offset >= 3 && pos < 11) {
if (c != '.' && c != '#') { if (c != '.' && c != '#') {
LOG(LOG_ERROR, " Invalid glyph data: " NSLOG(netsurf, INFO, LOG_ERROR,
"expecting '.' or '#', " " Invalid glyph data: ""expecting '.' or '#', ""got '%c' (%i)\n",
"got '%c' (%i)\n", c,
c, c); c);
return false; return false;
} else { } else {
return true; return true;
@ -505,10 +510,10 @@ static bool check_glyph_data_valid(int pos, char c)
/* offset must be >=3 */ /* offset must be >=3 */
if (c != '.' && c != '#' && c != ' ') { if (c != '.' && c != '#' && c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: " NSLOG(netsurf, INFO, LOG_ERROR,
"expecting '.', '#', or ' ', " " Invalid glyph data: ""expecting '.', '#', or ' ', ""got '%c' (%i)\n",
"got '%c' (%i)\n", c,
c, c); c);
return false; return false;
} }
@ -697,11 +702,11 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
/* Check that character is valid */ /* Check that character is valid */
if (check_glyph_data_valid(ctx->data.in_gd.pos, c) == false) { if (check_glyph_data_valid(ctx->data.in_gd.pos, c) == false) {
LOG(LOG_ERROR, " Error in U+%.4X data: " NSLOG(netsurf, INFO, LOG_ERROR,
"glyph line: %i, pos: %i\n", " Error in U+%.4X data: ""glyph line: %i, pos: %i\n",
ctx->id, ctx->id,
ctx->data.in_gd.line, ctx->data.in_gd.line,
ctx->data.in_gd.pos); ctx->data.in_gd.pos);
goto error; goto error;
} }
@ -712,8 +717,8 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
ctx->data.in_gd.e[glyph] = ctx->data.in_gd.e[glyph] =
calloc(sizeof(struct glyph_entry), 1); calloc(sizeof(struct glyph_entry), 1);
if (ctx->data.in_gd.e[glyph] == NULL) { if (ctx->data.in_gd.e[glyph] == NULL) {
LOG(LOG_ERROR, " Couldn't allocate memory for " NSLOG(netsurf, INFO, LOG_ERROR,
"glyph entry\n"); " Couldn't allocate memory for ""glyph entry\n");
goto error; goto error;
} }
@ -735,18 +740,17 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
if (c == '\n') { if (c == '\n') {
if (ctx->data.in_gd.line == 0) { if (ctx->data.in_gd.line == 0) {
if (ctx->data.in_gd.e[0] == NULL) { if (ctx->data.in_gd.e[0] == NULL) {
LOG(LOG_ERROR, " Error in U+%.4X data: " NSLOG(netsurf, INFO, LOG_ERROR,
"\"Regular\" glyph style must " " Error in U+%.4X data: ""\"Regular\" glyph style must ""be present\n",
"be present\n", ctx->id); ctx->id);
goto error; goto error;
} }
} else if (ctx->data.in_gd.styles != } else if (ctx->data.in_gd.styles !=
ctx->data.in_gd.line_styles) { ctx->data.in_gd.line_styles) {
LOG(LOG_ERROR, " Error in U+%.4X data: " NSLOG(netsurf, INFO, LOG_ERROR,
"glyph line: %i " " Error in U+%.4X data: ""glyph line: %i ""styles don't match first line\n",
"styles don't match first line\n", ctx->id,
ctx->id, ctx->data.in_gd.line);
ctx->data.in_gd.line);
goto error; goto error;
} }
@ -764,10 +768,10 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
ctx->count[i] += 1; ctx->count[i] += 1;
if (glyph_is_codepoint(ctx->data.in_gd.e[i], if (glyph_is_codepoint(ctx->data.in_gd.e[i],
ctx->id, i)) { ctx->id, i)) {
LOG(LOG_DEBUG, " U+%.4X (%s) is " NSLOG(netsurf, INFO, LOG_DEBUG,
"codepoint\n", " U+%.4X (%s) is ""codepoint\n",
ctx->id, ctx->id,
short_labels[i]); short_labels[i]);
ctx->codepoints += 1; ctx->codepoints += 1;
free(ctx->data.in_gd.e[i]); free(ctx->data.in_gd.e[i]);
ctx->data.in_gd.e[i] = NULL; ctx->data.in_gd.e[i] = NULL;
@ -810,7 +814,8 @@ static bool get_hex_digit_value(char c, int *v)
else if (c >= 'A' && c <= 'F') else if (c >= 'A' && c <= 'F')
*v = (10 + c - 'A'); *v = (10 + c - 'A');
else { else {
LOG(LOG_ERROR, "Invalid hex digit '%c' (%i)\n", c, c); NSLOG(netsurf, INFO, LOG_ERROR,
"Invalid hex digit '%c' (%i)\n", c, c);
return false; return false;
} }
@ -847,14 +852,16 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
while (pos < end) { while (pos < end) {
if (*pos == '\r') { if (*pos == '\r') {
LOG(LOG_ERROR, "Detected \'\\r\': Bad line ending\n"); NSLOG(netsurf, INFO, LOG_ERROR,
"Detected \'\\r\': Bad line ending\n");
return false; return false;
} }
switch (ctx->state) { switch (ctx->state) {
case START: case START:
if (*pos != '*') { if (*pos != '*') {
LOG(LOG_ERROR, "First character must be '*'\n"); NSLOG(netsurf, INFO, LOG_ERROR,
"First character must be '*'\n");
printf("Got: %c (%i)\n", *pos, *pos); printf("Got: %c (%i)\n", *pos, *pos);
return false; return false;
} }
@ -866,12 +873,13 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
case IN_HEADER: case IN_HEADER:
if (ctx->data.in_header.new_line == true) { if (ctx->data.in_header.new_line == true) {
if (*pos != '*') { if (*pos != '*') {
LOG(LOG_INFO, " Got header " NSLOG(netsurf, INFO, LOG_INFO,
"(%i bytes)\n", " Got header ""(%i bytes)\n",
d->header_len); d->header_len);
LOG(LOG_DEBUG, " Header:\n\n%.*s\n", NSLOG(netsurf, INFO, LOG_DEBUG,
d->header_len, " Header:\n\n%.*s\n",
d->header); d->header_len,
d->header);
ctx->data.before_id.new_line = false; ctx->data.before_id.new_line = false;
ctx->data.before_id.u = false; ctx->data.before_id.u = false;
ctx->state = BEFORE_ID; ctx->state = BEFORE_ID;
@ -886,9 +894,9 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
} }
if (d->header_len == HEADER_MAX) { if (d->header_len == HEADER_MAX) {
LOG(LOG_ERROR, " Header too long " NSLOG(netsurf, INFO, LOG_ERROR,
"(>%i bytes)\n", " Header too long ""(>%i bytes)\n",
d->header_len); d->header_len);
return false; return false;
} }
@ -922,7 +930,8 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
ok = assemble_codepoint(pos, ctx->data.g_id.c++, ok = assemble_codepoint(pos, ctx->data.g_id.c++,
&ctx->id); &ctx->id);
if (!ok) { if (!ok) {
LOG(LOG_ERROR, " Invalid glyph ID\n"); NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph ID\n");
return false; return false;
} }
@ -994,8 +1003,8 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
} }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
LOG(LOG_DEBUG, " %s: %i gylphs\n", labels[i], NSLOG(netsurf, INFO, LOG_DEBUG, " %s: %i gylphs\n",
ctx->count[i] - count[i]); labels[i], ctx->count[i] - count[i]);
} }
return true; return true;
@ -1019,13 +1028,15 @@ bool load_font(const char *path, struct font_data **data)
fp = fopen(path, "rb"); fp = fopen(path, "rb");
if (fp == NULL) { if (fp == NULL) {
LOG(LOG_ERROR, "Couldn't open font data file\n"); NSLOG(netsurf, INFO, LOG_ERROR,
"Couldn't open font data file\n");
return false; return false;
} }
d = calloc(sizeof(struct font_data), 1); d = calloc(sizeof(struct font_data), 1);
if (d == NULL) { if (d == NULL) {
LOG(LOG_ERROR, "Couldn't allocate memory for font data\n"); NSLOG(netsurf, INFO, LOG_ERROR,
"Couldn't allocate memory for font data\n");
fclose(fp); fclose(fp);
return false; return false;
} }
@ -1034,18 +1045,19 @@ bool load_font(const char *path, struct font_data **data)
fseek(fp, 0L, SEEK_END); fseek(fp, 0L, SEEK_END);
file_len = ftell(fp); file_len = ftell(fp);
if (file_len == -1) { if (file_len == -1) {
LOG(LOG_ERROR, "Could not size input file\n"); NSLOG(netsurf, INFO, LOG_ERROR, "Could not size input file\n");
free(d); free(d);
fclose(fp); fclose(fp);
return false; return false;
} }
fseek(fp, 0L, SEEK_SET); fseek(fp, 0L, SEEK_SET);
LOG(LOG_DEBUG, "Input size: %zu bytes\n", file_len); NSLOG(netsurf, INFO, LOG_DEBUG, "Input size: %zu bytes\n", file_len);
/* Allocate buffer for data chunks */ /* Allocate buffer for data chunks */
buf = malloc(CHUNK_SIZE); buf = malloc(CHUNK_SIZE);
if (buf == NULL) { if (buf == NULL) {
LOG(LOG_ERROR, "Couldn't allocate memory for input buffer\n"); NSLOG(netsurf, INFO, LOG_ERROR,
"Couldn't allocate memory for input buffer\n");
free(d); free(d);
fclose(fp); fclose(fp);
return false; return false;
@ -1054,20 +1066,24 @@ bool load_font(const char *path, struct font_data **data)
/* Initialise parser */ /* Initialise parser */
parse_init(&ctx); parse_init(&ctx);
LOG(LOG_DEBUG, "Using chunk size of %i bytes\n", CHUNK_SIZE); NSLOG(netsurf, INFO, LOG_DEBUG, "Using chunk size of %i bytes\n",
CHUNK_SIZE);
/* Parse the input file in chunks */ /* Parse the input file in chunks */
for (done = 0; done < file_len; done += CHUNK_SIZE) { for (done = 0; done < file_len; done += CHUNK_SIZE) {
LOG(LOG_INFO, "Parsing input chunk %zu\n", done / CHUNK_SIZE); NSLOG(netsurf, INFO, LOG_INFO, "Parsing input chunk %zu\n",
done / CHUNK_SIZE);
/* Read chunk */ /* Read chunk */
len = fread(buf, 1, CHUNK_SIZE, fp); len = fread(buf, 1, CHUNK_SIZE, fp);
if (file_len - done < CHUNK_SIZE && if (file_len - done < CHUNK_SIZE &&
len != file_len - done) { len != file_len - done) {
LOG(LOG_WARNING, "Last chunk has suspicious size\n"); NSLOG(netsurf, INFO, LOG_WARNING,
"Last chunk has suspicious size\n");
} else if (file_len - done >= CHUNK_SIZE && } else if (file_len - done >= CHUNK_SIZE &&
len != CHUNK_SIZE) { len != CHUNK_SIZE) {
LOG(LOG_ERROR, "Problem reading file\n"); NSLOG(netsurf, INFO, LOG_ERROR,
"Problem reading file\n");
free(buf); free(buf);
free(d); free(d);
fclose(fp); fclose(fp);
@ -1082,29 +1098,33 @@ bool load_font(const char *path, struct font_data **data)
fclose(fp); fclose(fp);
return false; return false;
} }
LOG(LOG_DEBUG, "Parsed %zu bytes\n", done + len); NSLOG(netsurf, INFO, LOG_DEBUG, "Parsed %zu bytes\n",
done + len);
} }
fclose(fp); fclose(fp);
if (ctx.state != BEFORE_ID) { if (ctx.state != BEFORE_ID) {
LOG(LOG_ERROR, "Unexpected end of file\n"); NSLOG(netsurf, INFO, LOG_ERROR, "Unexpected end of file\n");
free(buf); free(buf);
free(d); free(d);
return false; return false;
} }
LOG(LOG_INFO, "Parsing complete:\n"); NSLOG(netsurf, INFO, LOG_INFO, "Parsing complete:\n");
count = 0; count = 0;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
LOG(LOG_INFO, " %s: %i gylphs\n", labels[i], ctx.count[i]); NSLOG(netsurf, INFO, LOG_INFO, " %s: %i gylphs\n",
labels[i], ctx.count[i]);
count += ctx.count[i]; count += ctx.count[i];
} }
LOG(LOG_RESULT, " Total %i gylphs " NSLOG(netsurf, INFO, LOG_RESULT,
"(of which %i unique, %i codepoints, %i duplicates)\n", " Total %i gylphs ""(of which %i unique, %i codepoints, %i duplicates)\n",
count, d->glyphs, ctx.codepoints, count,
count - d->glyphs - ctx.codepoints); d->glyphs,
ctx.codepoints,
count - d->glyphs - ctx.codepoints);
free(buf); free(buf);
@ -1115,16 +1135,9 @@ bool load_font(const char *path, struct font_data **data)
static void log_usage(const char *argv0) static void log_usage(const char *argv0)
{ {
level = LOG_INFO; level = LOG_INFO;
LOG(LOG_INFO, NSLOG(netsurf, INFO, LOG_INFO,
"Usage:\n" "Usage:\n""\t%s [options] <in_file> <out_file>\n""\n""Options:\n""\t--help -h Display this text\n""\t--quiet -q Don't show warnings\n""\t--verbose -v Verbose output\n""\t--debug -d Full debug output\n",
"\t%s [options] <in_file> <out_file>\n" argv0);
"\n"
"Options:\n"
"\t--help -h Display this text\n"
"\t--quiet -q Don't show warnings\n"
"\t--verbose -v Verbose output\n"
"\t--debug -d Full debug output\n",
argv0);
} }
int main(int argc, char** argv) int main(int argc, char** argv)
@ -1187,8 +1200,9 @@ int main(int argc, char** argv)
in_path = argv[optind]; in_path = argv[optind];
out_path = argv[optind + 1]; out_path = argv[optind + 1];
LOG(LOG_DEBUG, "Using input path: \"%s\"\n", in_path); NSLOG(netsurf, INFO, LOG_DEBUG, "Using input path: \"%s\"\n", in_path);
LOG(LOG_DEBUG, "Using output path: \"%s\"\n", out_path); NSLOG(netsurf, INFO, LOG_DEBUG, "Using output path: \"%s\"\n",
out_path);
ok = load_font(in_path, &data); ok = load_font(in_path, &data);
if (!ok) { if (!ok) {

View File

@ -51,7 +51,7 @@ fbtk_input(fbtk_widget_t *root, nsfb_event_t *event)
/* obtain widget with input focus */ /* obtain widget with input focus */
input = root->u.root.input; input = root->u.root.input;
if (input == NULL) { if (input == NULL) {
LOG("No widget has input focus."); NSLOG(netsurf, INFO, "No widget has input focus.");
return; /* no widget with input */ return; /* no widget with input */
} }
@ -84,7 +84,7 @@ fbtk_click(fbtk_widget_t *widget, nsfb_event_t *event)
x = fbtk_get_absx(clicked); x = fbtk_get_absx(clicked);
y = fbtk_get_absy(clicked); y = fbtk_get_absy(clicked);
LOG("clicked %p at %d,%d", clicked, x, y); NSLOG(netsurf, INFO, "clicked %p at %d,%d", clicked, x, y);
/* post the click */ /* post the click */
fbtk_post_callback(clicked, FBTK_CBT_CLICK, event, cloc.x0 - x, cloc.y0 - y); fbtk_post_callback(clicked, FBTK_CBT_CLICK, event, cloc.x0 - x, cloc.y0 - y);

View File

@ -53,7 +53,7 @@ dump_tk_tree(fbtk_widget_t *widget)
int indent = 0; int indent = 0;
while (widget != NULL) { while (widget != NULL) {
LOG("%*s%p", indent, "", widget); NSLOG(netsurf, INFO, "%*s%p", indent, "", widget);
if (widget->first_child != NULL) { if (widget->first_child != NULL) {
widget = widget->first_child; widget = widget->first_child;
indent += 6; indent += 6;
@ -101,7 +101,9 @@ fbtk_request_redraw(fbtk_widget_t *widget)
widget->redraw.height = widget->height; widget->redraw.height = widget->height;
#ifdef FBTK_LOGGING #ifdef FBTK_LOGGING
LOG("redrawing %p %d,%d %d,%d", widget, widget->redraw.x, widget->redraw.y, widget->redraw.width, widget->redraw.height); NSLOG(netsurf, INFO, "redrawing %p %d,%d %d,%d", widget,
widget->redraw.x, widget->redraw.y, widget->redraw.width,
widget->redraw.height);
#endif #endif
cwidget = widget->last_child; cwidget = widget->last_child;
@ -122,7 +124,7 @@ fbtk_request_redraw(fbtk_widget_t *widget)
int int
fbtk_set_mapping(fbtk_widget_t *widget, bool map) fbtk_set_mapping(fbtk_widget_t *widget, bool map)
{ {
LOG("setting mapping on %p to %d", widget, map); NSLOG(netsurf, INFO, "setting mapping on %p to %d", widget, map);
widget->mapped = map; widget->mapped = map;
if (map) { if (map) {
fbtk_request_redraw(widget); fbtk_request_redraw(widget);
@ -145,7 +147,7 @@ swap_siblings(fbtk_widget_t *lw)
assert(rw != NULL); assert(rw != NULL);
LOG("Swapping %p with %p", lw, rw); NSLOG(netsurf, INFO, "Swapping %p with %p", lw, rw);
before = lw->prev; before = lw->prev;
after = rw->next; after = rw->next;
@ -411,7 +413,8 @@ fbtk_get_root_widget(fbtk_widget_t *widget)
/* check root widget was found */ /* check root widget was found */
if (widget->type != FB_WIDGET_TYPE_ROOT) { if (widget->type != FB_WIDGET_TYPE_ROOT) {
LOG("Widget with null parent that is not the root widget!"); NSLOG(netsurf, INFO,
"Widget with null parent that is not the root widget!");
return NULL; return NULL;
} }
@ -552,7 +555,8 @@ fbtk_widget_new(fbtk_widget_t *parent,
return NULL; return NULL;
#ifdef FBTK_LOGGING #ifdef FBTK_LOGGING
LOG("creating %p %d,%d %d,%d", neww, x, y, width, height); NSLOG(netsurf, INFO, "creating %p %d,%d %d,%d", neww, x, y, width,
height);
#endif #endif
/* make new window fit inside parent */ /* make new window fit inside parent */
@ -575,7 +579,8 @@ fbtk_widget_new(fbtk_widget_t *parent,
} }
#ifdef FBTK_LOGGING #ifdef FBTK_LOGGING
LOG("using %p %d,%d %d,%d", neww, x, y, width, height); NSLOG(netsurf, INFO, "using %p %d,%d %d,%d", neww, x, y, width,
height);
#endif #endif
/* set values */ /* set values */
neww->type = type; neww->type = type;
@ -635,7 +640,8 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget)
plot_ctx.y1 = plot_ctx.y0 + widget->redraw.height; plot_ctx.y1 = plot_ctx.y0 + widget->redraw.height;
#ifdef FBTK_LOGGING #ifdef FBTK_LOGGING
LOG("clipping %p %d,%d %d,%d", widget, plot_ctx.x0, plot_ctx.y0, plot_ctx.x1, plot_ctx.y1); NSLOG(netsurf, INFO, "clipping %p %d,%d %d,%d", widget,
plot_ctx.x0, plot_ctx.y0, plot_ctx.x1, plot_ctx.y1);
#endif #endif
if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) { if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) {
fbtk_post_callback(widget, FBTK_CBT_REDRAW); fbtk_post_callback(widget, FBTK_CBT_REDRAW);

View File

@ -334,7 +334,7 @@ hscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
hpos = 0; hpos = 0;
} }
LOG("hscroll %d", hscroll); NSLOG(netsurf, INFO, "hscroll %d", hscroll);
rect.x0 = bbox.x0 + 3 + hpos; rect.x0 = bbox.x0 + 3 + hpos;
rect.y0 = bbox.y0 + 5; rect.y0 = bbox.y0 + 5;
@ -362,7 +362,7 @@ hscrolll_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
newpos = scrollw->u.scroll.minimum; newpos = scrollw->u.scroll.minimum;
if (newpos == scrollw->u.scroll.position) { if (newpos == scrollw->u.scroll.position) {
LOG("horiz scroll was the same %d", newpos); NSLOG(netsurf, INFO, "horiz scroll was the same %d", newpos);
return 0; return 0;
} }

View File

@ -65,7 +65,7 @@ static nsurl *get_resource_url(const char *path)
static const char *fetch_filetype(const char *unix_path) static const char *fetch_filetype(const char *unix_path)
{ {
int l; int l;
LOG("unix path %s", unix_path); NSLOG(netsurf, INFO, "unix path %s", unix_path);
l = strlen(unix_path); l = strlen(unix_path);
if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0) if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
return "text/css"; return "text/css";

View File

@ -90,12 +90,13 @@ ft_face_requester(FTC_FaceID face_id,
error = FT_New_Face(library, fb_face->fontfile, fb_face->index, face); error = FT_New_Face(library, fb_face->fontfile, fb_face->index, face);
if (error) { if (error) {
LOG("Could not find font (code %d)", error); NSLOG(netsurf, INFO, "Could not find font (code %d)", error);
} else { } else {
error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE); error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE);
if (error) { if (error) {
LOG("Could not select charmap (code %d)", error); NSLOG(netsurf, INFO,
"Could not select charmap (code %d)", error);
} else { } else {
for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) { for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) {
if ((*face)->charmap == (*face)->charmaps[cidx]) { if ((*face)->charmap == (*face)->charmaps[cidx]) {
@ -105,7 +106,7 @@ ft_face_requester(FTC_FaceID face_id,
} }
} }
} }
LOG("Loaded face from %s", fb_face->fontfile); NSLOG(netsurf, INFO, "Loaded face from %s", fb_face->fontfile);
return error; return error;
} }
@ -132,7 +133,8 @@ fb_new_face(const char *option, const char *resname, const char *fontname)
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface); error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface);
if (error) { if (error) {
LOG("Could not find font face %s (code %d)", fontname, error); NSLOG(netsurf, INFO, "Could not find font face %s (code %d)",
fontname, error);
free(newf->fontfile); free(newf->fontfile);
free(newf); free(newf);
newf = NULL; newf = NULL;
@ -152,7 +154,8 @@ bool fb_font_init(void)
/* freetype library initialise */ /* freetype library initialise */
error = FT_Init_FreeType( &library ); error = FT_Init_FreeType( &library );
if (error) { if (error) {
LOG("Freetype could not initialised (code %d)", error); NSLOG(netsurf, INFO,
"Freetype could not initialised (code %d)", error);
return false; return false;
} }
@ -172,7 +175,9 @@ bool fb_font_init(void)
NULL, NULL,
&ft_cmanager); &ft_cmanager);
if (error) { if (error) {
LOG("Freetype could not initialise cache manager (code %d)", error); NSLOG(netsurf, INFO,
"Freetype could not initialise cache manager (code %d)",
error);
FT_Done_FreeType(library); FT_Done_FreeType(library);
return false; return false;
} }
@ -189,7 +194,7 @@ bool fb_font_init(void)
NETSURF_FB_FONT_SANS_SERIF); NETSURF_FB_FONT_SANS_SERIF);
if (fb_face == NULL) { if (fb_face == NULL) {
/* The sans serif font is the default and must be found. */ /* The sans serif font is the default and must be found. */
LOG("Could not find the default font"); NSLOG(netsurf, INFO, "Could not find the default font");
FTC_Manager_Done(ft_cmanager); FTC_Manager_Done(ft_cmanager);
FT_Done_FreeType(library); FT_Done_FreeType(library);
return false; return false;

View File

@ -271,7 +271,7 @@ framebuffer_plot_path(const struct redraw_context *ctx,
float width, float width,
const float transform[6]) const float transform[6])
{ {
LOG("path unimplemented"); NSLOG(netsurf, INFO, "path unimplemented");
return NSERROR_OK; return NSERROR_OK;
} }
@ -564,7 +564,7 @@ static bool framebuffer_format_from_bpp(int bpp, enum nsfb_format_e *fmt)
break; break;
default: default:
LOG("Bad bits per pixel (%d)\n", bpp); NSLOG(netsurf, INFO, "Bad bits per pixel (%d)\n", bpp);
return false; return false;
} }
@ -586,18 +586,19 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp)
fbtype = nsfb_type_from_name(fename); fbtype = nsfb_type_from_name(fename);
if (fbtype == NSFB_SURFACE_NONE) { if (fbtype == NSFB_SURFACE_NONE) {
LOG("The %s surface is not available from libnsfb\n", fename); NSLOG(netsurf, INFO,
"The %s surface is not available from libnsfb\n", fename);
return NULL; return NULL;
} }
nsfb = nsfb_new(fbtype); nsfb = nsfb_new(fbtype);
if (nsfb == NULL) { if (nsfb == NULL) {
LOG("Unable to create %s fb surface\n", fename); NSLOG(netsurf, INFO, "Unable to create %s fb surface\n", fename);
return NULL; return NULL;
} }
if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) { if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) {
LOG("Unable to set surface geometry\n"); NSLOG(netsurf, INFO, "Unable to set surface geometry\n");
nsfb_free(nsfb); nsfb_free(nsfb);
return NULL; return NULL;
} }
@ -605,7 +606,7 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp)
nsfb_cursor_init(nsfb); nsfb_cursor_init(nsfb);
if (nsfb_init(nsfb) == -1) { if (nsfb_init(nsfb) == -1) {
LOG("Unable to initialise nsfb surface\n"); NSLOG(netsurf, INFO, "Unable to initialise nsfb surface\n");
nsfb_free(nsfb); nsfb_free(nsfb);
return NULL; return NULL;
} }
@ -625,7 +626,7 @@ framebuffer_resize(nsfb_t *nsfb, int width, int height, int bpp)
} }
if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) { if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) {
LOG("Unable to change surface geometry\n"); NSLOG(netsurf, INFO, "Unable to change surface geometry\n");
return false; return false;
} }

View File

@ -120,7 +120,7 @@ static void die(const char *error)
*/ */
static nserror fb_warn_user(const char *warning, const char *detail) static nserror fb_warn_user(const char *warning, const char *detail)
{ {
LOG("%s %s", warning, detail); NSLOG(netsurf, INFO, "%s %s", warning, detail);
return NSERROR_OK; return NSERROR_OK;
} }
@ -153,7 +153,7 @@ widget_scroll_y(struct gui_window *gw, int y, bool abs)
int content_width, content_height; int content_width, content_height;
int height; int height;
LOG("window scroll"); NSLOG(netsurf, INFO, "window scroll");
if (abs) { if (abs) {
bwidget->pany = y - bwidget->scrolly; bwidget->pany = y - bwidget->scrolly;
} else { } else {
@ -237,7 +237,7 @@ fb_pan(fbtk_widget_t *widget,
height = fbtk_get_height(widget); height = fbtk_get_height(widget);
width = fbtk_get_width(widget); width = fbtk_get_width(widget);
LOG("panning %d, %d", bwidget->panx, bwidget->pany); NSLOG(netsurf, INFO, "panning %d, %d", bwidget->panx, bwidget->pany);
x = fbtk_get_absx(widget); x = fbtk_get_absx(widget);
y = fbtk_get_absy(widget); y = fbtk_get_absy(widget);
@ -413,7 +413,8 @@ fb_browser_window_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
bwidget = fbtk_get_userpw(widget); bwidget = fbtk_get_userpw(widget);
if (bwidget == NULL) { if (bwidget == NULL) {
LOG("browser widget from widget %p was null", widget); NSLOG(netsurf, INFO,
"browser widget from widget %p was null", widget);
return -1; return -1;
} }
@ -465,7 +466,7 @@ process_cmdline(int argc, char** argv)
{0, 0, 0, 0 } {0, 0, 0, 0 }
}; /* no long options */ }; /* no long options */
LOG("argc %d, argv %p", argc, argv); NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv);
fename = "sdl"; fename = "sdl";
febpp = 32; febpp = 32;
@ -534,7 +535,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
if (nsoption_charp(cookie_file) == NULL || if (nsoption_charp(cookie_file) == NULL ||
nsoption_charp(cookie_jar) == NULL) { nsoption_charp(cookie_jar) == NULL) {
LOG("Failed initialising cookie options"); NSLOG(netsurf, INFO, "Failed initialising cookie options");
return NSERROR_BAD_PARAMETER; return NSERROR_BAD_PARAMETER;
} }
@ -612,7 +613,7 @@ static void framebuffer_run(void)
static void gui_quit(void) static void gui_quit(void)
{ {
LOG("gui_quit"); NSLOG(netsurf, INFO, "gui_quit");
urldb_save_cookies(nsoption_charp(cookie_jar)); urldb_save_cookies(nsoption_charp(cookie_jar));
@ -639,7 +640,8 @@ fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
cbi->event->type != NSFB_EVENT_KEY_UP) cbi->event->type != NSFB_EVENT_KEY_UP)
return 0; return 0;
LOG("browser window clicked at %d,%d", cbi->x, cbi->y); NSLOG(netsurf, INFO, "browser window clicked at %d,%d", cbi->x,
cbi->y);
switch (cbi->event->type) { switch (cbi->event->type) {
case NSFB_EVENT_KEY_DOWN: case NSFB_EVENT_KEY_DOWN:
@ -824,7 +826,7 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static fbtk_modifier_type modifier = FBTK_MOD_CLEAR; static fbtk_modifier_type modifier = FBTK_MOD_CLEAR;
int ucs4 = -1; int ucs4 = -1;
LOG("got value %d", cbi->event->value.keycode); NSLOG(netsurf, INFO, "got value %d", cbi->event->value.keycode);
switch (cbi->event->type) { switch (cbi->event->type) {
case NSFB_EVENT_KEY_DOWN: case NSFB_EVENT_KEY_DOWN:
@ -1200,7 +1202,7 @@ create_toolbar(struct gui_window *gw,
toolbar_layout = NSFB_TOOLBAR_DEFAULT_LAYOUT; toolbar_layout = NSFB_TOOLBAR_DEFAULT_LAYOUT;
} }
LOG("Using toolbar layout %s", toolbar_layout); NSLOG(netsurf, INFO, "Using toolbar layout %s", toolbar_layout);
itmtype = toolbar_layout; itmtype = toolbar_layout;
@ -1234,7 +1236,7 @@ create_toolbar(struct gui_window *gw,
(*itmtype != 0) && (*itmtype != 0) &&
(xdir !=0)) { (xdir !=0)) {
LOG("toolbar adding %c", *itmtype); NSLOG(netsurf, INFO, "toolbar adding %c", *itmtype);
switch (*itmtype) { switch (*itmtype) {
@ -1376,7 +1378,9 @@ create_toolbar(struct gui_window *gw,
default: default:
widget = NULL; widget = NULL;
xdir = 0; xdir = 0;
LOG("Unknown element %c in toolbar layout", *itmtype); NSLOG(netsurf, INFO,
"Unknown element %c in toolbar layout",
*itmtype);
break; break;
} }
@ -1385,7 +1389,7 @@ create_toolbar(struct gui_window *gw,
xpos += (xdir * (fbtk_get_width(widget) + padding)); xpos += (xdir * (fbtk_get_width(widget) + padding));
} }
LOG("xpos is %d", xpos); NSLOG(netsurf, INFO, "xpos is %d", xpos);
itmtype += xdir; itmtype += xdir;
} }
@ -1595,7 +1599,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
int statusbar_width = 0; int statusbar_width = 0;
int toolbar_height = nsoption_int(fb_toolbar_size); int toolbar_height = nsoption_int(fb_toolbar_size);
LOG("Normal window"); NSLOG(netsurf, INFO, "Normal window");
gw->window = fbtk_create_window(fbtk, 0, 0, 0, 0, 0); gw->window = fbtk_create_window(fbtk, 0, 0, 0, 0, 0);
@ -1626,7 +1630,8 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
false); false);
fbtk_set_handler(gw->status, FBTK_CBT_POINTERENTER, set_ptr_default_move, NULL); fbtk_set_handler(gw->status, FBTK_CBT_POINTERENTER, set_ptr_default_move, NULL);
LOG("status bar %p at %d,%d", gw->status, fbtk_get_absx(gw->status), fbtk_get_absy(gw->status)); NSLOG(netsurf, INFO, "status bar %p at %d,%d", gw->status,
fbtk_get_absx(gw->status), fbtk_get_absy(gw->status));
/* create horizontal scrollbar */ /* create horizontal scrollbar */
gw->hscroll = fbtk_create_hscroll(gw->window, gw->hscroll = fbtk_create_hscroll(gw->window,
@ -2183,7 +2188,7 @@ main(int argc, char** argv)
/* create an initial browser window */ /* create an initial browser window */
LOG("calling browser_window_create"); NSLOG(netsurf, INFO, "calling browser_window_create");
ret = nsurl_create(feurl, &url); ret = nsurl_create(feurl, &url);
if (ret == NSERROR_OK) { if (ret == NSERROR_OK) {
@ -2205,7 +2210,7 @@ main(int argc, char** argv)
netsurf_exit(); netsurf_exit();
if (fb_font_finalise() == false) if (fb_font_finalise() == false)
LOG("Font finalisation failed."); NSLOG(netsurf, INFO, "Font finalisation failed.");
/* finalise options */ /* finalise options */
nsoption_finalise(nsoptions, nsoptions_default); nsoption_finalise(nsoptions, nsoptions_default);

View File

@ -203,12 +203,14 @@ void list_schedule(void)
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
LOG("schedule list at %ld:%ld", tv.tv_sec, tv.tv_usec); NSLOG(netsurf, INFO, "schedule list at %ld:%ld", tv.tv_sec,
tv.tv_usec);
cur_nscb = schedule_list; cur_nscb = schedule_list;
while (cur_nscb != NULL) { while (cur_nscb != NULL) {
LOG("Schedule %p at %ld:%ld", cur_nscb, cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); NSLOG(netsurf, INFO, "Schedule %p at %ld:%ld", cur_nscb,
cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec);
cur_nscb = cur_nscb->next; cur_nscb = cur_nscb->next;
} }
} }

View File

@ -164,8 +164,9 @@ static void nsgtk_cookies_init_menu(struct nsgtk_cookie_window *ncwin)
w = GTK_WIDGET(gtk_builder_get_object(ncwin->builder, w = GTK_WIDGET(gtk_builder_get_object(ncwin->builder,
event->widget)); event->widget));
if (w == NULL) { if (w == NULL) {
LOG("Unable to connect menu widget ""%s""", NSLOG(netsurf, INFO,
event->widget); "Unable to connect menu widget ""%s""",
event->widget);
} else { } else {
g_signal_connect(G_OBJECT(w), g_signal_connect(G_OBJECT(w),
"activate", "activate",
@ -253,7 +254,7 @@ static nserror nsgtk_cookies_init(void)
res = nsgtk_builder_new_from_resname("cookies", &ncwin->builder); res = nsgtk_builder_new_from_resname("cookies", &ncwin->builder);
if (res != NSERROR_OK) { if (res != NSERROR_OK) {
LOG("Cookie UI builder init failed"); NSLOG(netsurf, INFO, "Cookie UI builder init failed");
free(ncwin); free(ncwin);
return res; return res;
} }

Some files were not shown because too many files have changed in this diff Show More