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;
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));
if (user_sentinel == NULL) {
@ -272,7 +273,8 @@ void content_convert(struct content *c)
if (c->locked == true)
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) {
c->locked = true;
@ -376,7 +378,8 @@ void content_destroy(struct content *c)
struct content_rfc5988_link *link;
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);
if (c->handler->destroy != NULL)
@ -585,7 +588,7 @@ bool content_scaled_redraw(struct hlcache_handle *h,
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) {
knockout_plot_start(ctx, &new_ctx);
@ -654,7 +657,9 @@ bool content_add_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));
if (!user)
return false;
@ -687,7 +692,9 @@ void content_remove_user(
void *pw)
{
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 */
for (user = c->user_list; user->next != 0 &&
@ -695,7 +702,7 @@ void content_remove_user(
user->next->pw == pw); user = user->next)
;
if (user->next == 0) {
LOG("user not found in list");
NSLOG(netsurf, INFO, "user not found in list");
assert(0);
return;
}
@ -808,7 +815,8 @@ void content_open(hlcache_handle *h, struct browser_window *bw,
{
struct content *c = hlcache_handle_get_content(h);
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)
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);
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)
c->handler->close(c);
}
@ -1472,7 +1481,7 @@ nserror content__clone(const struct content *c, struct content *nc)
*/
nserror content_abort(struct content *c)
{
LOG("Aborting %p", c);
NSLOG(netsurf, INFO, "Aborting %p", c);
if (c->handler->stop != NULL)
c->handler->stop(c);

View File

@ -217,14 +217,16 @@ static void dump_rings(void)
q = queue_ring;
if (q) {
do {
LOG("queue_ring: %s", nsurl_access(q->url));
NSLOG(netsurf, INFO, "queue_ring: %s",
nsurl_access(q->url));
q = q->r_next;
} while (q != queue_ring);
}
f = fetch_ring;
if (f) {
do {
LOG("fetch_ring: %s", nsurl_access(f->url));
NSLOG(netsurf, INFO, "fetch_ring: %s",
nsurl_access(f->url));
f = f->r_next;
} while (f != fetch_ring);
}
@ -341,7 +343,10 @@ void fetcher_quit(void)
* the reference count to allow the fetcher to
* 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;
}
@ -753,9 +758,9 @@ void fetch_remove_from_queues(struct fetch *fetch)
RING_GETSIZE(struct fetch, fetch_ring, all_active);
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
}

View File

@ -155,7 +155,8 @@ static void ns_X509_free(X509 *cert)
*/
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++;
return true; /* Always succeeds */
}
@ -171,17 +172,20 @@ static void fetch_curl_finalise(lwc_string *scheme)
struct cache_handle *h;
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) {
CURLMcode codem;
/* 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);
codem = curl_multi_cleanup(fetch_curl_multi);
if (codem != CURLM_OK)
LOG("curl_multi_cleanup failed: ignoring");
NSLOG(netsurf, INFO,
"curl_multi_cleanup failed: ignoring");
curl_global_cleanup();
}
@ -251,7 +255,9 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
"application/octet-stream",
CURLFORM_END);
if (code != CURL_FORMADD_OK)
LOG("curl_formadd: %d (%s)", code, control->name);
NSLOG(netsurf, INFO,
"curl_formadd: %d (%s)", code,
control->name);
} else {
char *mimetype = guit->fetch->mimetype(control->value);
code = curl_formadd(&post, &last,
@ -262,7 +268,11 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
(mimetype != 0 ? mimetype : "text/plain"),
CURLFORM_END);
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(leafname);
@ -273,7 +283,9 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
CURLFORM_COPYCONTENTS, control->value,
CURLFORM_END);
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;
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 */
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;
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) {
f->abort = true;
} else {
@ -796,7 +808,7 @@ static void fetch_curl_stop(struct curl_fetch_info *f)
CURLMcode codem;
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) {
/* remove from curl multi handle */
@ -864,7 +876,7 @@ static bool fetch_curl_process_headers(struct curl_fetch_info *f)
assert(code == CURLE_OK);
}
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) {
/* 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) */
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.data.redirect = f->location;
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);
abort_fetch = f->abort;
LOG("done %s", nsurl_access(f->url));
NSLOG(netsurf, INFO, "done %s", nsurl_access(f->url));
if ((abort_fetch == false) &&
(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));
cert = true;
} else {
LOG("Unknown cURL response code %d", result);
NSLOG(netsurf, INFO, "Unknown cURL response code %d", result);
error = true;
}
@ -1146,7 +1158,8 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
&exc_fd_set, &max_fd);
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++) {
bool read = false;
bool write = false;
@ -1162,10 +1175,10 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
error = true;
}
if (read || write || error) {
LOG(" fd %i: %s %s %s", i,
read ? "read" : " ",
write ? "write" : " ",
error ? "error" : " ");
NSLOG(netsurf, INFO, " fd %i: %s %s %s", i,
read ? "read" : " ",
write ? "write" : " ",
error ? "error" : " ");
}
}
}
@ -1174,7 +1187,8 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
do {
codem = curl_multi_perform(fetch_curl_multi, &running);
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));
return;
}
@ -1336,7 +1350,7 @@ fetch_curl_header(char *data, size_t size, size_t nmemb, void *_f)
free(f->location);
f->location = malloc(size);
if (!f->location) {
LOG("malloc failed");
NSLOG(netsurf, INFO, "malloc failed");
return size;
}
SKIP_ST(9);
@ -1427,17 +1441,17 @@ nserror fetch_curl_register(void)
.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);
if (code != CURLE_OK) {
LOG("curl_global_init failed.");
NSLOG(netsurf, INFO, "curl_global_init failed.");
return NSERROR_INIT_FAILED;
}
fetch_curl_multi = curl_multi_init();
if (!fetch_curl_multi) {
LOG("curl_multi_init failed.");
NSLOG(netsurf, INFO, "curl_multi_init failed.");
return NSERROR_INIT_FAILED;
}
@ -1465,7 +1479,7 @@ nserror fetch_curl_register(void)
*/
fetch_blank_curl = curl_easy_init();
if (!fetch_blank_curl) {
LOG("curl_easy_init failed");
NSLOG(netsurf, INFO, "curl_easy_init failed");
return NSERROR_INIT_FAILED;
}
@ -1497,11 +1511,12 @@ nserror fetch_curl_register(void)
if (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));
}
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));
}
@ -1513,7 +1528,8 @@ nserror fetch_curl_register(void)
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 */
@ -1532,19 +1548,21 @@ nserror fetch_curl_register(void)
}
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;
curl_easy_setopt_failed:
LOG("curl_easy_setopt failed.");
NSLOG(netsurf, INFO, "curl_easy_setopt failed.");
return NSERROR_INIT_FAILED;
#if LIBCURL_VERSION_NUM >= 0x071e00
curl_multi_setopt_failed:
LOG("curl_multi_setopt failed.");
NSLOG(netsurf, INFO, "curl_multi_setopt failed.");
return NSERROR_INIT_FAILED;
#endif
}

View File

@ -57,14 +57,16 @@ static struct fetch_data_context *ring = NULL;
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;
}
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)
@ -147,7 +149,7 @@ static bool fetch_data_process(struct fetch_data_context *c)
* data must still be there.
*/
LOG("url: %.140s", c->url);
NSLOG(netsurf, INFO, "url: %.140s", c->url);
if (strlen(c->url) < 6) {
/* 6 is the minimum possible length (data:,) */
@ -259,8 +261,10 @@ static void fetch_data_poll(lwc_string *scheme)
char header[64];
fetch_set_http_code(c->parent_fetch, 200);
LOG("setting data: MIME type to %s, length to %" PRIsizet,
c->mimetype, c->datalen);
NSLOG(netsurf, INFO,
"setting data: MIME type to %s, length to %"PRIsizet,
c->mimetype,
c->datalen);
/* Any callback can result in the fetch being aborted.
* Therefore, we _must_ check for this after _every_
* call to fetch_data_send_callback().
@ -296,7 +300,8 @@ static void fetch_data_poll(lwc_string *scheme)
fetch_data_send_callback(&msg, c);
}
} 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,
* then fetch_data_process() is broken.

View File

@ -276,14 +276,16 @@ static bool fetch_resource_initialise(lwc_string *scheme)
&e->data,
&e->data_len);
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++;
} else {
e->redirect_url = guit->fetch->get_resource_url(fetch_resource_paths[i]);
if (e->redirect_url == NULL) {
lwc_string_unref(e->path);
} 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++;
}
}

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

View File

@ -321,9 +321,11 @@ static css_error nscss_convert_css_data(struct content_css_data *c)
const char *url;
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 {
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);
#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
c->import_count++;
@ -621,7 +625,7 @@ nserror nscss_import(hlcache_handle *handle,
css_error error = CSS_OK;
#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
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);
#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
/* No longer need import context */

View File

@ -1615,7 +1615,7 @@ css_error node_presentational_hint(void *pw, void *node,
}
#ifdef LOG_STATS
LOG("Properties with hints: %i", hint_ctx.len);
NSLOG(netsurf, INFO, "Properties with hints: %i", hint_ctx.len);
#endif
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);
if (error != CSS_OK) {
LOG("Failed creating sheet: %d", error);
NSLOG(netsurf, INFO, "Failed creating sheet: %d", error);
return NULL;
}
error = css_stylesheet_append_data(sheet, data, len);
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);
return NULL;
}
error = css_stylesheet_data_done(sheet);
if (error != CSS_OK) {
LOG("failed completing parse: %d", error);
NSLOG(netsurf, INFO, "failed completing parse: %d", error);
css_stylesheet_destroy(sheet);
return NULL;
}
@ -214,7 +214,8 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_CLONED,
NULL, src, dst, data);
if (error != CSS_OK)
LOG("Failed to clone libcss_node_data.");
NSLOG(netsurf, INFO,
"Failed to clone libcss_node_data.");
break;
case DOM_NODE_RENAMED:
@ -222,7 +223,8 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_MODIFIED,
NULL, src, NULL, data);
if (error != CSS_OK)
LOG("Failed to update libcss_node_data.");
NSLOG(netsurf, INFO,
"Failed to update libcss_node_data.");
break;
case DOM_NODE_IMPORTED:
@ -232,11 +234,12 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_DELETED,
NULL, src, NULL, data);
if (error != CSS_OK)
LOG("Failed to delete libcss_node_data.");
NSLOG(netsurf, INFO,
"Failed to delete libcss_node_data.");
break;
default:
LOG("User data operation not handled.");
NSLOG(netsurf, INFO, "User data operation not handled.");
assert(0);
}
}

View File

