diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-09-06 18:28:12 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-09-06 18:45:27 +0100 |
commit | 75018632a9b953aafeae6f4e8aea607fd1d89dca (patch) | |
tree | d661d2fded2ad4b80c4cf019dee2954c052ab090 /frontends/atari | |
parent | 8d9b2efc11529da8cb5870b39ff15249c648b10a (diff) | |
download | netsurf-75018632a9b953aafeae6f4e8aea607fd1d89dca.tar.gz netsurf-75018632a9b953aafeae6f4e8aea607fd1d89dca.tar.bz2 |
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);
Diffstat (limited to 'frontends/atari')
-rw-r--r-- | frontends/atari/bitmap.c | 32 | ||||
-rw-r--r-- | frontends/atari/certview.c | 16 | ||||
-rw-r--r-- | frontends/atari/cookies.c | 15 | ||||
-rw-r--r-- | frontends/atari/ctxmenu.c | 7 | ||||
-rw-r--r-- | frontends/atari/deskmenu.c | 64 | ||||
-rw-r--r-- | frontends/atari/download.c | 14 | ||||
-rw-r--r-- | frontends/atari/filetype.c | 4 | ||||
-rw-r--r-- | frontends/atari/findfile.c | 18 | ||||
-rw-r--r-- | frontends/atari/gui.c | 55 | ||||
-rw-r--r-- | frontends/atari/history.c | 15 | ||||
-rw-r--r-- | frontends/atari/hotlist.c | 21 | ||||
-rw-r--r-- | frontends/atari/osspec.c | 6 | ||||
-rw-r--r-- | frontends/atari/plot/font_freetype.c | 23 | ||||
-rw-r--r-- | frontends/atari/plot/font_internal.c | 2 | ||||
-rw-r--r-- | frontends/atari/plot/font_vdi.c | 2 | ||||
-rw-r--r-- | frontends/atari/plot/plot.c | 5 | ||||
-rw-r--r-- | frontends/atari/rootwin.c | 45 | ||||
-rw-r--r-- | frontends/atari/schedule.c | 25 | ||||
-rw-r--r-- | frontends/atari/search.c | 12 | ||||
-rw-r--r-- | frontends/atari/settings.c | 6 | ||||
-rw-r--r-- | frontends/atari/statusbar.c | 4 | ||||
-rw-r--r-- | frontends/atari/toolbar.c | 15 | ||||
-rw-r--r-- | frontends/atari/treeview.c | 6 | ||||
-rw-r--r-- | frontends/atari/verify_ssl.c | 8 |
24 files changed, 236 insertions, 184 deletions
diff --git a/frontends/atari/bitmap.c b/frontends/atari/bitmap.c index cbb719586..ae42da837 100644 --- a/frontends/atari/bitmap.c +++ b/frontends/atari/bitmap.c @@ -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); diff --git a/frontends/atari/certview.c b/frontends/atari/certview.c index 6950d31f8..80d18a059 100644 --- a/frontends/atari/certview.c +++ b/frontends/atari/certview.c @@ -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"); } diff --git a/frontends/atari/cookies.c b/frontends/atari/cookies.c index 9045009fc..df2de0d4c 100644 --- a/frontends/atari/cookies.c +++ b/frontends/atari/cookies.c @@ -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"); } diff --git a/frontends/atari/ctxmenu.c b/frontends/atari/ctxmenu.c index e25d8e522..ef4f01ae2 100644 --- a/frontends/atari/ctxmenu.c +++ b/frontends/atari/ctxmenu.c @@ -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]"); diff --git a/frontends/atari/deskmenu.c b/frontends/atari/deskmenu.c index addba2764..32dfd7084 100644 --- a/frontends/atari/deskmenu.c +++ b/frontends/atari/deskmenu.c @@ -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); } } diff --git a/frontends/atari/download.c b/frontends/atari/download.c index d756e6694..7a1c7d2b7 100644 --- a/frontends/atari/download.c +++ b/frontends/atari/download.c @@ -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; diff --git a/frontends/atari/filetype.c b/frontends/atari/filetype.c index d27076e9c..706347137 100644 --- a/frontends/atari/filetype.c +++ b/frontends/atari/filetype.c @@ -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 ); } diff --git a/frontends/atari/findfile.c b/frontends/atari/findfile.c index 45ca6d916..8784727bc 100644 --- a/frontends/atari/findfile.c +++ b/frontends/atari/findfile.c @@ -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); } diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c index 4876d3106..a400285d3 100644 --- a/frontends/atari/gui.c +++ b/frontends/atari/gui.c @@ -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; diff --git a/frontends/atari/history.c b/frontends/atari/history.c index 56aafd056..ec602684f 100644 --- a/frontends/atari/history.c +++ b/frontends/atari/history.c @@ -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) diff --git a/frontends/atari/hotlist.c b/frontends/atari/hotlist.c index 659b3a562..3a54c98eb 100644 --- a/frontends/atari/hotlist.c +++ b/frontends/atari/hotlist.c @@ -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; } diff --git a/frontends/atari/osspec.c b/frontends/atari/osspec.c index f64402e8d..ca042f164 100644 --- a/frontends/atari/osspec.c +++ b/frontends/atari/osspec.c @@ -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); } diff --git a/frontends/atari/plot/font_freetype.c b/frontends/atari/plot/font_freetype.c index 17d3c3bfd..1688e978b 100644 --- a/frontends/atari/plot/font_freetype.c +++ b/frontends/atari/plot/font_freetype.c @@ -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); diff --git a/frontends/atari/plot/font_internal.c b/frontends/atari/plot/font_internal.c index 3575bc3e1..709697f74 100644 --- a/frontends/atari/plot/font_internal.c +++ b/frontends/atari/plot/font_internal.c @@ -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); diff --git a/frontends/atari/plot/font_vdi.c b/frontends/atari/plot/font_vdi.c index ef5499207..7cd82ddc9 100644 --- a/frontends/atari/plot/font_vdi.c +++ b/frontends/atari/plot/font_vdi.c @@ -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; } diff --git a/frontends/atari/plot/plot.c b/frontends/atari/plot/plot.c index 2324f82d9..14c670352 100644 --- a/frontends/atari/plot/plot.c +++ b/frontends/atari/plot/plot.c @@ -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"); } diff --git a/frontends/atari/rootwin.c b/frontends/atari/rootwin.c index 0b77cbba5..6576eac77 100644 --- a/frontends/atari/rootwin.c +++ b/frontends/atari/rootwin.c @@ -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; diff --git a/frontends/atari/schedule.c b/frontends/atari/schedule.c index 48980426d..a8d06e499 100644 --- a/frontends/atari/schedule.c +++ b/frontends/atari/schedule.c @@ -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); } diff --git a/frontends/atari/search.c b/frontends/atari/search.c index 4da7f16a3..8df4ad676 100644 --- a/frontends/atari/search.c +++ b/frontends/atari/search.c @@ -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); } diff --git a/frontends/atari/settings.c b/frontends/atari/settings.c index ed1fb2e45..ac4afa315 100644 --- a/frontends/atari/settings.c +++ b/frontends/atari/settings.c @@ -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"); } diff --git a/frontends/atari/statusbar.c b/frontends/atari/statusbar.c index 3a216f9a8..fe2008c82 100644 --- a/frontends/atari/statusbar.c +++ b/frontends/atari/statusbar.c @@ -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 ); } diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c index 1b9371763..fdfedcbee 100644 --- a/frontends/atari/toolbar.c +++ b/frontends/atari/toolbar.c @@ -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) { diff --git a/frontends/atari/treeview.c b/frontends/atari/treeview.c index abc1fa780..23db41309 100644 --- a/frontends/atari/treeview.c +++ b/frontends/atari/treeview.c @@ -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; } diff --git a/frontends/atari/verify_ssl.c b/frontends/atari/verify_ssl.c index 33136eebd..b099fe488 100644 --- a/frontends/atari/verify_ssl.c +++ b/frontends/atari/verify_ssl.c @@ -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 )) ) |