@ -160,7 +160,7 @@ static bool nsico_convert(struct content *c)
bmp = ico_find(ico->ico, 255, 255);
if (bmp == NULL) {
/* return error */
LOG("Failed to select icon");
NSLOG(netsurf, INFO, "Failed to select icon");
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);
if (bmp == NULL) {
/* return error */
LOG("Failed to select icon");
NSLOG(netsurf, INFO, "Failed to select icon");
return false;
}
@ -192,7 +192,7 @@ static bool nsico_redraw(struct content *c, struct content_redraw_data *data,
if (bmp_decode(bmp) != BMP_OK) {
return false;
} else {
LOG("Decoding bitmap");
NSLOG(netsurf, INFO, "Decoding 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);
if (bmp == NULL) {
/* return error */
LOG("Failed to select icon");
NSLOG(netsurf, INFO, "Failed to select icon");
return NULL;
}

View File

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

View File

@ -48,10 +48,10 @@ typedef struct nssprite_content {
#define ERRCHK(x) do { \
rosprite_error err = x; \
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; \
} 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; \
} else if (err == ROSPRITE_OK) { \
} else { \

View File

@ -74,7 +74,7 @@ enum nspng_cberr {
*/
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)
{
LOG("%s", error_message);
NSLOG(netsurf, INFO, "%s", error_message);
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->interlace = (interlace == PNG_INTERLACE_ADAM7);
LOG("size %li * %li, rowbytes %" PRIsizet,
(unsigned long)width,
(unsigned long)height,
png_c->rowbytes);
NSLOG(netsurf, INFO, "size %li * %li, rowbytes %"PRIsizet,
(unsigned long)width, (unsigned long)height, png_c->rowbytes);
}
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))) {
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->info = NULL;
@ -350,7 +348,8 @@ static bool nspng_process_data(struct content *c, const char *data,
* up png conversion and signal the content
* 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_c->png = NULL;

View File

@ -68,7 +68,7 @@ static nserror rsvg_create_svg_data(rsvg_content *c)
c->bitmap = 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);
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,
&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);
return false;
}
@ -160,7 +161,8 @@ static bool rsvg_convert(struct content *c)
GError *err = NULL;
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);
return false;
}
@ -177,7 +179,8 @@ static bool rsvg_convert(struct content *c)
if ((d->bitmap = guit->bitmap->create(c->width, c->height,
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);
return false;
}
@ -187,13 +190,15 @@ static bool rsvg_convert(struct content *c)
CAIRO_FORMAT_ARGB32,
c->width, c->height,
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);
return false;
}
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);
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);
/* ... obj args prototab {proto/undefined} */
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_push_string(ctx, PROTO_NAME(HTMLUNKNOWNELEMENT));
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 */
duk_pop_2(ctx);
/* ... initfn obj[proto] args */
LOG("Call the init function");
NSLOG(netsurf, INFO, "Call the init function");
duk_call(ctx, nargs + 1);
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 ret;
LOG("name=%s nargs=%d", name+2, args);
NSLOG(netsurf, INFO, "name=%s nargs=%d", name + 2, args);
/* ... args */
duk_push_object(ctx);
/* ... 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))
!= DUK_EXEC_SUCCESS)
return ret;
LOG("created");
NSLOG(netsurf, INFO, "created");
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)
!= DUK_EXEC_SUCCESS) {
duk_set_top(ctx, top_at_fail);
LOG("Boo and also hiss");
NSLOG(netsurf, INFO, "Boo and also hiss");
return false;
}
/* ... 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);
if (err != DOM_NO_ERR) {
/* Feck it, element */
LOG("dom_node_get_namespace() failed");
NSLOG(netsurf, INFO,
"dom_node_get_namespace() failed");
duk_push_string(ctx, PROTO_NAME(ELEMENT));
break;
}
if (namespace == NULL) {
/* No namespace, -> element */
LOG("no namespace");
NSLOG(netsurf, INFO, "no namespace");
duk_push_string(ctx, PROTO_NAME(ELEMENT));
break;
}
@ -561,7 +563,7 @@ nserror js_newcontext(int timeout, jscallback *cb, void *cbctx,
duk_context *ctx;
jscontext *ret = calloc(1, sizeof(*ret));
*jsctx = NULL;
LOG("Creating new duktape javascript context");
NSLOG(netsurf, INFO, "Creating new duktape javascript context");
if (ret == NULL) return NSERROR_NOMEM;
ctx = ret->ctx = duk_create_heap(
dukky_alloc_function,
@ -584,7 +586,7 @@ nserror js_newcontext(int timeout, jscallback *cb, void *cbctx,
void js_destroycontext(jscontext *ctx)
{
LOG("Destroying duktape javascript context");
NSLOG(netsurf, INFO, "Destroying duktape javascript context");
duk_destroy_heap(ctx->ctx);
free(ctx);
}
@ -593,7 +595,9 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv)
{
assert(ctx != NULL);
/* 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_push_thread(ctx->ctx);
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, "lineNumber");
duk_get_prop_string(CTX, 0, "stack");
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(CTX, 1),
duk_safe_to_string(CTX, 2));
LOG(" was at: %s line %s", 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, "Uncaught error in JS: %s: %s",
duk_safe_to_string(CTX, 1), duk_safe_to_string(CTX, 2));
NSLOG(netsurf, INFO, " was at: %s line %s",
duk_safe_to_string(CTX, 3), duk_safe_to_string(CTX, 4));
NSLOG(netsurf, INFO, " Stack trace: %s",
duk_safe_to_string(CTX, 5));
return 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);
}
@ -782,7 +788,8 @@ bool dukky_get_current_value_of_event_handler(duk_context *ctx,
/* ... node fullhandlersrc filename */
if (duk_pcompile(ctx, DUK_COMPILE_FUNCTION) != 0) {
/* ... 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);
return false;
}
@ -816,29 +823,27 @@ static void dukky_generic_event_handler(dom_event *evt, void *pw)
duk_get_memory_functions(ctx, &funcs);
jsctx = funcs.udata;
LOG("WOOP WOOP, An event:");
NSLOG(netsurf, INFO, "WOOP WOOP, An event:");
exc = dom_event_get_type(evt, &name);
if (exc != DOM_NO_ERR) {
LOG("Unable to find the event name");
NSLOG(netsurf, INFO, "Unable to find the event name");
return;
}
LOG("Event's name is %*s",
dom_string_length(name), dom_string_data(name));
NSLOG(netsurf, INFO, "Event's name is %*s", dom_string_length(name),
dom_string_data(name));
exc = dom_event_get_event_phase(evt, &phase);
if (exc != DOM_NO_ERR) {
LOG("Unable to get event phase");
NSLOG(netsurf, INFO, "Unable to get event phase");
return;
}
LOG("Event phase is: %s (%d)",
phase == DOM_CAPTURING_PHASE ? "capturing" :
phase == DOM_AT_TARGET ? "at-target" :
phase == DOM_BUBBLING_PHASE ? "bubbling" :
"unknown", (int)phase);
NSLOG(netsurf, INFO, "Event phase is: %s (%d)",
phase == DOM_CAPTURING_PHASE ? "capturing" : phase == DOM_AT_TARGET ? "at-target" : phase == DOM_BUBBLING_PHASE ? "bubbling" : "unknown",
(int)phase);
exc = dom_event_get_current_target(evt, &targ);
if (exc != DOM_NO_ERR) {
dom_string_unref(name);
LOG("Unable to find the event target");
NSLOG(netsurf, INFO, "Unable to find the event target");
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) {
dom_string_unref(name);
dom_node_unref(targ);
LOG("Unable to push JS node representation?!");
NSLOG(netsurf, INFO,
"Unable to push JS node representation?!");
return;
}
/* ... node */
@ -868,21 +874,26 @@ static void dukky_generic_event_handler(dom_event *evt, void *pw)
if (duk_pcall_method(ctx, 1) != 0) {
/* Failed to run the method */
/* ... 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);
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, -2, "message");
duk_get_prop_string(ctx, -3, "fileName");
duk_get_prop_string(ctx, -4, "lineNumber");
duk_get_prop_string(ctx, -5, "stack");
/* ... err name message fileName lineNumber stack */
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(ctx, -5),
duk_safe_to_string(ctx, -4));
LOG(" was at: %s line %s", duk_safe_to_string(ctx, -3),
duk_safe_to_string(ctx, -2));
LOG(" Stack trace: %s", duk_safe_to_string(ctx, -1));
NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(ctx, -5),
duk_safe_to_string(ctx, -4));
NSLOG(netsurf, INFO, " 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, 6);
/* ... */
@ -962,21 +973,27 @@ handle_extras:
if (duk_pcall_method(ctx, 1) != 0) {
/* Failed to run the method */
/* ... 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);
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, -2, "message");
duk_get_prop_string(ctx, -3, "fileName");
duk_get_prop_string(ctx, -4, "lineNumber");
duk_get_prop_string(ctx, -5, "stack");
/* ... err name message fileName lineNumber stack */
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(ctx, -5),
duk_safe_to_string(ctx, -4));
LOG(" was at: %s line %s", duk_safe_to_string(ctx, -3),
duk_safe_to_string(ctx, -2));
LOG(" Stack trace: %s", duk_safe_to_string(ctx, -1));
NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(ctx, -5),
duk_safe_to_string(ctx, -4));
NSLOG(netsurf, INFO,
" 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);
/* ... copy */
@ -1034,11 +1051,12 @@ void dukky_register_event_listener_for(duk_context *ctx,
exc = dom_event_target_add_event_listener(
ele, name, listen, capture);
if (exc != DOM_NO_ERR) {
LOG("Unable to register listener for %p.%*s",
ele, dom_string_length(name), dom_string_data(name));
NSLOG(netsurf, INFO,
"Unable to register listener for %p.%*s", ele,
dom_string_length(name), dom_string_data(name));
} else {
LOG("have registered listener for %p.%*s",
ele, dom_string_length(name), dom_string_data(name));
NSLOG(netsurf, INFO, "have registered listener for %p.%*s",
ele, dom_string_length(name), dom_string_data(name));
}
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_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
* 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) {
/* Failed to run the handler */
/* ... 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, -2, "message");
duk_get_prop_string(CTX, -3, "fileName");
duk_get_prop_string(CTX, -4, "lineNumber");
duk_get_prop_string(CTX, -5, "stack");
/* ... err name message fileName lineNumber stack */
LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(CTX, -5),
duk_safe_to_string(CTX, -4));
LOG(" was at: %s line %s", duk_safe_to_string(CTX, -3),
duk_safe_to_string(CTX, -2));
LOG(" Stack trace: %s", duk_safe_to_string(CTX, -1));
NSLOG(netsurf, INFO, "Uncaught error in JS: %s: %s",
duk_safe_to_string(CTX, -5),
duk_safe_to_string(CTX, -4));
NSLOG(netsurf, INFO, " 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, 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);
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++;
}
LOG("%d contents remain before cache drain", num_contents);
NSLOG(netsurf, INFO, "%d contents remain before cache drain",
num_contents);
/* Drain cache */
do {
@ -580,14 +581,17 @@ void hlcache_finalise(void)
}
} 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) {
hlcache_handle entry_handle = { entry, NULL, 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 {
LOG(" %p", entry);
NSLOG(netsurf, INFO, " %p", entry);
}
}
@ -615,12 +619,13 @@ void hlcache_finalise(void)
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);
hlcache = NULL;
LOG("Finalising low-level cache");
NSLOG(netsurf, INFO, "Finalising low-level cache");
llcache_finalise();
}

View File

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

View File

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

View File

@ -171,7 +171,7 @@ browser_window_redraw(struct browser_window *bw,
nserror res;
if (bw == NULL) {
LOG("NULL browser window");
NSLOG(netsurf, INFO, "NULL browser window");
return false;
}
@ -336,7 +336,7 @@ browser_window_redraw(struct browser_window *bw,
bool browser_window_redraw_ready(struct browser_window *bw)
{
if (bw == NULL) {
LOG("NULL browser window");
NSLOG(netsurf, INFO, "NULL browser window");
return false;
} else if (bw->current_content != NULL) {
/* 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->y = y;
} else {
LOG("Asked to set position of front end window.");
NSLOG(netsurf, INFO,
"Asked to set position of front end window.");
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 int count = 0;
LOG("Continuing execution %d", count);
NSLOG(netsurf, INFO, "Continuing execution %d", count);
count++;
if (count > 1) {
count = 0;
@ -982,11 +983,12 @@ browser_window_download(struct browser_window *bw,
/* no internal handler for this type, call out to frontend */
error = guit->misc->launch_url(url);
} else if (error != NSERROR_OK) {
LOG("Failed to fetch download: %d", error);
NSLOG(netsurf, INFO, "Failed to fetch download: %d", error);
} else {
error = download_context_create(l, root->window);
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_release(l);
}
@ -1114,7 +1116,8 @@ browser_window_favicon_callback(hlcache_handle *c,
error = nsurl_create("resource:favicon.ico", &nsurl);
if (error != NSERROR_OK) {
LOG("Unable to create default location url");
NSLOG(netsurf, INFO,
"Unable to create default location url");
} else {
hlcache_handle_retrieve(nsurl,
HLCACHE_RETRIEVE_SNIFF_TYPE,
@ -1204,7 +1207,8 @@ browser_window_update_favicon(hlcache_handle *c,
error = nsurl_create("resource:favicon.ico", &nsurl);
}
if (error != NSERROR_OK) {
LOG("Unable to create default location url");
NSLOG(netsurf, INFO,
"Unable to create default location url");
return;
}
} else {
@ -1212,9 +1216,11 @@ browser_window_update_favicon(hlcache_handle *c,
}
if (link == NULL) {
LOG("fetching general favicon from '%s'", nsurl_access(nsurl));
NSLOG(netsurf, INFO, "fetching general favicon from '%s'",
nsurl_access(nsurl));
} 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,
@ -1811,7 +1817,7 @@ static void browser_window_destroy_internal(struct browser_window *bw)
{
assert(bw);
LOG("Destroying window");
NSLOG(netsurf, INFO, "Destroying window");
if (bw->children != NULL || bw->iframes != NULL) {
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
* 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);
/* 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->status.text);
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(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 */
for (cur = bw; cur->parent; cur = cur->parent) {
depth++;
}
if (depth > FRAME_DEPTH) {
LOG("frame depth too high.");
NSLOG(netsurf, INFO, "frame depth too high.");
return NSERROR_FRAME_DEPTH;
}
@ -2103,7 +2111,7 @@ browser_window_navigate(struct browser_window *bw,
browser_window_remove_caret(bw, false);
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"));
bw->history_add = (flags & BW_NAVIGATE_HISTORY);
@ -2319,7 +2327,8 @@ void browser_window_set_dimensions(struct browser_window *bw,
bw->width = width;
bw->height = height;
} else {
LOG("Asked to set dimensions of front end window.");
NSLOG(netsurf, INFO,
"Asked to set dimensions of front end window.");
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);
if (!new_history->start) {
LOG("Insufficient memory to clone history");
NSLOG(netsurf, INFO, "Insufficient memory to clone history");
browser_window_history_destroy(clone);
clone->history = NULL;
return NSERROR_NOMEM;
@ -351,7 +351,8 @@ nserror browser_window_history_add(struct browser_window *bw,
* loading */
bitmap = urldb_get_thumbnail(nsurl);
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_NEW | BITMAP_CLEAR_MEMORY |
BITMAP_OPAQUE);
@ -366,7 +367,7 @@ nserror browser_window_history_add(struct browser_window *bw,
/* Thumbnailing failed. Ignore it
* silently but clean up bitmap.
*/
LOG("Thumbnail renderfailed");
NSLOG(netsurf, INFO, "Thumbnail renderfailed");
guit->bitmap->destroy(bitmap);
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);
} 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;
}
LOG("Generating cookie manager data");
NSLOG(netsurf, INFO, "Generating cookie manager data");
/* Init. cookie manager treeview 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 */
treeview_get_height(cm_ctx.tree);
LOG("Generated cookie manager data");
NSLOG(netsurf, INFO, "Generated cookie manager data");
return NSERROR_OK;
}
@ -837,7 +838,7 @@ nserror cookie_manager_fini(void)
int i;
nserror err;
LOG("Finalising cookie manager");
NSLOG(netsurf, INFO, "Finalising cookie manager");
cm_ctx.built = false;
@ -860,7 +861,7 @@ nserror cookie_manager_fini(void)
return err;
}
LOG("Finalised cookie manager");
NSLOG(netsurf, INFO, "Finalised cookie manager");
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,
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
exit(1);
#endif
@ -143,7 +146,9 @@ bool haru_nsfont_width(const plot_font_style_t *fstyle,
*width = width_real;
#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
free(string_nt);
HPDF_Free(pdf);
@ -201,7 +206,11 @@ bool haru_nsfont_position_in_string(const plot_font_style_t *fstyle,
*actual_x = real_width;
#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
free(string_nt);
HPDF_Free(pdf);
@ -246,7 +255,12 @@ bool haru_nsfont_split(const plot_font_style_t *fstyle,
HPDF_TRUE, &real_width);
#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
*char_offset = offset - 1;
@ -327,7 +341,7 @@ bool haru_nsfont_apply_style(const plot_font_style_t *fstyle,
strcat(font_name, "-Roman");
#ifdef FONT_HARU_DEBUG
LOG("Setting font: %s", font_name);
NSLOG(netsurf, INFO, "Setting font: %s", font_name);
#endif
size = fstyle->size;

View File

@ -354,9 +354,11 @@ nserror browser_window_create_frameset(struct browser_window *bw,
window->parent = bw;
if (window->name)
LOG("Created frame '%s'", window->name);
NSLOG(netsurf, INFO, "Created frame '%s'",
window->name);
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 */
t = time(NULL);
if (t == -1) {
LOG("time info unaviable");
NSLOG(netsurf, INFO, "time info unaviable");
return NSERROR_UNKNOWN;
}
@ -607,7 +607,7 @@ static nserror global_history_initialise_time(void)
full_time->tm_hour = 0;
t = mktime(full_time);
if (t == -1) {
LOG("mktime failed");
NSLOG(netsurf, INFO, "mktime failed");
return NSERROR_UNKNOWN;
}
@ -729,7 +729,7 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
return err;
}
LOG("Loading global history");
NSLOG(netsurf, INFO, "Loading global history");
/* Init. global history treeview 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 */
treeview_get_height(gh_ctx.tree);
LOG("Loaded global history");
NSLOG(netsurf, INFO, "Loaded global history");
return NSERROR_OK;
}
@ -797,7 +797,7 @@ nserror global_history_fini(void)
int i;
nserror err;
LOG("Finalising global history");
NSLOG(netsurf, INFO, "Finalising global history");
gh_ctx.built = false;
@ -815,7 +815,7 @@ nserror global_history_fini(void)
return err;
}
LOG("Finalised global history");
NSLOG(netsurf, INFO, "Finalised global history");
return err;
}
@ -832,7 +832,8 @@ nserror global_history_add(nsurl *url)
data = urldb_get_url_data(url);
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;
}

View File

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

View File

@ -267,7 +267,9 @@ static nserror knockout_plot_flush(const struct redraw_context *ctx)
/* debugging information */
#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
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) {
#ifdef KNOCKOUT_DEBUG
LOG("bad clip rectangle %i %i %i %i",
clip->x0, clip->y0, clip->x1, clip->y1);
NSLOG(netsurf, INFO, "bad clip rectangle %i %i %i %i",
clip->x0, clip->y0, clip->x1, clip->y1);
#endif
return NSERROR_BAD_SIZE;
}

View File

@ -30,5 +30,5 @@
*/
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)
{
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) {
hlcache_parameters.llcache.limit = MINIMUM_MEMORY_CACHE_SIZE;
LOG("Setting minimum memory cache size %" PRIsizet,
hlcache_parameters.llcache.limit);
NSLOG(netsurf, INFO,
"Setting minimum memory cache size %"PRIsizet,
hlcache_parameters.llcache.limit);
}
/* Set up the max attempts made to fetch a timing out resource */
@ -243,19 +245,19 @@ void netsurf_exit(void)
{
hlcache_stop();
LOG("Closing GUI");
NSLOG(netsurf, INFO, "Closing GUI");
guit->misc->quit();
LOG("Finalising JavaScript");
NSLOG(netsurf, INFO, "Finalising JavaScript");
js_finalise();
LOG("Finalising Web Search");
NSLOG(netsurf, INFO, "Finalising Web Search");
search_web_finalise();
LOG("Finalising high-level cache");
NSLOG(netsurf, INFO, "Finalising high-level cache");
hlcache_finalise();
LOG("Closing fetches");
NSLOG(netsurf, INFO, "Closing fetches");
fetcher_quit();
/* dump any remaining cache entries */
@ -264,21 +266,21 @@ void netsurf_exit(void)
/* Clean up after content handlers */
content_factory_fini();
LOG("Closing utf8");
NSLOG(netsurf, INFO, "Closing utf8");
utf8_finalise();
LOG("Destroying URLdb");
NSLOG(netsurf, INFO, "Destroying URLdb");
urldb_destroy();
LOG("Destroying System colours");
NSLOG(netsurf, INFO, "Destroying System colours");
ns_system_colour_finalize();
LOG("Destroying Messages");
NSLOG(netsurf, INFO, "Destroying Messages");
messages_destroy();
corestrings_fini();
LOG("Remaining lwc strings:");
NSLOG(netsurf, INFO, "Remaining lwc strings:");
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);
LOG("New layout applied.New height = %d ; New width = %d ",
content_get_height(content), content_get_width(content));
NSLOG(netsurf, INFO,
"New layout applied.New height = %d ; New width = %d ",
content_get_height(content),
content_get_width(content));
return true;
}

View File

@ -168,7 +168,7 @@ static bool save_complete_save_buffer(save_complete_ctx *ctx,
fp = fopen(fname, "wb");
if (fp == NULL) {
free(fname);
LOG("fopen(): errno = %i", errno);
NSLOG(netsurf, INFO, "fopen(): errno = %i", errno);
guit->misc->warning("SaveError", strerror(errno));
return false;
}
@ -1044,7 +1044,7 @@ static bool save_complete_node_handler(dom_node *node,
} else if (type == DOM_DOCUMENT_NODE) {
/* Do nothing */
} else {
LOG("Unhandled node type: %d", type);
NSLOG(netsurf, INFO, "Unhandled node type: %d", type);
}
return true;
@ -1075,7 +1075,7 @@ static bool save_complete_save_html_document(save_complete_ctx *ctx,
fp = fopen(fname, "wb");
if (fp == NULL) {
free(fname);
LOG("fopen(): errno = %i", errno);
NSLOG(netsurf, INFO, "fopen(): errno = %i", errno);
guit->misc->warning("SaveError", strerror(errno));
return false;
}
@ -1154,7 +1154,7 @@ static bool save_complete_inventory(save_complete_ctx *ctx)
fp = fopen(fname, "w");
free(fname);
if (fp == NULL) {
LOG("fopen(): errno = %i", errno);
NSLOG(netsurf, INFO, "fopen(): errno = %i", errno);
guit->misc->warning("SaveError", strerror(errno));
return false;
}
@ -1182,7 +1182,8 @@ static nserror regcomp_wrapper(regex_t *preg, const char *regex, int cflags)
if (r) {
char errbuf[200];
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_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;
#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
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
int pmaxx = p[0], pmaxy = p[1];
int pminx = p[0], pminy = p[1];
LOG(".");
NSLOG(netsurf, INFO, ".");
#endif
if (n == 0)
return true;
@ -281,7 +282,8 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
}
#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
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)
{
#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
/*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)
{
#ifdef PDF_DEBUG
LOG(". %d %d %.*s", x, y, (int)length, text);
NSLOG(netsurf, INFO, ". %d %d %.*s", x, y, (int)length, text);
#endif
char *word;
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)
{
#ifdef PDF_DEBUG
LOG(".");
NSLOG(netsurf, INFO, ".");
#endif
if (style->fill_type != PLOT_OP_TYPE_NONE) {
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)
{
#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
/* 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;
#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
if (width == 0 || height == 0)
return true;
@ -483,7 +488,8 @@ HPDF_Image pdf_extract_image(struct bitmap *bitmap)
rgb_buffer = (unsigned char *)malloc(3 * img_width * img_height);
alpha_buffer = (unsigned char *)malloc(img_width * img_height);
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(alpha_buffer);
return NULL;
@ -607,7 +613,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
bool empty_path;
#ifdef PDF_DEBUG
LOG(".");
NSLOG(netsurf, INFO, ".");
#endif
if (n == 0)
@ -649,7 +655,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
i += 7;
empty_path = false;
} else {
LOG("bad path command %f", p[i]);
NSLOG(netsurf, INFO, "bad path command %f", p[i]);
return false;
}
}
@ -685,7 +691,7 @@ bool pdf_begin(struct print_settings *print_settings)
HPDF_Free(pdf_doc);
pdf_doc = HPDF_New(error_handler, NULL);
if (!pdf_doc) {
LOG("Error creating pdf_doc");
NSLOG(netsurf, INFO, "Error creating pdf_doc");
return false;
}
@ -708,7 +714,7 @@ bool pdf_begin(struct print_settings *print_settings)
pdf_page = NULL;
#ifdef PDF_DEBUG
LOG("pdf_begin finishes");
NSLOG(netsurf, INFO, "pdf_begin finishes");
#endif
return true;
}
@ -717,7 +723,7 @@ bool pdf_begin(struct print_settings *print_settings)
bool pdf_next_page(void)
{
#ifdef PDF_DEBUG
LOG("pdf_next_page begins");
NSLOG(netsurf, INFO, "pdf_next_page begins");
#endif
clip_update_needed = false;
if (pdf_page != NULL) {
@ -745,7 +751,7 @@ bool pdf_next_page(void)
pdfw_gs_save(pdf_page);
#ifdef PDF_DEBUG
LOG("%f %f", page_width, page_height);
NSLOG(netsurf, INFO, "%f %f", page_width, page_height);
#endif
return true;
@ -755,7 +761,7 @@ bool pdf_next_page(void)
void pdf_end(void)
{
#ifdef PDF_DEBUG
LOG("pdf_end begins");
NSLOG(netsurf, INFO, "pdf_end begins");
#endif
clip_update_needed = false;
if (pdf_page != NULL) {
@ -780,7 +786,7 @@ void pdf_end(void)
else
save_pdf(settings->output);
#ifdef PDF_DEBUG
LOG("pdf_end finishes");
NSLOG(netsurf, INFO, "pdf_end finishes");
#endif
}
@ -819,7 +825,8 @@ nserror save_pdf(const char *path)
static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no,
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
exit(1);
#endif

View File

@ -75,7 +75,8 @@ void save_as_text(struct hlcache_handle *c, char *path)
free(save.block);
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;
}
@ -84,12 +85,13 @@ void save_as_text(struct hlcache_handle *c, char *path)
int res = fputs(result, out);
if (res < 0) {
LOG("Warning: write failed");
NSLOG(netsurf, INFO, "Warning: write failed");
}
res = fputs("\n", out);
if (res < 0) {
LOG("Warning: failed writing trailing newline");
NSLOG(netsurf, INFO,
"Warning: failed writing trailing newline");
}
fclose(out);

View File

@ -289,13 +289,16 @@ search_web_ico_callback(hlcache_handle *ico,
switch (event->type) {
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,
content_get_bitmap(ico));
break;
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:
hlcache_handle_release(ico);
/* clear reference to released handle */
@ -439,7 +442,8 @@ default_ico_callback(hlcache_handle *ico,
switch (event->type) {
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 */
if (ctx->providers[search_web_ctx.current].ico_handle == NULL) {
@ -450,7 +454,9 @@ default_ico_callback(hlcache_handle *ico,
break;
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:
hlcache_handle_release(ico);
/* clear reference to released handle */

View File

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

View File

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

View File

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

View File

@ -173,7 +173,7 @@ void ami_arexx_execute(char *script)
if((lock = Lock(script, ACCESS_READ))) {
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);
UnLock(lock);
}

View File

@ -161,7 +161,10 @@ static void amiga_bitmap_unmap_buffer(void *p)
struct bitmap *bm = p;
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->pixdata = NULL;
}
@ -176,7 +179,10 @@ unsigned char *amiga_bitmap_get_buffer(void *bitmap)
#ifdef __amigaos4__
if(nsoption_bool(use_extmem) == true) {
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);
}
@ -723,7 +729,7 @@ void ami_bitmap_fini(void)
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
{
#ifdef __amigaos4__
LOG("Entering bitmap_render");
NSLOG(netsurf, INFO, "Entering bitmap_render");
int plot_width;
int plot_height;

View File

@ -364,7 +364,7 @@ nserror ami_cookies_present(void)
res = ami_cookies_create_window(ncwin);
if (res != NSERROR_OK) {
LOG("SSL UI builder init failed");
NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle);
free(ncwin);
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(draw == false) {
LOG("Ignoring deferred box redraw queue");
NSLOG(netsurf, INFO, "Ignoring deferred box redraw queue");
} // else should probably show busy pointer
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->objstruct = deferred_rect;
} 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);
}

View File

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

View File

@ -162,7 +162,7 @@ nserror amiga_dt_anim_create(const content_handler *handler,
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;
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;
LOG("amiga_dt_anim_destroy");
NSLOG(netsurf, INFO, "amiga_dt_anim_destroy");
if (plugin->bitmap != NULL)
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;
bitmap_flags_t flags = BITMAPF_NONE;
LOG("amiga_dt_anim_redraw");
NSLOG(netsurf, INFO, "amiga_dt_anim_redraw");
if (data->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,
struct content *page, struct object_params *params)
{
LOG("amiga_dt_anim_open");
NSLOG(netsurf, INFO, "amiga_dt_anim_open");
return;
}
void amiga_dt_anim_close(struct content *c)
{
LOG("amiga_dt_anim_close");
NSLOG(netsurf, INFO, "amiga_dt_anim_close");
return;
}
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;
}
@ -312,7 +312,7 @@ nserror amiga_dt_anim_clone(const struct content *old, struct content **newc)
amiga_dt_anim_content *plugin;
nserror error;
LOG("amiga_dt_anim_clone");
NSLOG(netsurf, INFO, "amiga_dt_anim_clone");
plugin = calloc(1, sizeof(amiga_dt_anim_content));
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)
{
LOG("amiga_dt_picture_cache_convert");
NSLOG(netsurf, INFO, "amiga_dt_picture_cache_convert");
union content_msg_data msg_data;
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)
{
LOG("amiga_dt_picture_convert");
NSLOG(netsurf, INFO, "amiga_dt_picture_convert");
int width, height;
char *title;
@ -256,7 +256,7 @@ nserror amiga_dt_picture_clone(const struct content *old, struct content **newc)
struct content *adt;
nserror error;
LOG("amiga_dt_picture_clone");
NSLOG(netsurf, INFO, "amiga_dt_picture_clone");
adt = calloc(1, sizeof(struct content));
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)
{
LOG("Playing...");
NSLOG(netsurf, INFO, "Playing...");
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;
nserror error;
LOG("amiga_dt_sound_create");
NSLOG(netsurf, INFO, "amiga_dt_sound_create");
plugin = calloc(1, sizeof(amiga_dt_sound_content));
if (plugin == NULL)
@ -146,7 +146,7 @@ nserror amiga_dt_sound_create(const content_handler *handler,
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;
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;
LOG("amiga_dt_sound_destroy");
NSLOG(netsurf, INFO, "amiga_dt_sound_destroy");
DisposeDTObject(plugin->dto);
@ -199,7 +199,7 @@ bool amiga_dt_sound_redraw(struct content *c,
};
struct rect rect;
LOG("amiga_dt_sound_redraw");
NSLOG(netsurf, INFO, "amiga_dt_sound_redraw");
rect.x0 = data->x;
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;
struct object_param *param;
LOG("amiga_dt_sound_open");
NSLOG(netsurf, INFO, "amiga_dt_sound_open");
plugin->immediate = false;
@ -234,7 +234,8 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
{
do
{
LOG("%s = %s", param->name, param->value);
NSLOG(netsurf, INFO, "%s = %s", param->name,
param->value);
if((strcmp(param->name, "autoplay") == 0) &&
(strcmp(param->value, "true") == 0)) plugin->immediate = true;
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;
nserror error;
LOG("amiga_dt_sound_clone");
NSLOG(netsurf, INFO, "amiga_dt_sound_clone");
plugin = calloc(1, sizeof(amiga_dt_sound_content));
if (plugin == NULL)

View File

@ -185,7 +185,7 @@ nserror ami_mime_init(const char *mimefile)
struct nsObject *node;
struct ami_mime_entry *mimeentry;
LOG("mimetypes file: %s", mimefile);
NSLOG(netsurf, INFO, "mimetypes file: %s", mimefile);
if(ami_mime_list == NULL)
ami_mime_list = NewObjList();
@ -642,6 +642,10 @@ void ami_mime_dump(void)
struct ami_mime_entry *mimeentry;
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;
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);
}
@ -79,7 +80,14 @@ void ami_font_setdevicedpi(int id)
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)
{
LOG("Requested font not found: %s", font);
NSLOG(netsurf, INFO, "Requested font not found: %s", font);
if(critical == true) amiga_warn_user("CompError", font);
free(nodedata);
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);
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
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);
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
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);
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
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);
return nodedata;

View File

@ -69,7 +69,10 @@ static void ami_font_cache_cleanup(struct SkipList *skiplist)
SubTime(&curtime, &node->lastused);
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);
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);
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);
}
} while((node=nnode));
@ -146,7 +152,7 @@ struct ami_font_cache_node *ami_font_cache_locate(const char *font)
return nodedata;
}
LOG("Font cache miss: %s (%lx)", font, hash);
NSLOG(netsurf, INFO, "Font cache miss: %s (%lx)", font, hash);
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)
{
LOG("Cleaning up font cache");
NSLOG(netsurf, INFO, "Cleaning up font cache");
ami_schedule(-1, (void *)ami_font_cache_cleanup, ami_font_cache_list);
#ifdef __amigaos4__
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->flags == prev_fstyle->flags) &&
(fstyle->weight == prev_fstyle->weight)) {
LOG("(using current font)");
NSLOG(netsurf, INFO, "(using current 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);
tattr.ta_Name = font;
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);

View File

@ -255,7 +255,8 @@ static ULONG ami_font_scan_font(const char *fontname, lwc_string **glypharray)
#ifdef __amigaos4__
if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) {
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) {
nsoption_set_charp(font_surrogate, (char *)strdup(fontname));
}
@ -292,10 +293,11 @@ static ULONG ami_font_scan_fonts(struct MinList *list,
do {
nnode = (struct nsObject *)GetSucc((struct Node *)node);
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);
total += found;
LOG("Found %ld new glyphs (total = %ld)", found, total);
NSLOG(netsurf, INFO, "Found %ld new glyphs (total = %ld)",
found, total);
font_num++;
} while((node = nnode));
@ -344,7 +346,9 @@ static ULONG ami_font_scan_list(struct MinList *list)
if(node) {
node->dtz_Node.ln_Name = strdup(af[i].af_Attr.ta_Name);
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);
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)
{
@ -423,7 +428,8 @@ void ami_font_scan_save(const char *filename, lwc_string **glypharray)
BPTR fh = 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 parsed using ReadArgs() with the following template:\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);
if(found == 0) {
LOG("Creating new font glyph cache");
NSLOG(netsurf, INFO, "Creating new font glyph cache");
if((list = NewObjList())) {
/* 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)
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);
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);
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);
@ -365,7 +367,7 @@ static bool ami_gui_check_resource(char *fullpath, const char *file)
found = true;
}
if(found) LOG("Found %s", fullpath);
if(found) NSLOG(netsurf, INFO, "Found %s", fullpath);
free(remapped);
return found;
@ -842,7 +844,7 @@ static void ami_openscreen(void)
}
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,
/**\todo specify screen depth */
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(rarray[A_URL]) {
LOG("URL %s specified on command line",
(char *)rarray[A_URL]);
NSLOG(netsurf, INFO,
"URL %s specified on command line",
(char *)rarray[A_URL]);
temp_homepage_url = strdup((char *)rarray[A_URL]); /**\todo allow IDNs */
}
if(rarray[A_USERSDIR]) {
LOG("USERSDIR %s specified on command line",
(char *)rarray[A_USERSDIR]);
NSLOG(netsurf, INFO,
"USERSDIR %s specified on command line",
(char *)rarray[A_USERSDIR]);
users_dir = ASPrintf("%s", rarray[A_USERSDIR]);
}
if(rarray[A_FORCE]) {
LOG("FORCE specified on command line");
NSLOG(netsurf, INFO,
"FORCE specified on command line");
cli_force = true;
}
@ -950,7 +955,7 @@ static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
*/
}
} else {
LOG("ReadArgs failed to parse command line");
NSLOG(netsurf, INFO, "ReadArgs failed to parse command line");
}
FreeArgs(args);
@ -2790,7 +2795,9 @@ static void ami_handle_applib(void)
{
struct ApplicationCustomMsg *applibcustmsg =
(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);
}
@ -2826,7 +2833,7 @@ void ami_get_msg(void)
NULL, (unsigned int *)&signalmask) != -1) {
signal = signalmask;
} else {
LOG("waitselect() returned error");
NSLOG(netsurf, INFO, "waitselect() returned error");
/* \todo Fix Ctrl-C handling.
* WaitSelect() from bsdsocket.library returns -1 if the task was
* 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;
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);
while (CloseScreen(scrn) == FALSE) {
LOG("Waiting for visitor windows to close... (polling)");
NSLOG(netsurf, INFO,
"Waiting for visitor windows to close... (polling)");
Delay(50);
}
@ -3081,11 +3090,11 @@ static void gui_quit(void)
ami_font_fini();
ami_help_free();
LOG("Freeing menu items");
NSLOG(netsurf, INFO, "Freeing menu items");
ami_ctxmenu_free();
ami_menu_free_glyphs();
LOG("Freeing mouse pointers");
NSLOG(netsurf, INFO, "Freeing mouse pointers");
ami_mouse_pointers_free();
ami_file_req_free();
@ -3099,7 +3108,7 @@ static void gui_quit(void)
ami_clipboard_free();
ami_gui_resources_free();
LOG("Closing screen");
NSLOG(netsurf, INFO, "Closing screen");
ami_gui_close_screen(scrn, locked_screen, FALSE);
if(nsscreentitle) FreeVec(nsscreentitle);
}
@ -3109,7 +3118,7 @@ char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail)
STRPTR filename = NULL;
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) {
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->objstruct = deferred_rect;
} 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);
@ -3912,7 +3922,7 @@ gui_window_create(struct browser_window *bw,
ULONG defer_layout = TRUE;
ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY;
LOG("Creating window");
NSLOG(netsurf, INFO, "Creating window");
if (!scrn) ami_openscreenfirst();
@ -4056,7 +4066,7 @@ gui_window_create(struct browser_window *bw,
(strcmp(nsoption_charp(pubscreen_name), "Workbench") == 0))
iconifygadget = TRUE;
LOG("Creating menu");
NSLOG(netsurf, INFO, "Creating menu");
struct Menu *menu = ami_gui_menu_create(g->shared);
NewList(&g->shared->tab_list);
@ -4178,7 +4188,7 @@ gui_window_create(struct browser_window *bw,
BitMapEnd;
}
LOG("Creating window object");
NSLOG(netsurf, INFO, "Creating window object");
g->shared->objects[OID_MAIN] = WindowObj,
WA_ScreenTitle, ami_gui_get_screen_title(),
@ -4456,11 +4466,11 @@ gui_window_create(struct browser_window *bw,
EndWindow;
}
LOG("Opening window");
NSLOG(netsurf, INFO, "Opening window");
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)
{
@ -4796,7 +4806,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
if(draw == true) {
ami_set_pointer(g->shared, GUI_POINTER_WAIT, false);
} else {
LOG("Ignoring deferred box redraw queue");
NSLOG(netsurf, INFO, "Ignoring deferred box redraw queue");
}
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->x1 >= rect->x1) &&
(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));
DelObjectNoFree(node);
/* Don't return - we might find more */
@ -5414,20 +5425,20 @@ Object *ami_gui_splash_open(void)
EndWindow;
if(win_obj == NULL) {
LOG("Splash window object not created");
NSLOG(netsurf, INFO, "Splash window object not created");
return NULL;
}
LOG("Attempting to open splash window...");
NSLOG(netsurf, INFO, "Attempting to open splash window...");
win = RA_OpenWindow(win_obj);
if(win == NULL) {
LOG("Splash window did not open");
NSLOG(netsurf, INFO, "Splash window did not open");
return NULL;
}
if(bm_obj == NULL) {
LOG("BitMap object not created");
NSLOG(netsurf, INFO, "BitMap object not created");
return NULL;
}
@ -5489,14 +5500,14 @@ void ami_gui_splash_close(Object *win_obj)
{
if(win_obj == NULL) return;
LOG("Closing splash window");
NSLOG(netsurf, INFO, "Closing splash window");
DisposeObject(win_obj);
}
static void gui_file_gadget_open(struct gui_window *g, struct hlcache_handle *hl,
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,
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);
current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
}
LOG("User: %s", current_user);
NSLOG(netsurf, INFO, "User: %s", current_user);
if(users_dir == NULL) {
users_dir = ASPrintf("%s", USERS_DIR);
@ -5583,7 +5594,7 @@ static char *ami_gui_get_user_dir(STRPTR current_user)
FreeVec(users_dir);
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)))
UnLock(lock);
@ -5810,7 +5821,7 @@ int main(int argc, char** argv)
AddPart(script, nsoption_charp(arexx_startup), 1024);
ami_arexx_execute(script);
LOG("Entering main loop");
NSLOG(netsurf, INFO, "Entering main loop");
while (!ami_quit) {
ami_get_msg();

View File

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

View File

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

View File

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

View File

@ -563,7 +563,7 @@ nserror ami_hotlist_present(void)
res = ami_hotlist_create_window(ncwin);
if (res != NSERROR_OK) {
LOG("SSL UI builder init failed");
NSLOG(netsurf, INFO, "SSL UI builder init failed");
ami_utf8_free(ncwin->core.wintitle);
free(ncwin);
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)
{
if(sui->sui_slab_index <= 1) {
LOG("clib2 slab usage:");
LOG(" The size of all slabs, in bytes: %ld", sui->sui_slab_size);
LOG(" Number of allocations which are not managed by slabs: %ld",
sui->sui_num_single_allocations);
LOG(" Total number of bytes allocated for memory not managed by slabs: %ld",
sui->sui_total_single_allocation_size);
LOG(" Number of slabs currently in play: %ld", sui->sui_num_slabs);
LOG(" Number of currently unused slabs: %ld", sui->sui_num_empty_slabs);
LOG(" Number of slabs in use which are completely filled with data: %ld",
sui->sui_num_full_slabs);
LOG(" Total number of bytes allocated for all slabs: %ld",
sui->sui_total_slab_allocation_size);
NSLOG(netsurf, INFO, "clib2 slab usage:");
NSLOG(netsurf, INFO,
" The size of all slabs, in bytes: %ld",
sui->sui_slab_size);
NSLOG(netsurf, INFO,
" Number of allocations which are not managed by slabs: %ld",
sui->sui_num_single_allocations);
NSLOG(netsurf, INFO,
" Total number of bytes allocated for memory not managed by slabs: %ld",
sui->sui_total_single_allocation_size);
NSLOG(netsurf, INFO,
" 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);
LOG(" Memory chunk size managed by this slab: %ld", sui->sui_chunk_size);
LOG(" Number of memory chunks that fit in this slab: %ld", sui->sui_num_chunks);
LOG(" Number of memory chunks used in this slab: %ld", sui->sui_num_chunks_used);
NSLOG(netsurf, INFO, "Slab %d", sui->sui_slab_index);
NSLOG(netsurf, INFO, " Memory chunk size managed by this slab: %ld",
sui->sui_chunk_size);
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;
}
@ -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)
{
if(sai->sai_allocation_index <= 1) {
LOG("clib2 allocation usage:");
LOG(" Number of allocations which are not managed by slabs: %ld",
sai->sai_num_single_allocations);
LOG(" Total number of bytes allocated for memory not managed by slabs: %ld",
sai->sai_total_single_allocation_size);
NSLOG(netsurf, INFO, "clib2 allocation usage:");
NSLOG(netsurf, INFO,
" Number of allocations which are not managed by slabs: %ld",
sai->sai_num_single_allocations);
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);
LOG(" Size of this allocation, as requested: %ld", sai->sai_allocation_size);
LOG(" Total size of this allocation, including management data: %ld",
sai->sai_total_allocation_size);
NSLOG(netsurf, INFO, "Alloc %d", sai->sai_allocation_index);
NSLOG(netsurf, INFO, " Size of this allocation, as requested: %ld",
sai->sai_allocation_size);
NSLOG(netsurf, INFO,
" Total size of this allocation, including management data: %ld",
sai->sai_total_allocation_size);
return 0;
}
@ -111,13 +130,13 @@ void ami_memory_slab_dump(BPTR fh)
static void ami_memory_low_mem_handler(void *p)
{
if(low_mem_status == PURGE_STEP1) {
LOG("Purging llcache");
NSLOG(netsurf, INFO, "Purging llcache");
llcache_clean(true);
low_mem_status = PURGE_DONE_STEP1;
}
if(low_mem_status == PURGE_STEP2) {
LOG("Purging unused slabs");
NSLOG(netsurf, INFO, "Purging unused slabs");
__free_unused_slabs();
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;
LOG("%s", message);
NSLOG(netsurf, INFO, "%s", message);
#ifdef __amigaos4__
ret = TimedDosRequesterTags(
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);
if(fh == 0) {
LOG("Unable to open FONT %s", fontpath);
NSLOG(netsurf, INFO, "Unable to open FONT %s", fontpath);
FreeVec(fontpath);
return NULL;
}
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);
Close(fh);
return NULL;
@ -231,7 +231,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
Close(fh);
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);
return NULL;
}
@ -242,7 +242,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
if(p) *p = '.';
if(fh == 0) {
LOG("Unable to open OTAG %s", otagpath);
NSLOG(netsurf, INFO, "Unable to open OTAG %s", otagpath);
FreeVec(otagpath);
return NULL;
}
@ -250,7 +250,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
size = GetFileSize(fh);
buffer = (UBYTE *)malloc(size);
if(buffer == NULL) {
LOG("Unable to allocate memory");
NSLOG(netsurf, INFO, "Unable to allocate memory");
Close(fh);
FreeVec(otagpath);
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' */
struct TagItem *tag = (struct TagItem *)buffer;
if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) {
LOG("Invalid OTAG file");
NSLOG(netsurf, INFO, "Invalid OTAG file");
free(buffer);
FreeVec(otagpath);
return NULL;
@ -277,10 +277,10 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
/* Find OT_Engine and open the font engine */
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);
} else {
LOG("Cannot find OT_Engine tag");
NSLOG(netsurf, INFO, "Cannot find OT_Engine tag");
free(buffer);
FreeVec(otagpath);
return NULL;
@ -289,7 +289,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
BulletBase = (struct BulletBase *)OpenLibrary(fname, 0L);
if(BulletBase == NULL) {
LOG("Unable to open font engine %s", fname);
NSLOG(netsurf, INFO, "Unable to open font engine %s", fname);
free(buffer);
FreeVec(fname);
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));
if(force32bit == false) depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
LOG("Screen depth = %d", depth);
NSLOG(netsurf, INFO, "Screen depth = %d", depth);
#ifdef __amigaos4__
if(depth < 16) {
@ -241,7 +241,8 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit
gg->open_num = -1;
init_layers_count++;
LOG("Layer initialised (total: %d)", init_layers_count);
NSLOG(netsurf, INFO, "Layer initialised (total: %d)",
init_layers_count);
return gg;
}
@ -328,7 +329,8 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
(colr & 0x00ff0000) << 8,
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((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);
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++) {
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) {
LOG("AreaEnd: error");
NSLOG(netsurf, INFO, "AreaEnd: error");
}
return NSERROR_OK;
@ -900,7 +902,7 @@ ami_path(const struct redraw_context *ctx,
}
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;
}
@ -922,7 +924,8 @@ ami_path(const struct redraw_context *ctx,
if (p[i] == PLOTTER_PATH_MOVE) {
if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaMove(glob->rp, p[i+1], p[i+2]) == -1) {
LOG("AreaMove: vector list full");
NSLOG(netsurf, INFO,
"AreaMove: vector list full");
}
} else {
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) {
if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaEnd(glob->rp) == -1) {
LOG("AreaEnd: error");
NSLOG(netsurf, INFO, "AreaEnd: error");
}
} else {
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) {
if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaDraw(glob->rp, p[i+1], p[i+2]) == -1) {
LOG("AreaDraw: vector list full");
NSLOG(netsurf, INFO,
"AreaDraw: vector list full");
}
} else {
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);
if (pstyle->fill_colour != NS_TRANSPARENT) {
if (AreaDraw(glob->rp, p_r.x, p_r.y) == -1) {
LOG("AreaDraw: vector list full");
NSLOG(netsurf, INFO,
"AreaDraw: vector list full");
}
} else {
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;
i += 7;
} 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 */
if (pstyle->fill_colour != NS_TRANSPARENT) {
AreaEnd(glob->rp);

View File

@ -82,7 +82,8 @@ nserror amiga_plugin_hack_init(void)
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(
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)
{
LOG("amiga_plugin_hack_convert");
NSLOG(netsurf, INFO, "amiga_plugin_hack_convert");
content_set_ready(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;
LOG("amiga_plugin_hack_destroy %p", plugin);
NSLOG(netsurf, INFO, "amiga_plugin_hack_destroy %p", plugin);
return;
}
@ -155,7 +156,7 @@ bool amiga_plugin_hack_redraw(struct content *c,
struct rect rect;
nserror res;
LOG("amiga_plugin_hack_redraw");
NSLOG(netsurf, INFO, "amiga_plugin_hack_redraw");
rect.x0 = data->x;
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,
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)
{
@ -201,13 +203,13 @@ void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
void amiga_plugin_hack_close(struct content *c)
{
LOG("amiga_plugin_hack_close");
NSLOG(netsurf, INFO, "amiga_plugin_hack_close");
return;
}
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->height = height;
@ -220,7 +222,7 @@ nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc
amiga_plugin_hack_content *plugin;
nserror error;
LOG("amiga_plugin_hack_clone");
NSLOG(netsurf, INFO, "amiga_plugin_hack_clone");
plugin = calloc(1, sizeof(amiga_plugin_hack_content));
if (plugin == NULL)
@ -267,7 +269,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
if(full_cmd)
{
#ifdef __amigaos4__
LOG("Attempting to execute %s", full_cmd);
NSLOG(netsurf, INFO, "Attempting to execute %s", full_cmd);
in = Open("NIL:", MODE_OLDFILE);
out = Open("NIL:", MODE_NEWFILE);

View File

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

View File

@ -58,7 +58,8 @@ BOOL ami_selectmenu_is_safe(void)
BOOL popupmenu_lib_ok = FALSE;
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))
popupmenu_lib_ok = TRUE;
CloseLibrary(PopupMenuBase);

View File

@ -317,7 +317,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = ami_crtvrfy_create_window(ncwin);
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->sslerr);
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;
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) {
rowstride = bpp * w;
@ -107,10 +109,10 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns
} else {
free(bitmap);
bitmap=NULL;
LOG("Out of memory!");
NSLOG(netsurf, INFO, "Out of memory!");
}
}
LOG("bitmap %p", bitmap);
NSLOG(netsurf, INFO, "bitmap %p", bitmap);
return bitmap;
}
@ -194,7 +196,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return NULL;
}
@ -218,7 +220,7 @@ size_t atari_bitmap_get_rowstride(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return 0;
}
return bm->rowstride;
@ -231,7 +233,7 @@ void atari_bitmap_destroy(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return;
}
@ -272,11 +274,12 @@ static void bitmap_set_opaque(void *bitmap, bool opaque)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
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;
}
@ -293,7 +296,7 @@ static bool bitmap_test_opaque(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return false;
}
@ -305,11 +308,12 @@ static bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) {
if (bm->pixdata[(tst << 2) + 3] != 0xff) {
LOG("bitmap %p has transparency", bm);
NSLOG(netsurf, INFO,
"bitmap %p has transparency", bm);
return false;
}
}
LOG("bitmap %p is opaque", bm);
NSLOG(netsurf, INFO, "bitmap %p is opaque", bm);
return true;
}
@ -320,7 +324,7 @@ bool atari_bitmap_get_opaque(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return false;
}
@ -334,7 +338,7 @@ int atari_bitmap_get_width(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return 0;
}
@ -348,7 +352,7 @@ int atari_bitmap_get_height(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
LOG("NULL bitmap!");
NSLOG(netsurf, INFO, "NULL bitmap!");
return 0;
}
return(bm->height);

View File

@ -81,7 +81,7 @@ static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
assert(ssl_d);
LOG("cw %p", cw);
NSLOG(netsurf, INFO, "cw %p", cw);
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: */
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,
@ -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);
LOG("ucs4: %"PRIu32, ucs4);
NSLOG(netsurf, INFO, "ucs4: %"PRIu32, 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;
OBJECT *toolbar;
LOG("win %p", win);
NSLOG(netsurf, INFO, "win %p", win);
if(ev_out->emo_events & MU_MESAG){
switch (msg[0]) {
case WM_TOOLBAR:
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);
assert(tv);
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) {
/* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview");
NSLOG(netsurf, INFO, "Failed to allocate treeview");
return;
}
@ -280,7 +280,7 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
assert(cvwin->init);
assert(cvwin->window);
LOG("cvwin %p", cvwin);
NSLOG(netsurf, INFO, "cvwin %p", cvwin);
if (atari_treeview_is_open(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;
atari_treeview_delete(cvwin->tv);
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,
struct core_window_callback_table *cb_t)
{
LOG("cw %p",cw);
NSLOG(netsurf, INFO, "cw %p", cw);
return(cookie_manager_init(cb_t, cw));
}
@ -71,7 +71,7 @@ atari_cookie_manager_init_phase2(struct core_window *cw,
static void
atari_cookie_manager_finish(struct core_window *cw)
{
LOG("cw %p",cw);
NSLOG(netsurf, INFO, "cw %p", cw);
cookie_manager_fini();
}
@ -89,7 +89,7 @@ atari_cookie_manager_draw(struct core_window *cw,
static void
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);
}
@ -108,13 +108,13 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{
short retval = 0;
LOG("win %p", win);
NSLOG(netsurf, INFO, "win %p", win);
if (ev_out->emo_events & MU_MESAG) {
switch (msg[0]) {
case WM_TOOLBAR:
LOG("WM_TOOLBAR");
NSLOG(netsurf, INFO, "WM_TOOLBAR");
break;
case WM_CLOSED:
@ -158,7 +158,8 @@ void atari_cookie_manager_init(void)
if (atari_cookie_manager.tv == NULL) {
/* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview");
NSLOG(netsurf, INFO,
"Failed to allocate treeview");
return;
}
@ -209,7 +210,7 @@ void atari_cookie_manager_destroy(void)
atari_treeview_delete(atari_cookie_manager.tv);
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
in the first byte: */
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");
if (fp_tmpfile != NULL){
fwrite(data, size, 1, fp_tmpfile);
@ -306,7 +308,8 @@ void context_popup(struct gui_window * gw, short x, short y)
}
} else {
LOG("Invalid content!");
NSLOG(netsurf, INFO,
"Invalid content!");
}
} else {
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;
const char *addr;
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (nsoption_charp(homepage_url) != NULL) {
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 browser_window * bw ;
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
gw = input_window;
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
const char * filename = file_select(messages_get("OpenFile"), "");
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL )
return;
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
static bool init = true;
bool is_folder=false;
const char * path;
@ -319,7 +319,7 @@ static void __CDECL menu_quit(short item, short title, void *data)
{
short buff[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);
}
@ -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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window != NULL )
browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION);
}
static void __CDECL menu_paste(short item, short title, void *data)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window != NULL )
browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE);
}
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->search) {
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
open_settings();
}
static void __CDECL menu_stop(short item, short title, void *data)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL )
return;
@ -378,7 +378,7 @@ static void __CDECL menu_reload(short item, short title, void *data)
if(input_window == NULL)
return;
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 int state = 0;
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window != null && input_window->root->toolbar != null ){
state = !state;
// 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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (input_window && input_window->browser) {
GRECT rect;
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
html_redraw_debug = !html_redraw_debug;
if( input_window != 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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL )
return;
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL )
return;
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL )
return;
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if( input_window == NULL )
return;
}
static void __CDECL menu_ghistory(short item, short title, void *data)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
atari_global_history_open();
}
static void __CDECL menu_add_bookmark(short item, short title, void *data)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
if (input_window) {
if( browser_window_has_content(input_window->browser->bw) ){
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)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
atari_hotlist_open();
}
static void __CDECL menu_cookies(short item, short title, void *data)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
atari_cookie_manager_open();
}
static void __CDECL menu_vlog(short item, short title, void *data)
{
LOG("%s", __FUNCTION__);
NSLOG(netsurf, INFO, "%s", __FUNCTION__);
verbose_log = !verbose_log;
menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0);
}
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) {
if ((strncmp(" ", &str[i], 2) == 0) && (strlen(&str[i]) > 2)) {
// "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;
is_std_shortcut = true;
break;
}
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 [):
x = i;
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",
str, accel->mod, accel->keycode, accel->ascii);
NSLOG(netsurf, INFO,
"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)
{
LOG("gdw %p", gdw);
NSLOG(netsurf, INFO, "gdw %p", gdw);
if (gdw->status == NSATARI_DOWNLOAD_WORKING) {
download_context_abort(gdw->ctx);
@ -253,7 +253,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
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! */
@ -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);
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;
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 sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start;
LOG("dw %p",dw);
NSLOG(netsurf, INFO, "dw %p", dw);
if (dw->abort == true){
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,
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);
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)
{
LOG("dw %p", dw);
NSLOG(netsurf, INFO, "dw %p", dw);
// TODO: change abort to close
dw->status = NSATARI_DOWNLOAD_COMPLETE;

View File

@ -36,7 +36,7 @@ const char *fetch_filetype(const char *unix_path)
char * res = (char*)"text/html";
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: */
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 );
}

View File

@ -31,7 +31,7 @@ char * local_file_to_url( const char * filename )
#define BACKSLASH 0x5C
char * url;
LOG("in: %s", filename);
NSLOG(netsurf, INFO, "in: %s", filename);
if( strlen(filename) <= 2){
return( NULL );
@ -55,7 +55,7 @@ char * local_file_to_url( const char * filename )
free(fname_local);
LOG("out: %s", url);
NSLOG(netsurf, INFO, "out: %s", url);
return( url );
#undef BACKSLASH
@ -81,10 +81,10 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
{
char *cdir = NULL;
char t[PATH_MAX];
LOG("%s (def: %s)", filename, def);
NSLOG(netsurf, INFO, "%s (def: %s)", filename, def);
strcpy(t, NETSURF_GEM_RESPATH);
strcat(t, filename);
LOG("checking %s", (char *)&t);
NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) {
return buf;
@ -92,7 +92,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
}
strcpy(t, "./");
strcat(t, filename);
LOG("checking %s", (char *)&t);
NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) {
return buf;
@ -104,7 +104,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
strcpy(t, cdir);
strcat(t, "/.netsurf/");
strcat(t, filename);
LOG("checking %s", (char *)&t);
NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0)
return buf;
@ -116,19 +116,19 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
if (gemdos_realpath(cdir, buf) != NULL) {
strcat(buf, "/");
strcat(buf, filename);
LOG("checking %s", (char *)&t);
NSLOG(netsurf, INFO, "checking %s", (char *)&t);
if (access(buf, R_OK) == 0)
return buf;
}
}
if (def[0] == '~') {
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) {
strcpy(buf, t);
}
} else {
LOG("checking %s", (char *)def);
NSLOG(netsurf, INFO, "checking %s", (char *)def);
if (gemdos_realpath(def, buf) == NULL) {
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);
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 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]) {
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]);
break;
@ -195,13 +195,14 @@ gui_window_create(struct browser_window *bw,
gui_window_create_flags flags)
{
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));
if (gw == 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\
|WIDGET_SCROLL);
if (gw->root->win) {
@ -253,7 +254,7 @@ void gui_window_destroy(struct gui_window *gw)
if (gw == NULL)
return;
LOG("%s\n", __FUNCTION__);
NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
if (input_window == gw) {
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;
}
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);
return NSERROR_OK;
@ -771,7 +773,8 @@ static void gui_401login_open(nsurl *url, const char *realm,
char * out = NULL;
bres = login_form_do( url, (char*)realm, &out);
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);
}
if (out != NULL) {
@ -789,7 +792,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void *cbpw)
{
struct sslcert_session_data *data;
LOG("url %s", nsurl_access(url));
NSLOG(netsurf, INFO, "url %s", nsurl_access(url));
// TODO: localize string
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)
{
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;
}
@ -823,7 +827,7 @@ struct gui_window * gui_get_input_window(void)
static void gui_quit(void)
{
LOG("quitting");
NSLOG(netsurf, INFO, "quitting");
struct gui_window *gw = window_list;
struct gui_window *tmp = window_list;
@ -852,9 +856,9 @@ static void gui_quit(void)
rsrc_free();
LOG("Shutting down plotter");
NSLOG(netsurf, INFO, "Shutting down plotter");
plot_finalise();
LOG("done");
NSLOG(netsurf, INFO, "done");
}
/**
@ -866,7 +870,7 @@ process_cmdline(int argc, char** argv)
int opt;
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)) {
@ -959,7 +963,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
/* Set defaults for absent option strings */
nsoption_setnull_charp(cookie_file, strdup("cookies"));
if (nsoption_charp(cookie_file) == NULL) {
LOG("Failed initialising string options");
NSLOG(netsurf, INFO, "Failed initialising string options");
return NSERROR_BAD_PARAMETER;
}
return NSERROR_OK;
@ -976,7 +980,7 @@ static void gui_init(int argc, char** argv)
OBJECT * cursors;
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) {
char msg[1024];
@ -1012,15 +1016,16 @@ static void gui_init(int argc, char** argv)
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP,
cursors, &gem_cursors.help);
LOG("Enabling core select menu");
NSLOG(netsurf, INFO, "Enabling core select menu");
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)) ) {
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)) ) {
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)
die("unable to process command line.\n");
LOG("Initializing NKC...");
NSLOG(netsurf, INFO, "Initializing NKC...");
nkc_init();
LOG("Initializing plotters...");
NSLOG(netsurf, INFO, "Initializing plotters...");
struct redraw_context ctx = {
.interactive = true,
.background_images = true,
@ -1172,18 +1177,18 @@ int main(int argc, char** argv)
ret = messages_add_from_file(messages);
/* common initialisation */
LOG("Initialising core...");
NSLOG(netsurf, INFO, "Initialising core...");
ret = netsurf_init(store);
if (ret != NSERROR_OK) {
die("NetSurf failed to initialise");
}
LOG("Initializing GUI...");
NSLOG(netsurf, INFO, "Initializing GUI...");
gui_init(argc, argv);
graf_mouse( ARROW , NULL);
LOG("Creating initial browser window...");
NSLOG(netsurf, INFO, "Creating initial browser window...");
addr = option_homepage_url;
if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
if (stat(addr, &stat_buf) == 0) {
@ -1205,7 +1210,7 @@ int main(int argc, char** argv)
if (ret != NSERROR_OK) {
atari_warn_user(messages_get_errorcode(ret), 0);
} else {
LOG("Entering Atari event mainloop...");
NSLOG(netsurf, INFO, "Entering Atari event mainloop...");
while (!atari_quit) {
atari_poll();
}
@ -1219,7 +1224,7 @@ int main(int argc, char** argv)
fclose(stdout);
fclose(stderr);
#endif
LOG("exit_gem");
NSLOG(netsurf, INFO, "exit_gem");
exit_gem();
return 0;

View File

@ -39,13 +39,13 @@ static nserror
atari_global_history_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t)
{
LOG("cw %p", cw);
NSLOG(netsurf, INFO, "cw %p", cw);
return(global_history_init(cb_t, cw));
}
static void atari_global_history_finish(struct core_window *cw)
{
LOG("cw %p", cw);
NSLOG(netsurf, INFO, "cw %p", cw);
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)
{
LOG("ucs4: %"PRIu32, ucs4);
NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4);
global_history_keypress(ucs4);
}
@ -67,7 +67,7 @@ atari_global_history_mouse_action(struct core_window *cw,
browser_mouse_state mouse,
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);
}
@ -82,7 +82,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{
short retval = 0;
LOG("win %p", win);
NSLOG(netsurf, INFO, "win %p", win);
if (ev_out->emo_events & MU_MESAG) {
switch (msg[0]) {
@ -134,7 +134,8 @@ void atari_global_history_init(void)
if (atari_global_history.tv == NULL) {
/* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview");
NSLOG(netsurf, INFO,
"Failed to allocate treeview");
return;
}
}
@ -181,7 +182,7 @@ void atari_global_history_destroy(void)
atari_treeview_delete(atari_global_history.tv);
atari_global_history.init = false;
}
LOG("done");
NSLOG(netsurf, INFO, "done");
}
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,
struct core_window_callback_table *cb_t)
{
LOG("cw:%p", cw);
NSLOG(netsurf, INFO, "cw:%p", cw);
return hotlist_manager_init(cb_t, cw);
}
static void atari_hotlist_finish(struct core_window *cw)
{
LOG("cw:%p", cw);
NSLOG(netsurf, INFO, "cw:%p", cw);
hotlist_fini();
}
@ -93,7 +93,7 @@ static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4)
{
//GUIWIN *gemtk_win;
//GRECT area;
LOG("ucs4: %"PRIu32 , ucs4);
NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4);
hotlist_keypress(ucs4);
//gemtk_win = atari_treeview_get_gemtk_window(cw);
//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,
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);
}
@ -123,7 +123,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
GRECT tb_area;
GUIWIN * gemtk_win;
LOG("gw:%p", win);
NSLOG(netsurf, INFO, "gw:%p", win);
tv = (struct atari_treeview_window*) gemtk_wm_get_user_data(win);
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]) {
case WM_TOOLBAR:
LOG("WM_TOOLBAR");
NSLOG(netsurf, INFO, "WM_TOOLBAR");
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 );
}
LOG("Hotlist: %s", (char *)&hl.path);
NSLOG(netsurf, INFO, "Hotlist: %s", (char *)&hl.path);
hotlist_init(hl.path, hl.path);
if( hl.window == NULL ){
@ -224,7 +224,8 @@ void atari_hotlist_init(void)
if (hl.tv == NULL) {
/* handle it properly, clean up previous allocs */
LOG("Failed to allocate treeview");
NSLOG(netsurf, INFO,
"Failed to allocate treeview");
return;
}
@ -276,7 +277,7 @@ void atari_hotlist_destroy(void)
atari_treeview_delete(hl.tv);
hl.init = false;
}
LOG("done");
NSLOG(netsurf, INFO, "done");
}
void atari_hotlist_redraw(void)
@ -299,7 +300,7 @@ void atari_hotlist_add_page( const char * url, const char * title )
return;
if (hotlist_has_url(nsurl)) {
LOG("URL already added as Bookmark");
NSLOG(netsurf, INFO, "URL already added as Bookmark");
nsurl_unref(nsurl);
return;
}

View File

@ -119,14 +119,14 @@ char *gemdos_realpath(const char * path, char * rpath)
return(rpath);
}
LOG("realpath in: %s\n", path);
NSLOG(netsurf, INFO, "realpath in: %s\n", path);
r = realpath(path, work);
if (r != NULL) {
unx2dos((const char *)r, rpath);
LOG("realpath out: %s\n", rpath);
NSLOG(netsurf, INFO, "realpath out: %s\n", rpath);
return(rpath);
} else {
LOG("realpath out: NULL!\n");
NSLOG(netsurf, INFO, "realpath out: NULL!\n");
}
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);
if (error) {
LOG("Could not find font (code %d)\n", error);
NSLOG(netsurf, INFO, "Could not find font (code %d)\n", error);
} else {
error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE);
if (error) {
LOG("Could not select charmap (code %d)\n", error);
NSLOG(netsurf, INFO,
"Could not select charmap (code %d)\n", error);
} else {
for (cidx = 0; cidx < (*face)->num_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;
}
@ -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);
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);
newf = font_faces[FONT_FACE_DEFAULT]; /* use default */
}
@ -292,7 +295,8 @@ static bool ft_font_init(void)
/* freetype library initialise */
error = FT_Init_FreeType( &library );
if (error) {
LOG("Freetype could not initialised (code %d)\n", error);
NSLOG(netsurf, INFO,
"Freetype could not initialised (code %d)\n", error);
return false;
}
@ -311,7 +315,9 @@ static bool ft_font_init(void)
NULL,
&ft_cmanager);
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);
return false;
}
@ -330,7 +336,8 @@ static bool ft_font_init(void)
FONT_PKG_PATH FONT_FILE_SANS
);
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);
FT_Done_FreeType(library);
return false;
@ -688,7 +695,7 @@ int ctor_font_plotter_freetype( FONT_PLOTTER self )
self->draw_glyph = draw_glyph8;
}
LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__);
NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) {
ft_font_init();
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->pixel_pos = pixel_pos;
self->text = text;
LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__);
NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) {
vdih = self->vdi_handle;
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->pixel_pos = pixel_pos;
self->text = text;
LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__);
NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) {
vdih = self->vdi_handle;
}

View File

@ -1628,7 +1628,7 @@ int plot_init(const struct redraw_context *ctx, char *fdrvrname)
short work_out[57];
atari_plot_vdi_handle=graf_handle(&dummy, &dummy, &dummy, &dummy);
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);
if(verbose_log) {
@ -1640,7 +1640,8 @@ int plot_init(const struct redraw_context *ctx, char *fdrvrname)
atari_font_flags, &err);
if (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");
}

View File

@ -105,7 +105,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
switch (msg[0]) {
case WM_REDRAW:
LOG("WM_REDRAW");
NSLOG(netsurf, INFO, "WM_REDRAW");
on_redraw(data->rootwin, msg);
break;
@ -113,7 +113,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_SIZED:
case WM_MOVED:
case WM_FULLED:
LOG("WM_SIZED");
NSLOG(netsurf, INFO, "WM_SIZED");
on_resized(data->rootwin);
break;
@ -132,7 +132,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_TOPPED:
case WM_NEWTOP:
case WM_UNICONIFY:
LOG("WM_TOPPED");
NSLOG(netsurf, INFO, "WM_TOPPED");
gui_set_input_gui_window(data->rootwin->active_gui_window);
//window_restore_active_gui_window(data->rootwin);
// 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
// check if the rootwin is this window...
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(
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
uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta,
(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);
// printf("on_window_key_input: %d\n", retval);
}
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,
&area);
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;
input_window = NULL;
LOG("window: %p, gui_window: %p", rootwin, gw);
NSLOG(netsurf, INFO, "window: %p, gui_window: %p", rootwin, gw);
w = window_list;
// find the next active tab:
while( w != NULL ) {
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);
break;
}
@ -338,7 +342,7 @@ int window_destroy(ROOTWIN *rootwin)
assert(rootwin != NULL);
LOG("%p", rootwin);
NSLOG(netsurf, INFO, "%p", rootwin);
if (gemtk_wm_get_user_data(rootwin->win) != NULL) {
free(gemtk_wm_get_user_data(rootwin->win));
@ -404,7 +408,7 @@ void window_restore_active_gui_window(ROOTWIN *rootwin)
GRECT tb_area;
struct gui_window *gw;
LOG("rootwin %p", rootwin);
NSLOG(netsurf, INFO, "rootwin %p", rootwin);
assert(rootwin->active_gui_window);
@ -499,7 +503,7 @@ void window_set_focus(struct s_gui_win_root *rootwin,
assert(rootwin != NULL);
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.element = element;
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;
LOG("gw %p",gw);
NSLOG(netsurf, INFO, "gw %p", gw);
if (rootwin->active_gui_window != NULL) {
if(rootwin->active_gui_window == gw) {
LOG("nothing to do...");
NSLOG(netsurf, INFO, "nothing to do...");
return;
}
}
@ -576,7 +580,7 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
rootwin->active_gui_window = gw;
if (old_gw != NULL) {
LOG("restoring window...");
NSLOG(netsurf, INFO, "restoring window...");
window_restore_active_gui_window(rootwin);
}
}
@ -651,7 +655,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat)
GRECT area;
OBJECT *obj;
LOG("rootwin %p", rootwin);
NSLOG(netsurf, INFO, "rootwin %p", rootwin);
gw = rootwin->active_gui_window;
bw = gw->browser->bw;
@ -1478,7 +1482,13 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
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);
@ -1500,7 +1510,8 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
if (ret != NSERROR_OK) {
free(buff);
/* 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);
/* no memory */
goto error;

View File

@ -71,7 +71,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
return NSERROR_OK;
}
LOG("removing %p, %p", callback, p);
NSLOG(netsurf, INFO, "removing %p, %p", callback, p);
cur_nscb = schedule_list;
prev_nscb = NULL;
@ -80,7 +80,9 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
if ((cur_nscb->callback == callback) &&
(cur_nscb->p == p)) {
/* 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 */
unlnk_nscb = cur_nscb;
@ -118,7 +120,8 @@ nserror atari_schedule(int ival, void (*callback)(void *p), void *p)
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->p = p;
@ -164,7 +167,9 @@ int schedule_run(void)
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 */
unlnk_nscb->callback(unlnk_nscb->p);
@ -173,7 +178,7 @@ int schedule_run(void)
/* need to deal with callback modifying the list. */
if (schedule_list == NULL) {
LOG("schedule_list == NULL");
NSLOG(netsurf, INFO, "schedule_list == NULL");
return -1; /* no more callbacks scheduled */
}
@ -198,7 +203,8 @@ int schedule_run(void)
/* make rettime relative to now and convert to ms */
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 nexttime;
@ -210,14 +216,15 @@ void list_schedule(void)
{
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;
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;
}
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)
{
LOG("%p set status: %d\n", p, found);
NSLOG(netsurf, INFO, "%p set status: %d\n", p, found);
// 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)
{
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) {
gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS);
} else {
@ -99,7 +99,7 @@ void nsatari_search_set_hourglass(bool active, 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;
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
/* 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;
@ -142,7 +142,7 @@ void nsatari_search_set_back_state(bool active, void *p)
GRECT area;
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
/* 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;
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)
{
if (s != NULL) {
LOG("session %p", s);
NSLOG(netsurf, INFO, "session %p", s);
browser_window_search_clear(s->g->browser->bw);
free(s);
}

View File

@ -172,7 +172,7 @@ static char **read_locales(void)
atari_warn_user("Failed to load locales: %s",buf);
return(NULL);
} else {
LOG("Reading locales from: %s...", buf);
NSLOG(netsurf, INFO, "Reading locales from: %s...", buf);
}
/* Count items: */
@ -980,12 +980,12 @@ void open_settings(void)
void close_settings(void)
{
LOG("closing");
NSLOG(netsurf, INFO, "closing");
gemtk_wm_remove(settings_guiwin);
settings_guiwin = NULL;
wind_close(h_aes_win);
wind_delete(h_aes_win);
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 )
{
LOG("%s\n", __FUNCTION__);
NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
if( s ) {
if( 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 )
{
LOG("%s\n", __FUNCTION__);
NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
if( s ) {
free( s );
}

View File

@ -269,7 +269,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
int i;
struct s_toolbar *t;
LOG("owner %p", owner);
NSLOG(netsurf, INFO, "owner %p", owner);
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.running = false;
LOG("created toolbar: %p, root: %p, textarea: %p, throbber: %p",
t, owner, t->url.textarea, &t->throbber);
NSLOG(netsurf, INFO,
"created toolbar: %p, root: %p, textarea: %p, throbber: %p", t,
owner, t->url.textarea, &t->throbber);
return( t );
}
@ -458,7 +459,7 @@ toolbar_update_buttons(struct s_toolbar *tb,
struct browser_window *bw,
short button)
{
LOG("tb %p", tb);
NSLOG(netsurf, INFO, "tb %p", tb);
struct s_tb_button * bt;
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)
{
LOG("tb %p", tb);
NSLOG(netsurf, INFO, "tb %p", tb);
textarea_set_text(tb->url.textarea, text);
@ -668,7 +669,7 @@ bool toolbar_text_input(struct s_toolbar *tb, char *text)
{
bool handled = true;
LOG("tb %p", tb);
NSLOG(netsurf, INFO, "tb %p", tb);
return(handled);
}
@ -757,7 +758,7 @@ void toolbar_mouse_input(struct s_toolbar *tb, short obj, short button)
short mx, my, mb, kstat;
struct gui_window * gw;
LOG("tb %p", tb);
NSLOG(netsurf, INFO, "tb %p", tb);
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);
}
if ((ev_out->emo_events & MU_BUTTON) != 0 ) {
LOG("Treeview click at: %d,%d\n",
ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
NSLOG(netsurf, INFO, "Treeview click at: %d,%d\n",
ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
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));
if (tv == NULL) {
LOG("calloc failed");
NSLOG(netsurf, INFO, "calloc failed");
atari_warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
return NULL;
}

View File

@ -80,7 +80,9 @@ static void __CDECL cert_info_draw( WINDOW * win, short buf[8], void * data)
if( line == NULL )
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 );
/*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];
short x, y;
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++) {
items[i] = malloc( 48 );
strncpy(items[i], (char*)&dp->cert_infos_n[i].issuer, 46 );
@ -246,7 +248,7 @@ verify_ssl_form_do(const char * url,
break;
case VERIFY_BT_SCROLL_R:
LOG("scroll r!");
NSLOG(netsurf, INFO, "scroll r!");
cont = true;
dp.scrollx += 1;
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;
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);
if (bm == NULL) {
@ -69,7 +70,7 @@ static void *bitmap_create(int width, int height, unsigned int state)
return NULL;
}
LOG("bitmap %p", bm);
NSLOG(netsurf, INFO, "bitmap %p", bm);
return bm;
}
@ -197,11 +198,11 @@ static bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) {
if (bmpptr[(tst << 2) + 3] != 0xff) {
LOG("bitmap %p has transparency", bm);
NSLOG(netsurf, INFO, "bitmap %p has transparency", bm);
return false;
}
}
LOG("bitmap %p is opaque", bm);
NSLOG(netsurf, INFO, "bitmap %p is opaque", bm);
return true;
}
@ -282,7 +283,7 @@ bitmap_render(struct bitmap *bitmap,
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 */
/* 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) {
assert(gui_clipboard.buffer != NULL);
LOG("Pasting %zd bytes: \"%s\"\n",
gui_clipboard.length, gui_clipboard.buffer);
NSLOG(netsurf, INFO, "Pasting %zd bytes: \"%s\"\n",
gui_clipboard.length, gui_clipboard.buffer);
*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");
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;
}
@ -315,7 +316,8 @@ bool generate_font_source(const char *path, struct font_data *data)
fp = fopen(path, "wb");
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;
}
@ -413,14 +415,14 @@ static bool add_glyph_to_data(glyph_entry *add, int id, int style,
d->e[d->glyphs++] = e;
e->index = d->glyphs;
if (d->glyphs >= 0xfffd) {
LOG(LOG_ERROR, " Too many glyphs for internal data "
"representation\n");
NSLOG(netsurf, INFO, LOG_ERROR,
" Too many glyphs for internal data ""representation\n");
return false;
}
} else {
/* Duplicate glyph */
LOG(LOG_DEBUG, " U+%.4X (%s) is duplicate\n",
id, short_labels[style]);
NSLOG(netsurf, INFO, LOG_DEBUG,
" U+%.4X (%s) is duplicate\n", id, short_labels[style]);
}
/* 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;
uint16_t *temp = realloc(d->sections[style], size);
if (temp == NULL) {
LOG(LOG_ERROR, " Couldn't increase sections "
"allocation\n");
NSLOG(netsurf, INFO, LOG_ERROR,
" Couldn't increase sections ""allocation\n");
return false;
}
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 (c != '\n') {
LOG(LOG_ERROR, " Invalid glyph data: "
"expecting '\\n', got '%c' (%i)\n",
c, c);
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph data: ""expecting '\\n', got '%c' (%i)\n",
c,
c);
return false;
} else {
return true;
}
} else if (pos < 3) {
if (c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: "
"expecting ' ', got '%c' (%i)\n",
c, c);
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph data: ""expecting ' ', got '%c' (%i)\n",
c,
c);
return false;
} else {
return true;
}
} else if (offset == 0) {
if (c != '\n' && c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: "
"expecting '\\n' or ' ', "
"got '%c' (%i)\n",
c, c);
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph data: ""expecting '\\n' or ' ', ""got '%c' (%i)\n",
c,
c);
return false;
} else {
return true;
}
} else if (offset < 3) {
if (c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: "
"expecting ' ', got '%c' (%i)\n",
c, c);
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph data: ""expecting ' ', got '%c' (%i)\n",
c,
c);
return false;
} else {
return true;
}
} else if (offset >= 3 && pos < 11) {
if (c != '.' && c != '#') {
LOG(LOG_ERROR, " Invalid glyph data: "
"expecting '.' or '#', "
"got '%c' (%i)\n",
c, c);
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph data: ""expecting '.' or '#', ""got '%c' (%i)\n",
c,
c);
return false;
} else {
return true;
@ -505,10 +510,10 @@ static bool check_glyph_data_valid(int pos, char c)
/* offset must be >=3 */
if (c != '.' && c != '#' && c != ' ') {
LOG(LOG_ERROR, " Invalid glyph data: "
"expecting '.', '#', or ' ', "
"got '%c' (%i)\n",
c, c);
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph data: ""expecting '.', '#', or ' ', ""got '%c' (%i)\n",
c,
c);
return false;
}
@ -697,11 +702,11 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
/* Check that character is valid */
if (check_glyph_data_valid(ctx->data.in_gd.pos, c) == false) {
LOG(LOG_ERROR, " Error in U+%.4X data: "
"glyph line: %i, pos: %i\n",
ctx->id,
ctx->data.in_gd.line,
ctx->data.in_gd.pos);
NSLOG(netsurf, INFO, LOG_ERROR,
" Error in U+%.4X data: ""glyph line: %i, pos: %i\n",
ctx->id,
ctx->data.in_gd.line,
ctx->data.in_gd.pos);
goto error;
}
@ -712,8 +717,8 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
ctx->data.in_gd.e[glyph] =
calloc(sizeof(struct glyph_entry), 1);
if (ctx->data.in_gd.e[glyph] == NULL) {
LOG(LOG_ERROR, " Couldn't allocate memory for "
"glyph entry\n");
NSLOG(netsurf, INFO, LOG_ERROR,
" Couldn't allocate memory for ""glyph entry\n");
goto error;
}
@ -735,18 +740,17 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
if (c == '\n') {
if (ctx->data.in_gd.line == 0) {
if (ctx->data.in_gd.e[0] == NULL) {
LOG(LOG_ERROR, " Error in U+%.4X data: "
"\"Regular\" glyph style must "
"be present\n", ctx->id);
NSLOG(netsurf, INFO, LOG_ERROR,
" Error in U+%.4X data: ""\"Regular\" glyph style must ""be present\n",
ctx->id);
goto error;
}
} else if (ctx->data.in_gd.styles !=
ctx->data.in_gd.line_styles) {
LOG(LOG_ERROR, " Error in U+%.4X data: "
"glyph line: %i "
"styles don't match first line\n",
ctx->id,
ctx->data.in_gd.line);
NSLOG(netsurf, INFO, LOG_ERROR,
" Error in U+%.4X data: ""glyph line: %i ""styles don't match first line\n",
ctx->id,
ctx->data.in_gd.line);
goto error;
}
@ -764,10 +768,10 @@ static bool parse_glyph_data(struct parse_context *ctx, char c,
ctx->count[i] += 1;
if (glyph_is_codepoint(ctx->data.in_gd.e[i],
ctx->id, i)) {
LOG(LOG_DEBUG, " U+%.4X (%s) is "
"codepoint\n",
ctx->id,
short_labels[i]);
NSLOG(netsurf, INFO, LOG_DEBUG,
" U+%.4X (%s) is ""codepoint\n",
ctx->id,
short_labels[i]);
ctx->codepoints += 1;
free(ctx->data.in_gd.e[i]);
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')
*v = (10 + c - 'A');
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;
}
@ -847,14 +852,16 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
while (pos < end) {
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;
}
switch (ctx->state) {
case START:
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);
return false;
}
@ -866,12 +873,13 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len,
case IN_HEADER:
if (ctx->data.in_header.new_line == true) {
if (*pos != '*') {
LOG(LOG_INFO, " Got header "
"(%i bytes)\n",
d->header_len);
LOG(LOG_DEBUG, " Header:\n\n%.*s\n",
d->header_len,
d->header);
NSLOG(netsurf, INFO, LOG_INFO,
" Got header ""(%i bytes)\n",
d->header_len);
NSLOG(netsurf, INFO, LOG_DEBUG,
" Header:\n\n%.*s\n",
d->header_len,
d->header);
ctx->data.before_id.new_line = false;
ctx->data.before_id.u = false;
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) {
LOG(LOG_ERROR, " Header too long "
"(>%i bytes)\n",
d->header_len);
NSLOG(netsurf, INFO, LOG_ERROR,
" Header too long ""(>%i bytes)\n",
d->header_len);
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++,
&ctx->id);
if (!ok) {
LOG(LOG_ERROR, " Invalid glyph ID\n");
NSLOG(netsurf, INFO, LOG_ERROR,
" Invalid glyph ID\n");
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++) {
LOG(LOG_DEBUG, " %s: %i gylphs\n", labels[i],
ctx->count[i] - count[i]);
NSLOG(netsurf, INFO, LOG_DEBUG, " %s: %i gylphs\n",
labels[i], ctx->count[i] - count[i]);
}
return true;
@ -1019,13 +1028,15 @@ bool load_font(const char *path, struct font_data **data)
fp = fopen(path, "rb");
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;
}
d = calloc(sizeof(struct font_data), 1);
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);
return false;
}
@ -1034,18 +1045,19 @@ bool load_font(const char *path, struct font_data **data)
fseek(fp, 0L, SEEK_END);
file_len = ftell(fp);
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);
fclose(fp);
return false;
}
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 */
buf = malloc(CHUNK_SIZE);
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);
fclose(fp);
return false;
@ -1054,20 +1066,24 @@ bool load_font(const char *path, struct font_data **data)
/* Initialise parser */
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 */
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 */
len = fread(buf, 1, CHUNK_SIZE, fp);
if (file_len - done < CHUNK_SIZE &&
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 &&
len != CHUNK_SIZE) {
LOG(LOG_ERROR, "Problem reading file\n");
NSLOG(netsurf, INFO, LOG_ERROR,
"Problem reading file\n");
free(buf);
free(d);
fclose(fp);
@ -1082,29 +1098,33 @@ bool load_font(const char *path, struct font_data **data)
fclose(fp);
return false;
}
LOG(LOG_DEBUG, "Parsed %zu bytes\n", done + len);
NSLOG(netsurf, INFO, LOG_DEBUG, "Parsed %zu bytes\n",
done + len);
}
fclose(fp);
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(d);
return false;
}
LOG(LOG_INFO, "Parsing complete:\n");
NSLOG(netsurf, INFO, LOG_INFO, "Parsing complete:\n");
count = 0;
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];
}
LOG(LOG_RESULT, " Total %i gylphs "
"(of which %i unique, %i codepoints, %i duplicates)\n",
count, d->glyphs, ctx.codepoints,
count - d->glyphs - ctx.codepoints);
NSLOG(netsurf, INFO, LOG_RESULT,
" Total %i gylphs ""(of which %i unique, %i codepoints, %i duplicates)\n",
count,
d->glyphs,
ctx.codepoints,
count - d->glyphs - ctx.codepoints);
free(buf);
@ -1115,16 +1135,9 @@ bool load_font(const char *path, struct font_data **data)
static void log_usage(const char *argv0)
{
level = LOG_INFO;
LOG(LOG_INFO,
"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",
argv0);
NSLOG(netsurf, INFO, LOG_INFO,
"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",
argv0);
}
int main(int argc, char** argv)
@ -1187,8 +1200,9 @@ int main(int argc, char** argv)
in_path = argv[optind];
out_path = argv[optind + 1];
LOG(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 input path: \"%s\"\n", in_path);
NSLOG(netsurf, INFO, LOG_DEBUG, "Using output path: \"%s\"\n",
out_path);
ok = load_font(in_path, &data);
if (!ok) {

View File

@ -51,7 +51,7 @@ fbtk_input(fbtk_widget_t *root, nsfb_event_t *event)
/* obtain widget with input focus */
input = root->u.root.input;
if (input == NULL) {
LOG("No widget has input focus.");
NSLOG(netsurf, INFO, "No widget has input focus.");
return; /* no widget with input */
}
@ -84,7 +84,7 @@ fbtk_click(fbtk_widget_t *widget, nsfb_event_t *event)
x = fbtk_get_absx(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 */
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;
while (widget != NULL) {
LOG("%*s%p", indent, "", widget);
NSLOG(netsurf, INFO, "%*s%p", indent, "", widget);
if (widget->first_child != NULL) {
widget = widget->first_child;
indent += 6;
@ -101,7 +101,9 @@ fbtk_request_redraw(fbtk_widget_t *widget)
widget->redraw.height = widget->height;
#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
cwidget = widget->last_child;
@ -122,7 +124,7 @@ fbtk_request_redraw(fbtk_widget_t *widget)
int
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;
if (map) {
fbtk_request_redraw(widget);
@ -145,7 +147,7 @@ swap_siblings(fbtk_widget_t *lw)
assert(rw != NULL);
LOG("Swapping %p with %p", lw, rw);
NSLOG(netsurf, INFO, "Swapping %p with %p", lw, rw);
before = lw->prev;
after = rw->next;
@ -411,7 +413,8 @@ fbtk_get_root_widget(fbtk_widget_t *widget)
/* check root widget was found */
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;
}
@ -552,7 +555,8 @@ fbtk_widget_new(fbtk_widget_t *parent,
return NULL;
#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
/* make new window fit inside parent */
@ -575,7 +579,8 @@ fbtk_widget_new(fbtk_widget_t *parent,
}
#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
/* set values */
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;
#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
if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) {
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;
}
LOG("hscroll %d", hscroll);
NSLOG(netsurf, INFO, "hscroll %d", hscroll);
rect.x0 = bbox.x0 + 3 + hpos;
rect.y0 = bbox.y0 + 5;
@ -362,7 +362,7 @@ hscrolll_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
newpos = scrollw->u.scroll.minimum;
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;
}

View File

@ -65,7 +65,7 @@ static nsurl *get_resource_url(const char *path)
static const char *fetch_filetype(const char *unix_path)
{
int l;
LOG("unix path %s", unix_path);
NSLOG(netsurf, INFO, "unix path %s", unix_path);
l = strlen(unix_path);
if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
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);
if (error) {
LOG("Could not find font (code %d)", error);
NSLOG(netsurf, INFO, "Could not find font (code %d)", error);
} else {
error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE);
if (error) {
LOG("Could not select charmap (code %d)", error);
NSLOG(netsurf, INFO,
"Could not select charmap (code %d)", error);
} else {
for (cidx = 0; cidx < (*face)->num_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;
}
@ -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);
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);
newf = NULL;
@ -152,7 +154,8 @@ bool fb_font_init(void)
/* freetype library initialise */
error = FT_Init_FreeType( &library );
if (error) {
LOG("Freetype could not initialised (code %d)", error);
NSLOG(netsurf, INFO,
"Freetype could not initialised (code %d)", error);
return false;
}
@ -172,7 +175,9 @@ bool fb_font_init(void)
NULL,
&ft_cmanager);
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);
return false;
}
@ -189,7 +194,7 @@ bool fb_font_init(void)
NETSURF_FB_FONT_SANS_SERIF);
if (fb_face == NULL) {
/* 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);
FT_Done_FreeType(library);
return false;

View File

@ -271,7 +271,7 @@ framebuffer_plot_path(const struct redraw_context *ctx,
float width,
const float transform[6])
{
LOG("path unimplemented");
NSLOG(netsurf, INFO, "path unimplemented");
return NSERROR_OK;
}
@ -564,7 +564,7 @@ static bool framebuffer_format_from_bpp(int bpp, enum nsfb_format_e *fmt)
break;
default:
LOG("Bad bits per pixel (%d)\n", bpp);
NSLOG(netsurf, INFO, "Bad bits per pixel (%d)\n", bpp);
return false;
}
@ -586,18 +586,19 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp)
fbtype = nsfb_type_from_name(fename);
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;
}
nsfb = nsfb_new(fbtype);
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;
}
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);
return NULL;
}
@ -605,7 +606,7 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp)
nsfb_cursor_init(nsfb);
if (nsfb_init(nsfb) == -1) {
LOG("Unable to initialise nsfb surface\n");
NSLOG(netsurf, INFO, "Unable to initialise nsfb surface\n");
nsfb_free(nsfb);
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) {
LOG("Unable to change surface geometry\n");
NSLOG(netsurf, INFO, "Unable to change surface geometry\n");
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)
{
LOG("%s %s", warning, detail);
NSLOG(netsurf, INFO, "%s %s", warning, detail);
return NSERROR_OK;
}
@ -153,7 +153,7 @@ widget_scroll_y(struct gui_window *gw, int y, bool abs)
int content_width, content_height;
int height;
LOG("window scroll");
NSLOG(netsurf, INFO, "window scroll");
if (abs) {
bwidget->pany = y - bwidget->scrolly;
} else {
@ -237,7 +237,7 @@ fb_pan(fbtk_widget_t *widget,
height = fbtk_get_height(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);
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);
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;
}
@ -465,7 +466,7 @@ process_cmdline(int argc, char** argv)
{0, 0, 0, 0 }
}; /* no long options */
LOG("argc %d, argv %p", argc, argv);
NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv);
fename = "sdl";
febpp = 32;
@ -534,7 +535,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
if (nsoption_charp(cookie_file) == NULL ||
nsoption_charp(cookie_jar) == NULL) {
LOG("Failed initialising cookie options");
NSLOG(netsurf, INFO, "Failed initialising cookie options");
return NSERROR_BAD_PARAMETER;
}
@ -612,7 +613,7 @@ static void framebuffer_run(void)
static void gui_quit(void)
{
LOG("gui_quit");
NSLOG(netsurf, INFO, "gui_quit");
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)
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) {
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;
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) {
case NSFB_EVENT_KEY_DOWN:
@ -1200,7 +1202,7 @@ create_toolbar(struct gui_window *gw,
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;
@ -1234,7 +1236,7 @@ create_toolbar(struct gui_window *gw,
(*itmtype != 0) &&
(xdir !=0)) {
LOG("toolbar adding %c", *itmtype);
NSLOG(netsurf, INFO, "toolbar adding %c", *itmtype);
switch (*itmtype) {
@ -1376,7 +1378,9 @@ create_toolbar(struct gui_window *gw,
default:
widget = NULL;
xdir = 0;
LOG("Unknown element %c in toolbar layout", *itmtype);
NSLOG(netsurf, INFO,
"Unknown element %c in toolbar layout",
*itmtype);
break;
}
@ -1385,7 +1389,7 @@ create_toolbar(struct gui_window *gw,
xpos += (xdir * (fbtk_get_width(widget) + padding));
}
LOG("xpos is %d", xpos);
NSLOG(netsurf, INFO, "xpos is %d", xpos);
itmtype += xdir;
}
@ -1595,7 +1599,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
int statusbar_width = 0;
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);
@ -1626,7 +1630,8 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
false);
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 */
gw->hscroll = fbtk_create_hscroll(gw->window,
@ -2183,7 +2188,7 @@ main(int argc, char** argv)
/* create an initial browser window */
LOG("calling browser_window_create");
NSLOG(netsurf, INFO, "calling browser_window_create");
ret = nsurl_create(feurl, &url);
if (ret == NSERROR_OK) {
@ -2205,7 +2210,7 @@ main(int argc, char** argv)
netsurf_exit();
if (fb_font_finalise() == false)
LOG("Font finalisation failed.");
NSLOG(netsurf, INFO, "Font finalisation failed.");
/* finalise options */
nsoption_finalise(nsoptions, nsoptions_default);

View File

@ -203,12 +203,14 @@ void list_schedule(void)
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;
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;
}
}

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,
event->widget));
if (w == NULL) {
LOG("Unable to connect menu widget ""%s""",
event->widget);
NSLOG(netsurf, INFO,
"Unable to connect menu widget ""%s""",
event->widget);
} else {
g_signal_connect(G_OBJECT(w),
"activate",
@ -253,7 +254,7 @@ static nserror nsgtk_cookies_init(void)
res = nsgtk_builder_new_from_resname("cookies", &ncwin->builder);
if (res != NSERROR_OK) {
LOG("Cookie UI builder init failed");
NSLOG(netsurf, INFO, "Cookie UI builder init failed");
free(ncwin);
return res;
}

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