From cc1e667dfd6efb402c96387adf154afb0b4cddc6 Mon Sep 17 00:00:00 2001 From: Tristan Chabredier Date: Tue, 21 Aug 2007 09:17:38 +0000 Subject: [PATCH] 2007-08-21 [wwp] 2.10.0cvs141 * src/addr_compl.c * src/addrbook.c * src/addrcache.c * src/addrcindex.c * src/addressbook.c * src/addrindex.c * src/browseldap.c * src/crash.c * src/editaddress_other_attributes_ldap.c * src/exporthtml.c * src/folder.c * src/folderview.c * src/imap.c * src/jpilot.c * src/ldapserver.c * src/ldapupdate.c * src/ldif.c * src/main.c * src/mainwindow.c * src/matcher.c * src/mh.c * src/msgcache.c * src/mutt.c * src/pine.c * src/pop.c * src/prefs_customheader.c * src/prefs_msg_colors.c * src/procmime.c * src/textview.c * src/vcard.c * src/wizard.c * src/common/log.c * src/common/socket.c * src/common/ssl_certificate.c * src/common/utils.c * src/common/utils.h * src/gtk/description_window.c * src/plugins/demo/demo.c * src/plugins/pgpcore/prefs_gpg.c * src/plugins/spamassassin/libspamc.c Make sure we use glib functions to send text messages (information, debug, warning, errors) to stdout/stderr - no more direct puts fputs printf fprintf to stdout/stderr when it can be done using g_log*() and g_print/g_printerr. Doing this, we make sure every stdout/stderr message is saved to log in Windows. --- ChangeLog | 49 +++++++++++++++++++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/addr_compl.c | 24 ++++++------ src/addrbook.c | 6 +-- src/addrcache.c | 2 +- src/addrcindex.c | 10 ++--- src/addressbook.c | 28 +++++++------- src/addrindex.c | 44 +++++++++++----------- src/browseldap.c | 2 +- src/common/log.c | 2 +- src/common/socket.c | 10 ++--- src/common/ssl_certificate.c | 2 +- src/common/utils.c | 2 +- src/common/utils.h | 2 +- src/crash.c | 4 +- src/editaddress_other_attributes_ldap.c | 2 +- src/exporthtml.c | 2 +- src/folder.c | 2 +- src/folderview.c | 4 +- src/gtk/description_window.c | 2 +- src/imap.c | 2 +- src/jpilot.c | 4 +- src/ldapserver.c | 4 +- src/ldapupdate.c | 32 ++++++++-------- src/ldif.c | 6 +-- src/main.c | 6 +-- src/mainwindow.c | 18 ++++----- src/matcher.c | 8 ++-- src/mh.c | 2 +- src/msgcache.c | 2 +- src/mutt.c | 10 ++--- src/pine.c | 4 +- src/plugins/demo/demo.c | 6 +-- src/plugins/pgpcore/prefs_gpg.c | 2 +- src/plugins/spamassassin/libspamc.c | 10 ++--- src/pop.c | 2 +- src/prefs_customheader.c | 4 +- src/prefs_msg_colors.c | 2 +- src/procmime.c | 4 +- src/textview.c | 4 +- src/vcard.c | 28 +++++++------- src/wizard.c | 2 +- 43 files changed, 207 insertions(+), 157 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32a3d780d..7db4f8974 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,52 @@ +2007-08-21 [wwp] 2.10.0cvs141 + + * src/addr_compl.c + * src/addrbook.c + * src/addrcache.c + * src/addrcindex.c + * src/addressbook.c + * src/addrindex.c + * src/browseldap.c + * src/crash.c + * src/editaddress_other_attributes_ldap.c + * src/exporthtml.c + * src/folder.c + * src/folderview.c + * src/imap.c + * src/jpilot.c + * src/ldapserver.c + * src/ldapupdate.c + * src/ldif.c + * src/main.c + * src/mainwindow.c + * src/matcher.c + * src/mh.c + * src/msgcache.c + * src/mutt.c + * src/pine.c + * src/pop.c + * src/prefs_customheader.c + * src/prefs_msg_colors.c + * src/procmime.c + * src/textview.c + * src/vcard.c + * src/wizard.c + * src/common/log.c + * src/common/socket.c + * src/common/ssl_certificate.c + * src/common/utils.c + * src/common/utils.h + * src/gtk/description_window.c + * src/plugins/demo/demo.c + * src/plugins/pgpcore/prefs_gpg.c + * src/plugins/spamassassin/libspamc.c + Make sure we use glib functions to send text messages (information, + debug, warning, errors) to stdout/stderr - no more direct puts + fputs printf fprintf to stdout/stderr when it can be done using + g_log*() and g_print/g_printerr. Doing this, we make sure every + stdout/stderr message is saved to log in Windows. + + 2007-08-21 [wwp] 2.10.0cvs140 * src/main.c diff --git a/PATCHSETS b/PATCHSETS index 774ede0bb..be35c963a 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2795,3 +2795,4 @@ ( cvs diff -u -r 1.61.2.65 -r 1.61.2.66 src/account.c; cvs diff -u -r 1.105.2.107 -r 1.105.2.108 src/prefs_account.c; cvs diff -u -r 1.49.2.32 -r 1.49.2.33 src/prefs_account.h; ) > 2.10.0cvs138.patchset ( cvs diff -u -r 1.274.2.205 -r 1.274.2.206 src/mainwindow.c; cvs diff -u -r 1.94.2.145 -r 1.94.2.146 src/messageview.c; ) > 2.10.0cvs139.patchset ( cvs diff -u -r 1.115.2.162 -r 1.115.2.163 src/main.c; cvs diff -u -r 1.20.2.48 -r 1.20.2.49 src/common/utils.h; ) > 2.10.0cvs140.patchset +( cvs diff -u -r 1.27.2.39 -r 1.27.2.40 src/addr_compl.c; cvs diff -u -r 1.22.2.15 -r 1.22.2.16 src/addrbook.c; cvs diff -u -r 1.15.2.13 -r 1.15.2.14 src/addrcache.c; cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/addrcindex.c; cvs diff -u -r 1.60.2.94 -r 1.60.2.95 src/addressbook.c; cvs diff -u -r 1.28.2.29 -r 1.28.2.30 src/addrindex.c; cvs diff -u -r 1.2.4.18 -r 1.2.4.19 src/browseldap.c; cvs diff -u -r 1.23.2.25 -r 1.23.2.26 src/crash.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/editaddress_other_attributes_ldap.c; cvs diff -u -r 1.5.2.21 -r 1.5.2.22 src/exporthtml.c; cvs diff -u -r 1.213.2.156 -r 1.213.2.157 src/folder.c; cvs diff -u -r 1.207.2.175 -r 1.207.2.176 src/folderview.c; cvs diff -u -r 1.179.2.183 -r 1.179.2.184 src/imap.c; cvs diff -u -r 1.18.2.25 -r 1.18.2.26 src/jpilot.c; cvs diff -u -r 1.4.2.12 -r 1.4.2.13 src/ldapserver.c; cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/ldapupdate.c; cvs diff -u -r 1.12.2.14 -r 1.12.2.15 src/ldif.c; cvs diff -u -r 1.115.2.163 -r 1.115.2.164 src/main.c; cvs diff -u -r 1.274.2.206 -r 1.274.2.207 src/mainwindow.c; cvs diff -u -r 1.75.2.46 -r 1.75.2.47 src/matcher.c; cvs diff -u -r 1.79.2.60 -r 1.79.2.61 src/mh.c; cvs diff -u -r 1.16.2.58 -r 1.16.2.59 src/msgcache.c; cvs diff -u -r 1.6.10.12 -r 1.6.10.13 src/mutt.c; cvs diff -u -r 1.6.2.11 -r 1.6.2.12 src/pine.c; cvs diff -u -r 1.56.2.53 -r 1.56.2.54 src/pop.c; cvs diff -u -r 1.16.2.27 -r 1.16.2.28 src/prefs_customheader.c; cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/prefs_msg_colors.c; cvs diff -u -r 1.49.2.95 -r 1.49.2.96 src/procmime.c; cvs diff -u -r 1.96.2.181 -r 1.96.2.182 src/textview.c; cvs diff -u -r 1.14.2.10 -r 1.14.2.11 src/vcard.c; cvs diff -u -r 1.1.2.59 -r 1.1.2.60 src/wizard.c; cvs diff -u -r 1.6.2.14 -r 1.6.2.15 src/common/log.c; cvs diff -u -r 1.13.2.34 -r 1.13.2.35 src/common/socket.c; cvs diff -u -r 1.4.2.19 -r 1.4.2.20 src/common/ssl_certificate.c; cvs diff -u -r 1.36.2.109 -r 1.36.2.110 src/common/utils.c; cvs diff -u -r 1.20.2.49 -r 1.20.2.50 src/common/utils.h; cvs diff -u -r 1.5.2.22 -r 1.5.2.23 src/gtk/description_window.c; cvs diff -u -r 1.13.2.16 -r 1.13.2.17 src/plugins/demo/demo.c; cvs diff -u -r 1.1.2.26 -r 1.1.2.27 src/plugins/pgpcore/prefs_gpg.c; cvs diff -u -r 1.4.2.6 -r 1.4.2.7 src/plugins/spamassassin/libspamc.c; ) > 2.10.0cvs141.patchset diff --git a/configure.ac b/configure.ac index a9506a2b2..8da34cb60 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=10 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=140 +EXTRA_VERSION=141 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/addr_compl.c b/src/addr_compl.c index ca17e1e5e..877c49a4a 100644 --- a/src/addr_compl.c +++ b/src/addr_compl.c @@ -894,7 +894,7 @@ static void addrcompl_add_entry( CompletionWindow *cw, gchar *address ) { stock_pixbuf_gdk(cw->list_view, STOCK_PIXMAP_ADDR_ONE, &email_pixbuf); g_object_ref(G_OBJECT(email_pixbuf)); } - /* printf( "\t\tAdding :%s\n", address ); */ + /* g_print( "\t\tAdding :%s\n", address ); */ if (strstr(address, " ")) { is_group = TRUE; if (_groupAddresses_) @@ -956,7 +956,7 @@ static gboolean addrcompl_idle( gpointer data ) { node = _displayQueue_; while( node ) { address = node->data; - /* printf( "address ::: %s :::\n", address ); */ + /* g_print( "address ::: %s :::\n", address ); */ addrcompl_add_entry( _compWindow_, address ); g_free( address ); node = g_list_next( node ); @@ -985,7 +985,7 @@ static gint addrcompl_callback_entry( GList *node; gchar *address; - /* printf( "addrcompl_callback_entry::queryID=%d\n", queryID ); */ + /* g_print( "addrcompl_callback_entry::queryID=%d\n", queryID ); */ pthread_mutex_lock( & _completionMutex_ ); if( queryID == _queryID_ ) { /* Append contents to end of display queue */ @@ -994,7 +994,7 @@ static gint addrcompl_callback_entry( ItemEMail *email = node->data; address = addritem_format_email( email ); - /* printf( "\temail/address ::%s::\n", address ); */ + /* g_print( "\temail/address ::%s::\n", address ); */ _displayQueue_ = g_list_append( _displayQueue_, address ); node = g_list_next( node ); } @@ -1038,7 +1038,7 @@ static void addrcompl_load_local( void ) { gchar *address; address = get_complete_address( count ); - /* printf( "\taddress ::%s::\n", address ); */ + /* g_print( "\taddress ::%s::\n", address ); */ /* Append contents to end of display queue */ addrcompl_add_queue( address ); @@ -1057,7 +1057,7 @@ static void addrcompl_start_search( void ) { _queryID_ = addrindex_setup_search( searchTerm, NULL, addrcompl_callback_entry ); g_free( searchTerm ); - /* printf( "addrcompl_start_search::queryID=%d\n", _queryID_ ); */ + /* g_print( "addrcompl_start_search::queryID=%d\n", _queryID_ ); */ /* Load local stuff */ addrcompl_load_local(); @@ -1065,7 +1065,7 @@ static void addrcompl_start_search( void ) { /* Sit back and wait until something happens */ _completionIdleID_ = g_idle_add( ( GtkFunction ) addrcompl_idle, NULL ); - /* printf( "addrindex_start_search::queryID=%d\n", _queryID_ ); */ + /* g_print( "addrindex_start_search::queryID=%d\n", _queryID_ ); */ addrindex_start_search( _queryID_ ); } @@ -1278,7 +1278,7 @@ static gboolean address_completion_complete_address_in_entry(GtkEntry *entry, /* get an address component from the cursor */ searchTerm = get_address_from_edit( entry, &cursor_pos ); if( ! searchTerm ) return FALSE; - /* printf( "search for :::%s:::\n", searchTerm ); */ + /* g_print( "search for :::%s:::\n", searchTerm ); */ /* Clear any existing search */ g_free( _compWindow_->searchTerm ); @@ -1573,20 +1573,20 @@ static gboolean completion_window_key_press(GtkWidget *widget, * Setup completion object. */ void addrcompl_initialize( void ) { - /* printf( "addrcompl_initialize...\n" ); */ + /* g_print( "addrcompl_initialize...\n" ); */ if( ! _compWindow_ ) { _compWindow_ = addrcompl_create_window(); } _queryID_ = 0; _completionIdleID_ = 0; - /* printf( "addrcompl_initialize...done\n" ); */ + /* g_print( "addrcompl_initialize...done\n" ); */ } /** * Teardown completion object. */ void addrcompl_teardown( void ) { - /* printf( "addrcompl_teardown...\n" ); */ + /* g_print( "addrcompl_teardown...\n" ); */ addrcompl_free_window( _compWindow_ ); _compWindow_ = NULL; if( _displayQueue_ ) { @@ -1594,7 +1594,7 @@ void addrcompl_teardown( void ) { } _displayQueue_ = NULL; _completionIdleID_ = 0; - /* printf( "addrcompl_teardown...done\n" ); */ + /* g_print( "addrcompl_teardown...done\n" ); */ } /* diff --git a/src/addrbook.c b/src/addrbook.c index a69f259ea..e2733b2bb 100644 --- a/src/addrbook.c +++ b/src/addrbook.c @@ -920,7 +920,7 @@ gint addrbook_read_data(AddressBookFile *book) g_return_val_if_fail(book != NULL, -1); /* - printf( "...addrbook_read_data :%s:\t:%s:\n", book->fileName, + g_print( "...addrbook_read_data :%s:\t:%s:\n", book->fileName, addrcache_get_name( book->addressCache ) ); */ @@ -1839,7 +1839,7 @@ static void addrbook_chkparse_attribute(AddressBookFile *book, XMLFile *file) attr = xml_get_current_tag_attr(file); /* addrbook_show_attribs( attr ); */ element = xml_get_element(file); - /* printf( "\t\tattrib value : %s\n", element ); */ + /* g_print( "\t\tattrib value : %s\n", element ); */ } /** @@ -2045,7 +2045,7 @@ gint addrbook_test_read_file(AddressBookFile *book, gchar *fileName) if (file) { book->retVal = MGU_BAD_FORMAT; if (setjmp(book->jumper)) { - /* printf( "Caught Ya!!!\n" ); */ + /* g_print( "Caught Ya!!!\n" ); */ xml_close_file(file); return book->retVal; } diff --git a/src/addrcache.c b/src/addrcache.c index 1c8b91d61..eee769911 100644 --- a/src/addrcache.c +++ b/src/addrcache.c @@ -192,7 +192,7 @@ static void addrcache_free_all_folders( ItemFolder *parent ) { void addrcache_clear( AddressCache *cache ) { g_return_if_fail( cache != NULL ); - /* printf( "...addrcache_clear :%s:\n", cache->name ); */ + /* g_print( "...addrcache_clear :%s:\n", cache->name ); */ /* Free up folders and hash table */ addrcache_free_all_folders( cache->rootFolder ); addrcache_free_item_hash( cache->itemHash ); diff --git a/src/addrcindex.c b/src/addrcindex.c index ed61ec31c..55f246901 100644 --- a/src/addrcindex.c +++ b/src/addrcindex.c @@ -51,7 +51,7 @@ AddrCacheIndex *addrcindex_create( void ) { /* ++_n_created; - printf( "addrcindex_create/1/%d\n", _n_created ); + g_print( "addrcindex_create/1/%d\n", _n_created ); */ index = g_new0( AddrCacheIndex, 1 ); index->completion = g_completion_new( addrcindex_function ); @@ -83,7 +83,7 @@ void addrcindex_free( AddrCacheIndex *index ) { if( index ) { /* ++_n_freed; - printf( "addrcindex_free/2/%d\n", _n_freed ); + g_print( "addrcindex_free/2/%d\n", _n_freed ); */ /* Clear out */ addrcindex_clear( index ); @@ -292,14 +292,14 @@ void addrcindex_add_person( AddrCacheIndex *index, ItemPerson *person ) { /* Create a completion entry for the address item */ node = listMail; while( node ) { - /* printf( "\tname-m::%s::\n", node->data ); */ + /* g_print( "\tname-m::%s::\n", node->data ); */ addrcindex_add_entry( index, node->data, email ); node = g_slist_next( node ); } /* ... and all person's name entries */ node = uniqName; while( node ) { - /* printf( "\tname-p::%s::\n", node->data ); */ + /* g_print( "\tname-p::%s::\n", node->data ); */ addrcindex_add_entry( index, node->data, email ); node = g_slist_next( node ); } @@ -365,7 +365,7 @@ GList *addrcindex_search( AddrCacheIndex *index, const gchar *search ) { node = list; while( node ) { entry = node->data; - /* printf( "\tname ::%s::\n", entry->name ); */ + /* g_print( "\tname ::%s::\n", entry->name ); */ if( NULL == g_list_find( listEMail, entry->address ) ) { listEMail = g_list_append( listEMail, entry->address ); diff --git a/src/addressbook.c b/src/addressbook.c index cd322c43d..f34825ea2 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -2260,7 +2260,7 @@ static void addressbook_list_row_selected( GtkCTree *clist, aio = gtk_ctree_node_get_row_data( clist, node ); if( aio ) { - /* printf( "list select: %d : '%s'\n", aio->type, aio->name ); */ + /* g_print( "list select: %d : '%s'\n", aio->type, aio->name ); */ addressbook_list_select_add( aio, ds ); } @@ -2279,7 +2279,7 @@ static void addressbook_list_row_unselected( GtkCTree *ctree, aio = gtk_ctree_node_get_row_data( ctree, node ); if( aio != NULL ) { - /* printf( "list unselect: %d : '%s'\n", aio->type, aio->name ); */ + /* g_print( "list unselect: %d : '%s'\n", aio->type, aio->name ); */ addressbook_list_select_remove( aio ); } @@ -2813,12 +2813,12 @@ static void addressbook_treenode_delete_cb( adapter->itemFolder = NULL; /* - printf( "remove folder for ::%s::\n", obj->name ); - printf( " folder name ::%s::\n", ADDRITEM_NAME(folder) ); - printf( "-------------- remove results\n" ); + g_print( "remove folder for ::%s::\n", obj->name ); + g_print( " folder name ::%s::\n", ADDRITEM_NAME(folder) ); + g_print( "-------------- remove results\n" ); */ addrindex_remove_results( ds, folder ); - /* printf( "-------------- remove node\n" ); */ + /* g_print( "-------------- remove node\n" ); */ gtk_ctree_remove_node( ctree, node ); return; } @@ -3003,7 +3003,7 @@ static void addressbook_new_address_cb( gpointer data, guint action, GtkWidget * abf = ds->rawDataSource; if( abf == NULL ) { - printf("no addressbook file\n"); + g_print("no addressbook file\n"); return; } @@ -3653,10 +3653,10 @@ static AddressDataSource *addressbook_find_datasource( GtkCTreeNode *node ) { if( GTK_CTREE_ROW(node)->level < 2 ) return NULL; ao = gtk_ctree_node_get_row_data( GTK_CTREE(addrbook.ctree), node ); if( ao ) { - /* printf( "ao->type = %d\n", ao->type ); */ + /* g_print( "ao->type = %d\n", ao->type ); */ if( ao->type == ADDR_DATASOURCE ) { AdapterDSource *ads = ADAPTER_DSOURCE(ao); - /* printf( "found it\n" ); */ + /* g_print( "found it\n" ); */ ds = ads->dataSource; break; } @@ -3690,7 +3690,7 @@ static void addressbook_set_clist( AddressObject *obj, gboolean refresh ) { } if( obj->type == ADDR_INTERFACE ) { - /* printf( "set_clist: loading datasource...\n" ); */ + /* g_print( "set_clist: loading datasource...\n" ); */ /* addressbook_node_load_datasource( GTK_CTREE(clist), obj ); */ return; } @@ -4280,7 +4280,7 @@ static void addressbook_search_idle( gpointer data ) { gint queryID; queryID = GPOINTER_TO_INT( data ); - printf( "addressbook_ldap_idle... queryID=%d\n", queryID ); + g_print( "addressbook_ldap_idle... queryID=%d\n", queryID ); */ } @@ -4828,7 +4828,7 @@ static void addrbookctl_build_ifselect( void ) { splitStr = g_strsplit( selectStr, ",", -1 ); for( i = 0; i < ADDRESSBOOK_MAX_IFACE; i++ ) { if( splitStr[i] ) { - /* printf( "%d : %s\n", i, splitStr[i] ); */ + /* g_print( "%d : %s\n", i, splitStr[i] ); */ ifType = strtol( splitStr[i], &endptr, 10 ); enabled = TRUE; if( *endptr ) { @@ -4836,7 +4836,7 @@ static void addrbookctl_build_ifselect( void ) { enabled = FALSE; } } - /* printf( "\t%d : %s\n", ifType, enabled ? "yes" : "no" ); */ + /* g_print( "\t%d : %s\n", ifType, enabled ? "yes" : "no" ); */ adapter = addrbookctl_find_interface( ifType ); if( adapter ) { newList = g_list_append( newList, adapter ); @@ -4846,7 +4846,7 @@ static void addrbookctl_build_ifselect( void ) { break; } } - /* printf( "i=%d\n", i ); */ + /* g_print( "i=%d\n", i ); */ g_strfreev( splitStr ); g_free( selectStr ); diff --git a/src/addrindex.c b/src/addrindex.c index e8fac836a..6885b5644 100644 --- a/src/addrindex.c +++ b/src/addrindex.c @@ -979,7 +979,7 @@ static AddressIfFragment *addrindex_read_fragment( XMLFile *file ) { guint prevLevel; gint rc; - /* printf( "addrindex_read_fragment\n" ); */ + /* g_print( "addrindex_read_fragment\n" ); */ prevLevel = file->level; @@ -1306,7 +1306,7 @@ static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) { gboolean bTLS, bSSL; gint iMatch; - /* printf( "addrindex_parse_ldap\n" ); */ + /* g_print( "addrindex_parse_ldap\n" ); */ /* Set up some defaults */ bDynSearch = FALSE; bTLS = FALSE; @@ -1343,7 +1343,7 @@ static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) { else if( strcmp( name, ATTAG_LDAP_CRITERIA ) == 0 ) { g_free( criteria ); criteria = g_strdup( value ); - printf("criteria %s\n", criteria); + g_print("criteria %s\n", criteria); } else if( strcmp( name, ATTAG_LDAP_MAX_ENTRY ) == 0 ) { ldapctl_set_max_entries( ctl, ivalue ); @@ -1604,7 +1604,7 @@ static gint addrindex_read_file( AddressIndex *addrIndex ) { if( file == NULL ) { /* - fprintf( stdout, " file '%s' does not exist.\n", addrIndex->fileName ); + g_print( " file '%s' does not exist.\n", addrIndex->fileName ); */ return addrIndex->retVal; } @@ -1914,7 +1914,7 @@ static void addrindex_add_obj( XMLFile *file, AddressCvtNode *node ) { node->list = g_list_append( node->list, newNode ); } else { - /* printf( "invalid: !!! \n" ); */ + /* g_print( "invalid: !!! \n" ); */ attr = xml_get_current_tag_attr( file ); } } @@ -1935,11 +1935,11 @@ static void addrindex_consume_tree( XMLFile *file ) { if (file->level < prev_level) return; xtag = xml_get_current_tag( file ); - /* printf( "tag : %s\n", xtag->tag ); */ + /* g_print( "tag : %s\n", xtag->tag ); */ element = xml_get_element( file ); attr = xml_get_current_tag_attr( file ); /* show_attribs( attr ); */ - /* printf( "\ttag value : %s :\n", element ); */ + /* g_print( "\ttag value : %s :\n", element ); */ addrindex_consume_tree( file ); } } @@ -2140,7 +2140,7 @@ static void addrindex_convert_tree( AddressIndex *addrIndex, XMLFile *file ) { if (file->level < prev_level) return; xtag = xml_get_current_tag( file ); - /* printf( "tag : %d : %s\n", prev_level, xtag->tag ); */ + /* g_print( "tag : %d : %s\n", prev_level, xtag->tag ); */ if( strcmp( xtag->tag, TAG_IF_OLD_COMMON ) == 0 ) { if( addrindex_process_book( addrIndex, file, DISP_OLD_COMMON ) ) { addrIndex->needsConversion = FALSE; @@ -2160,7 +2160,7 @@ static void addrindex_convert_tree( AddressIndex *addrIndex, XMLFile *file ) { element = xml_get_element( file ); attr = xml_get_current_tag_attr( file ); /* show_attribs( attr ); */ - /* printf( "\ttag value : %s :\n", element ); */ + /* g_print( "\ttag value : %s :\n", element ); */ addrindex_consume_tree( file ); } } @@ -2175,7 +2175,7 @@ static gint addrindex_convert_data( AddressIndex *addrIndex ) { g_free( fileSpec ); if( file == NULL ) { - /* fprintf( stdout, " file '%s' does not exist.\n", addrIndex->fileName ); */ + /* g_print( " file '%s' does not exist.\n", addrIndex->fileName ); */ return addrIndex->retVal; } @@ -2371,7 +2371,7 @@ gint addrindex_ds_read_data( AddressDataSource *ds ) { if( iface->getReadData ) { /* gchar *name = ( iface->getName ) ( ds->rawDataSource ); - printf( "addrindex_ds_read_data...reading:::%s:::\n", name ); + g_print( "addrindex_ds_read_data...reading:::%s:::\n", name ); */ retVal = ( iface->getReadData ) ( ds->rawDataSource ); } @@ -2494,7 +2494,7 @@ gint addrindex_setup_search( queryID = req->queryID; qryreq_set_search_type( req, ADDRSEARCH_DYNAMIC ); - /* printf( "***> query ID ::%d::\n", queryID ); */ + /* g_print( "***> query ID ::%d::\n", queryID ); */ return queryID; } @@ -2526,7 +2526,7 @@ static gboolean addrindex_start_dynamic( QueryRequest *req ) { GList *nodeDS; gint type; - /* printf( "addrindex_start_dynamic::%d::\n", req->queryID ); */ + /* g_print( "addrindex_start_dynamic::%d::\n", req->queryID ); */ nodeIf = _addressIndex_->searchOrder; while( nodeIf ) { iface = nodeIf->data; @@ -2579,7 +2579,7 @@ void addrindex_stop_search( const gint queryID ){ AddrQueryObject *aqo; GList *node; - /* printf( "addrindex_stop_search/queryID=%d\n", queryID ); */ + /* g_print( "addrindex_stop_search/queryID=%d\n", queryID ); */ /* If query ID does not match, search has not been setup */ req = qrymgr_find_request( queryID ); if( req == NULL ) { @@ -2701,7 +2701,7 @@ gboolean addrindex_start_search( const gint queryID ) { AddrSearchType searchType; retVal = FALSE; - /* printf( "addrindex_start_search/queryID=%d\n", queryID ); */ + /* g_print( "addrindex_start_search/queryID=%d\n", queryID ); */ req = qrymgr_find_request( queryID ); if( req == NULL ) { return retVal; @@ -2728,11 +2728,11 @@ void addrindex_remove_results( AddressDataSource *ds, ItemFolder *folder ) { AddressCache *cache; gint queryID = 0; - /* printf( "addrindex_remove_results/start\n" ); */ + /* g_print( "addrindex_remove_results/start\n" ); */ /* Test for folder */ if( folder->folderType != ADDRFOLDER_QUERY_RESULTS ) return; - /* printf( "folder name ::%s::\n", ADDRITEM_NAME(folder) ); */ + /* g_print( "folder name ::%s::\n", ADDRITEM_NAME(folder) ); */ adbase = ( AddrBookBase * ) ds->rawDataSource; if( adbase == NULL ) return; cache = adbase->addressCache; @@ -2747,23 +2747,23 @@ void addrindex_remove_results( AddressDataSource *ds, ItemFolder *folder ) { qry = ( LdapQuery * ) folder->folderData; queryID = ADDRQUERY_ID(qry); - /* printf( "calling ldapquery_remove_results...queryID=%d\n", queryID ); */ + /* g_print( "calling ldapquery_remove_results...queryID=%d\n", queryID ); */ delFlag = ldapquery_remove_results( qry ); if (delFlag) { ldapqry_free( qry ); } - /* printf( "calling ldapquery_remove_results...done\n" ); */ + /* g_print( "calling ldapquery_remove_results...done\n" ); */ /* if( delFlag ) { - printf( "delFlag IS-TRUE\n" ); + g_print( "delFlag IS-TRUE\n" ); } else { - printf( "delFlag IS-FALSE\n" ); + g_print( "delFlag IS-FALSE\n" ); } */ #endif } - /* printf( "addrindex_remove_results/end\n" ); */ + /* g_print( "addrindex_remove_results/end\n" ); */ /* Delete query request */ if( queryID > 0 ) { diff --git a/src/browseldap.c b/src/browseldap.c index e7fcf8f01..d4ee0c569 100644 --- a/src/browseldap.c +++ b/src/browseldap.c @@ -126,7 +126,7 @@ static gint browse_callback_entry( node = g_list_next( node ); } pthread_mutex_unlock( & _browseMutex_ ); - /* printf( "browse_callback_entry...done\n" ); */ + /* g_print( "browse_callback_entry...done\n" ); */ return 0; } diff --git a/src/common/log.c b/src/common/log.c index e44b86f2c..d1f469d3d 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -140,7 +140,7 @@ void log_print(LogInstance instance, const gchar *format, ...) g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args); va_end(args); - if (debug_get_mode()) fputs(buf, stdout); + if (debug_get_mode()) g_print(buf); logtext->instance = instance; logtext->text = g_strdup(buf); diff --git a/src/common/socket.c b/src/common/socket.c index 08daf1b93..81ff2f96c 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -551,7 +551,7 @@ struct hostent *my_gethostbyname(const gchar *hostname) if (sigsetjmp(jmpenv, 1)) { alarm(0); signal(SIGALRM, prev_handler); - fprintf(stderr, "%s: host lookup timed out.\n", hostname); + g_printerr("%s: host lookup timed out.\n", hostname); errno = 0; return NULL; } @@ -563,7 +563,7 @@ struct hostent *my_gethostbyname(const gchar *hostname) alarm(0); signal(SIGALRM, prev_handler); #endif - fprintf(stderr, "%s: unknown host.\n", hostname); + g_printerr("%s: unknown host.\n", hostname); errno = 0; return NULL; } @@ -611,13 +611,13 @@ static gint sock_connect_by_hostname(gint sock, const gchar *hostname, if (!my_inet_aton(hostname, &ad.sin_addr)) { if ((hp = my_gethostbyname(hostname)) == NULL) { - fprintf(stderr, "%s: unknown host.\n", hostname); + g_printerr("%s: unknown host.\n", hostname); errno = 0; return -1; } if (hp->h_length != 4 && hp->h_length != 8) { - fprintf(stderr, "illegal address length received for host %s\n", hostname); + g_printerr("illegal address length received for host %s\n", hostname); errno = 0; return -1; } @@ -648,7 +648,7 @@ static gint sock_connect_by_getaddrinfo(const gchar *hostname, gushort port) g_snprintf(port_str, sizeof(port_str), "%d", port); if ((gai_error = getaddrinfo(hostname, port_str, &hints, &res)) != 0) { - fprintf(stderr, "getaddrinfo for %s:%s failed: %s\n", + g_printerr("getaddrinfo for %s:%s failed: %s\n", hostname, port_str, gai_strerror(gai_error)); return -1; } diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c index 81f9eb5eb..73e16389a 100644 --- a/src/common/ssl_certificate.c +++ b/src/common/ssl_certificate.c @@ -372,7 +372,7 @@ char *ssl_certificate_check_signer (X509 *cert) store = X509_STORE_new(); if (store == NULL) { - printf("Can't create X509_STORE\n"); + g_print("Can't create X509_STORE\n"); return NULL; } if (!X509_STORE_set_default_paths(store)) { diff --git a/src/common/utils.c b/src/common/utils.c index 57949b567..4c7367bf0 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1723,7 +1723,7 @@ gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc, decode_uri(*attach, value); for (; forbidden_uris[i]; i++) { if (strstr(*attach, forbidden_uris[i])) { - printf("Refusing to attach '%s', potential private data leak\n", + g_print("Refusing to attach '%s', potential private data leak\n", *attach); g_free(*attach); *attach = NULL; diff --git a/src/common/utils.h b/src/common/utils.h index 0ddd40990..c352ec6b1 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -180,7 +180,7 @@ gint g_chmod (const gchar *path, #define FILE_OP_ERROR(file, func) \ { \ - fprintf(stderr, "%s: ", file); \ + g_printerr("%s: ", file); \ fflush(stderr); \ perror(func); \ } diff --git a/src/crash.c b/src/crash.c index c0f3069ba..b2b6c08ae 100644 --- a/src/crash.c +++ b/src/crash.c @@ -361,7 +361,7 @@ static void crash_debug(unsigned long crash_pid, dup(choutput[1]); close(choutput[0]); if (-1 == execvp("gdb", argp)) - puts("error execvp\n"); + g_print("error execvp\n"); } else { char buf[100]; int r; @@ -372,7 +372,7 @@ static void crash_debug(unsigned long crash_pid, * make it non blocking */ if (-1 == fcntl(choutput[0], F_SETFL, O_NONBLOCK)) - puts("set to non blocking failed\n"); + g_print("set to non blocking failed\n"); /* * get the output diff --git a/src/editaddress_other_attributes_ldap.c b/src/editaddress_other_attributes_ldap.c index 706e7e826..9e6764ee0 100644 --- a/src/editaddress_other_attributes_ldap.c +++ b/src/editaddress_other_attributes_ldap.c @@ -139,7 +139,7 @@ static void edit_person_attrib_list_selected(GtkCList *clist, gint row, gint col gtk_widget_set_sensitive(personEditDlg->attrib_del, TRUE); } else { - /*fprintf(stderr, "Row: %d -> empty attribute\n", row);*/ + /*g_printerr("Row: %d -> empty attribute\n", row);*/ gtk_entry_set_text( GTK_ENTRY(personEditDlg->entry_atvalue), ""); gtk_widget_set_sensitive(personEditDlg->attrib_del, FALSE); } diff --git a/src/exporthtml.c b/src/exporthtml.c index 61487eaa3..8dca09f50 100644 --- a/src/exporthtml.c +++ b/src/exporthtml.c @@ -960,7 +960,7 @@ void exporthtml_process( htmlFile = g_fopen( ctl->path, "wb" ); if( ! htmlFile ) { /* Cannot open file */ - printf( "Cannot open file for write\n" ); + g_print( "Cannot open file for write\n" ); ctl->retVal = MGU_OPEN_FILE; return; } diff --git a/src/folder.c b/src/folder.c index 85eb5654a..32e082f21 100644 --- a/src/folder.c +++ b/src/folder.c @@ -2940,7 +2940,7 @@ static FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest, debug_print("%s %s to %s\n", copy?"Copying":"Moving", src->path, dest->path); new_item = folder_create_folder(dest, src->name); if (new_item == NULL) { - printf("Can't create folder\n"); + g_print("Can't create folder\n"); return NULL; } diff --git a/src/folderview.c b/src/folderview.c index 6d6dd2b0c..555b4f5a3 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -754,7 +754,7 @@ static gboolean folderview_defer_set(gpointer data) if (mainwin->lock_count) return TRUE; - printf("doing deferred folderview_set now\n"); + g_print("doing deferred folderview_set now\n"); folderview_set(folderview); folderview->deferred_refresh_id = -1; @@ -774,7 +774,7 @@ void folderview_set(FolderView *folderview) if (folderview->deferred_refresh_id == -1) folderview->deferred_refresh_id = g_timeout_add(500, folderview_defer_set, folderview); - printf("deferred folderview_set\n"); + g_print("deferred folderview_set\n"); return; } diff --git a/src/gtk/description_window.c b/src/gtk/description_window.c index 183d5abc3..d4e0c8e2d 100644 --- a/src/gtk/description_window.c +++ b/src/gtk/description_window.c @@ -63,7 +63,7 @@ void description_window_create(DescriptionWindow *dwindow) gtk_widget_destroy(dwindow->window); dwindow->window = NULL; } - } else printf("windows exist\n"); + } else g_print("windows exist\n"); } static void description_create(DescriptionWindow * dwindow) diff --git a/src/imap.c b/src/imap.c index 74c5ba75a..8cc1cb131 100644 --- a/src/imap.c +++ b/src/imap.c @@ -4789,7 +4789,7 @@ void imap_cancel_all(void) IMAPSession *imap_session; RemoteFolder *rfolder; - fprintf(stderr, "cancelled\n"); + g_printerr("cancelled\n"); imap_threaded_cancel(folder); rfolder = (RemoteFolder *) folder; imap_session = (IMAPSession *) rfolder->session; diff --git a/src/jpilot.c b/src/jpilot.c index 6e7fd749f..d049314ca 100644 --- a/src/jpilot.c +++ b/src/jpilot.c @@ -1175,7 +1175,7 @@ static void jpilot_load_address( ind = indPhoneLbl[k]; /* - * fprintf( stdout, "%d : %d : %20s : %s\n", k, ind, + * g_print( "%d : %d : %20s : %s\n", k, ind, * ai->phoneLabels[ind], addrEnt[3+k] ); */ if( indPhoneLbl[k] == IND_PHONE_EMAIL ) { @@ -1192,7 +1192,7 @@ static void jpilot_load_address( ind = GPOINTER_TO_INT( node->data ); if( ind > -1 ) { /* - * fprintf( stdout, "%d : %20s : %s\n", ind, ai->labels[ind], + * g_print( "%d : %20s : %s\n", ind, ai->labels[ind], * addrEnt[ind] ); */ labelEntry = addrEnt[ind]; diff --git a/src/ldapserver.c b/src/ldapserver.c index b18f34225..75c73c040 100644 --- a/src/ldapserver.c +++ b/src/ldapserver.c @@ -119,9 +119,9 @@ gint ldapsvr_get_status( LdapServer *server ) { ItemFolder *ldapsvr_get_root_folder( LdapServer *server ) { g_return_val_if_fail( server != NULL, NULL ); /* - printf( "ldapsvr_get_root_folder/start\n" ); + g_print( "ldapsvr_get_root_folder/start\n" ); ldapsvr_print_data( server, stdout ); - printf( "ldapsvr_get_root_folder/done\n" ); + g_print( "ldapsvr_get_root_folder/done\n" ); */ return addrcache_get_root_folder( server->addressCache ); } diff --git a/src/ldapupdate.c b/src/ldapupdate.c index 1ce0b779b..47472ca98 100644 --- a/src/ldapupdate.c +++ b/src/ldapupdate.c @@ -341,7 +341,7 @@ LDAP *ldapsvr_connect(LdapControl *ctl) { rc = ldap_start_tls_s(ld, NULL, NULL); if (rc != LDAP_SUCCESS) { - fprintf(stderr, "LDAP Error(tls): ldap_simple_bind_s: %s\n", + g_printerr("LDAP Error(tls): ldap_simple_bind_s: %s\n", ldap_err2string(rc)); return NULL; } @@ -354,8 +354,8 @@ LDAP *ldapsvr_connect(LdapControl *ctl) { if (* ctl->bindDN != '\0') { rc = claws_ldap_simple_bind_s(ld, ctl->bindDN, ctl->bindPass); if (rc != LDAP_SUCCESS) { - fprintf(stderr, "bindDN: %s, bindPass: %s\n", ctl->bindDN, ctl->bindPass); - fprintf(stderr, "LDAP Error(bind): ldap_simple_bind_s: %s\n", + g_printerr("bindDN: %s, bindPass: %s\n", ctl->bindDN, ctl->bindPass); + g_printerr("LDAP Error(bind): ldap_simple_bind_s: %s\n", ldap_err2string(rc)); return NULL; } @@ -673,7 +673,7 @@ void ldapsvr_print_ldapmod(LDAPMod *mods[]) { int i; g_return_if_fail(mods != NULL); - fprintf( stderr, "Type\n"); + g_printerr( "Type\n"); for (i = 0; NULL != mods[i]; i++) { LDAPMod *mod = (LDAPMod *) mods[i]; gchar **vals; @@ -683,10 +683,10 @@ void ldapsvr_print_ldapmod(LDAPMod *mods[]) { case LDAP_MOD_DELETE: mod_op = g_strdup("DELETE"); break; default: mod_op = g_strdup("UNKNOWN"); } - fprintf( stderr, "Operation: %s\tType:%s\nValues:\n", mod_op, mod->mod_type); + g_printerr( "Operation: %s\tType:%s\nValues:\n", mod_op, mod->mod_type); vals = mod->mod_vals.modv_strvals; while (*vals) { - fprintf( stderr, "\t%s\n", *vals++); + g_printerr( "\t%s\n", *vals++); } } } @@ -710,7 +710,7 @@ void ldapsvr_compare_attr(LDAP *ld, gchar *dn, gint cnt, LDAPMod *mods[]) { if (!value || strcmp(value, "") == 0) value = g_strdup("thisisonlyadummy"); rc = ldap_compare_s(ld, dn, mods[i]->mod_type, value); - fprintf(stderr, "ldap_compare for (%s:%s)\" failed[0x%x]: %s\n", + g_printerr("ldap_compare for (%s:%s)\" failed[0x%x]: %s\n", mods[i]->mod_type, value, rc, ldap_err2string(rc)); g_free(value); } @@ -747,7 +747,7 @@ int ldapsvr_compare_manual_attr(LDAP *ld, LdapServer *server, gchar *dn, char *a if (ctl) { rc = ldap_search_s(ld, ctl->baseDN, /*LDAP_SCOPE_SUBTREE*/LDAP_SCOPE_ONELEVEL, filter, NULL, 0, &res); if (rc) { - fprintf(stderr, "ldap_search for attr=%s\" failed[0x%x]: %s\n",attr, rc, ldap_err2string(rc)); + g_printerr("ldap_search for attr=%s\" failed[0x%x]: %s\n",attr, rc, ldap_err2string(rc)); retVal = -2; } else { @@ -959,7 +959,7 @@ void ldapsvr_handle_other_attributes(LDAP *ld, LdapServer *server, char *dn, GHa server->retVal = LDAPRC_ALREADY_EXIST; break; default: - fprintf(stderr, "ldap_modify for dn=%s\" failed[0x%x]: %s\n",dn, rc, ldap_err2string(rc)); + g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n",dn, rc, ldap_err2string(rc)); if (rc == 0x8) server->retVal = LDAPRC_STRONG_AUTH; else @@ -1100,7 +1100,7 @@ void ldapsvr_add_contact(LdapServer *server, GHashTable *contact) { server->retVal = LDAPRC_ALREADY_EXIST; break; default: - fprintf(stderr, "ldap_modify for dn=%s\" failed[0x%x]: %s\n",base_dn, rc, ldap_err2string(rc)); + g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n",base_dn, rc, ldap_err2string(rc)); if (rc == 0x8) server->retVal = LDAPRC_STRONG_AUTH; else @@ -1159,9 +1159,9 @@ void ldapsvr_update_contact(LdapServer *server, GHashTable *contact) { */ } else { - fprintf(stderr, "Current dn: %s\n", dn); - fprintf(stderr, "new dn: %s\n", newRdn); - fprintf(stderr, "LDAP Error(ldap_modrdn2_s) failed[0x%x]: %s\n", rc, ldap_err2string(rc)); + g_printerr("Current dn: %s\n", dn); + g_printerr("new dn: %s\n", newRdn); + g_printerr("LDAP Error(ldap_modrdn2_s) failed[0x%x]: %s\n", rc, ldap_err2string(rc)); g_free(newRdn); clean_up(ld, server, contact); return; @@ -1310,7 +1310,7 @@ void ldapsvr_update_contact(LdapServer *server, GHashTable *contact) { mods[cnt] = NULL; rc = ldap_modify_ext_s(ld, dn, mods, NULL, NULL); if (rc) { - fprintf(stderr, "ldap_modify for dn=%s\" failed[0x%x]: %s\n", + g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n", dn, rc, ldap_err2string(rc)); server->retVal = LDAPRC_NAMING_VIOLATION; } @@ -1351,7 +1351,7 @@ void ldapsvr_delete_contact(LdapServer *server, GHashTable *contact) { server->retVal = LDAPRC_SUCCESS; rc = ldap_delete_ext_s(ld, dn, NULL, NULL); if (rc) { - fprintf(stderr, "ldap_modify for dn=%s\" failed[0x%x]: %s\n", + g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n", dn, rc, ldap_err2string(rc)); server->retVal = LDAPRC_NODN; } @@ -1415,7 +1415,7 @@ void ldapsvr_update_book(LdapServer *server, ItemPerson *item) { } } else { - fprintf(stderr, "\t\tpid : ???\n"); + g_printerr("\t\tpid : ???\n"); } node = g_list_next(node); } diff --git a/src/ldif.c b/src/ldif.c index 1a0a94180..1239e76f5 100644 --- a/src/ldif.c +++ b/src/ldif.c @@ -210,17 +210,17 @@ void ldif_free( LdifFile *ldifFile ) { * \return TRUE if file opened successfully. */ static gint ldif_open_file( LdifFile* ldifFile ) { - /* printf( "Opening file\n" ); */ + /* g_print( "Opening file\n" ); */ if( ldifFile->path ) { ldifFile->file = g_fopen( ldifFile->path, "rb" ); if( ! ldifFile->file ) { - /* printf( "can't open %s\n", ldifFile->path ); */ + /* g_print( "can't open %s\n", ldifFile->path ); */ ldifFile->retVal = MGU_OPEN_FILE; return ldifFile->retVal; } } else { - /* printf( "file not specified\n" ); */ + /* g_print( "file not specified\n" ); */ ldifFile->retVal = MGU_NO_FILE; return ldifFile->retVal; } diff --git a/src/main.c b/src/main.c index ca78c5e6f..b60e74638 100644 --- a/src/main.c +++ b/src/main.c @@ -1475,7 +1475,7 @@ static void parse_cmd_opt(int argc, char *argv[]) cmd.send = TRUE; } else if (!strncmp(argv[i], "--version", 9) || !strncmp(argv[i], "-v", 2)) { - puts("Claws Mail version " VERSION); + g_print("Claws Mail version " VERSION); exit(0); } else if (!strncmp(argv[i], "--status-full", 13)) { const gchar *p = argv[i + 1]; @@ -1540,7 +1540,7 @@ static void parse_cmd_opt(int argc, char *argv[]) cmd.crash_params = g_strdup(argv[i + 1]); i++; } else if (!strncmp(argv[i], "--config-dir", sizeof "--config-dir" - 1)) { - puts(RC_DIR); + g_print(RC_DIR); exit(0); } else if (!strncmp(argv[i], "--exit", 6) || !strncmp(argv[i], "--quit", 6) || @@ -1836,7 +1836,7 @@ static gint prohibit_duplicate_launch(void) memset(buf, 0, sizeof(buf)); fd_gets(uxsock, buf, sizeof(buf)); if (strcmp2(buf, x_display)) { - printf("Claws Mail is already running on display %s.\n", + g_print("Claws Mail is already running on display %s.\n", buf); } else { fd_close(uxsock); diff --git a/src/mainwindow.c b/src/mainwindow.c index dbfe74dde..b986c2f88 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -4425,7 +4425,7 @@ void mainwindow_jump_to(const gchar *target, gboolean popup) return; if (!mainwin) { - printf("not initialized\n"); + g_print("not initialized\n"); return; } @@ -4437,7 +4437,7 @@ void mainwindow_jump_to(const gchar *target, gboolean popup) *p = '\0'; if ((item = folder_find_item_from_identifier(tmp))) { - printf("selecting folder '%s'\n", tmp); + g_print("selecting folder '%s'\n", tmp); folderview_select(mainwin->folderview, item); if (popup) main_window_popup(mainwin); @@ -4449,13 +4449,13 @@ void mainwindow_jump_to(const gchar *target, gboolean popup) if (msg) { *msg++ = '\0'; if ((item = folder_find_item_from_identifier(tmp))) { - printf("selecting folder '%s'\n", tmp); + g_print("selecting folder '%s'\n", tmp); folderview_select(mainwin->folderview, item); } else { - printf("'%s' not found\n", tmp); + g_print("'%s' not found\n", tmp); } if (item && msg && atoi(msg)) { - printf("selecting message %d\n", atoi(msg)); + g_print("selecting message %d\n", atoi(msg)); summary_select_by_msgnum(mainwin->summaryview, atoi(msg)); summary_display_msg_selected(mainwin->summaryview, FALSE); if (popup) @@ -4468,7 +4468,7 @@ void mainwindow_jump_to(const gchar *target, gboolean popup) msg[strlen(msg)-1] = '\0'; msginfo = folder_item_get_msginfo_by_msgid(item, msg); if (msginfo) { - printf("selecting message %s\n", msg); + g_print("selecting message %s\n", msg); summary_select_by_msgnum(mainwin->summaryview, msginfo->msgnum); summary_display_msg_selected(mainwin->summaryview, FALSE); if (popup) @@ -4477,13 +4477,13 @@ void mainwindow_jump_to(const gchar *target, gboolean popup) procmsg_msginfo_free(msginfo); return; } else { - printf("'%s' not found\n", msg); + g_print("'%s' not found\n", msg); } } else { - printf("'%s' not found\n", msg); + g_print("'%s' not found\n", msg); } } else { - printf("'%s' not found\n", tmp); + g_print("'%s' not found\n", tmp); } g_free(tmp); diff --git a/src/matcher.c b/src/matcher.c index 2b0b67300..2732e8d1b 100644 --- a/src/matcher.c +++ b/src/matcher.c @@ -675,7 +675,7 @@ static gboolean matcherprop_match_test(const MatcherProp *prop, matcher_test_thread, td) != 0) retval = system(cmd); else { - printf("waiting for test thread\n"); + g_print("waiting for test thread\n"); while(!td->done) { /* don't let the interface freeze while waiting */ claws_do_idle(); @@ -687,7 +687,7 @@ static gboolean matcherprop_match_test(const MatcherProp *prop, } pthread_join(pt, &res); retval = GPOINTER_TO_INT(res); - printf(" test thread returned %d\n", retval); + g_print(" test thread returned %d\n", retval); } g_free(td); #else @@ -2368,7 +2368,7 @@ void prefs_matcher_read_config(void) else { /* previous version compatibility */ - /* printf("reading filtering\n"); */ + /* g_print("reading filtering\n"); */ rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FILTERING_RC, NULL); f = g_fopen(rcpath, "rb"); @@ -2379,7 +2379,7 @@ void prefs_matcher_read_config(void) fclose(matcher_parserin); } - /* printf("reading scoring\n"); */ + /* g_print("reading scoring\n"); */ rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, SCORING_RC, NULL); f = g_fopen(rcpath, "rb"); diff --git a/src/mh.c b/src/mh.c index 37979963b..2b5cff738 100644 --- a/src/mh.c +++ b/src/mh.c @@ -1327,7 +1327,7 @@ next_token: } /* g_timer_stop(timer); - printf("mh_get_flags: %f secs\n", g_timer_elapsed(timer, NULL)); + g_print("mh_get_flags: %f secs\n", g_timer_elapsed(timer, NULL)); g_timer_destroy(timer); */ return 0; diff --git a/src/msgcache.c b/src/msgcache.c index 84bdb6714..658256bd0 100644 --- a/src/msgcache.c +++ b/src/msgcache.c @@ -324,7 +324,7 @@ gint msgcache_get_memory_usage(MsgCache *cache) { \ GET_CACHE_DATA_INT(tmp_len); \ if ((tmp_len = msgcache_get_cache_data_str(walk_data, &data, tmp_len, conv)) < 0) { \ - printf("error at rem_len:%d\n", rem_len);\ + g_print("error at rem_len:%d\n", rem_len);\ procmsg_msginfo_free(msginfo); \ error = TRUE; \ goto bail_err; \ diff --git a/src/mutt.c b/src/mutt.c index 17ce62612..4aa4a2dec 100644 --- a/src/mutt.c +++ b/src/mutt.c @@ -109,7 +109,7 @@ static gint mutt_open_file( MuttFile* muttFile ) { } } else { - /* printf( "file not specified\n" ); */ + /* g_print( "file not specified\n" ); */ muttFile->retVal = MGU_NO_FILE; return muttFile->retVal; } @@ -414,7 +414,7 @@ static void mutt_build_items( MuttFile *muttFile, AddressCache *cache, gchar *li gchar *aliasTag, *aliasName, *recipient; GSList *addrList; - /* printf( "\nBUILD >%s<\n", line ); */ + /* g_print( "\nBUILD >%s<\n", line ); */ list = mgu_parse_string( line, 3, &tCount ); if( tCount < 3 ) { if( list ) { @@ -433,10 +433,10 @@ static void mutt_build_items( MuttFile *muttFile, AddressCache *cache, gchar *li addrList = NULL; if( strcmp( aliasTag, MUTT_TAG_ALIAS ) == 0 ) { aCount = 0; - /* printf( "aliasName :%s:\n", aliasName ); */ - /* printf( "recipient :%s:\n", recipient ); */ + /* g_print( "aliasName :%s:\n", aliasName ); */ + /* g_print( "recipient :%s:\n", recipient ); */ addrList = mutt_parse_rcplist( recipient, &aCount ); - /* printf( "---\n" ); */ + /* g_print( "---\n" ); */ mutt_build_address( muttFile, cache, aliasName, addrList, aCount ); } diff --git a/src/pine.c b/src/pine.c index 36dc1bcfb..8d59d0759 100644 --- a/src/pine.c +++ b/src/pine.c @@ -112,7 +112,7 @@ static gint pine_open_file( PineFile* pineFile ) { } } else { - /* printf( "file not specified\n" ); */ + /* g_print( "file not specified\n" ); */ pineFile->retVal = MGU_NO_FILE; return pineFile->retVal; } @@ -486,7 +486,7 @@ static void pine_build_items( PineFile *pineFile, AddressCache *cache, gchar *li pine_clean_name( rec ); pine_parse_address( pineFile, cache, rec ); /* pine_print_rec( rec, stdout ); */ - /* printf( "=========\n" ); */ + /* g_print( "=========\n" ); */ if( rec->isGroup ) { /* Create group */ diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c index 156b89255..919b81e50 100644 --- a/src/plugins/demo/demo.c +++ b/src/plugins/demo/demo.c @@ -34,7 +34,7 @@ gboolean my_log_hook(gpointer source, gpointer data) { LogText *logtext = (LogText *)source; - printf("*** Demo Plugin log: %s\n", logtext->text); + g_print("*** Demo Plugin log: %s\n", logtext->text); return FALSE; } @@ -53,7 +53,7 @@ gint plugin_init(gchar **error) return -1; } - printf("Demo plugin loaded\n"); + g_print("Demo plugin loaded\n"); return 0; } @@ -62,7 +62,7 @@ gboolean plugin_done(void) { hooks_unregister_hook(LOG_APPEND_TEXT_HOOKLIST, hook_id); - printf("Demo plugin unloaded\n"); + g_print("Demo plugin unloaded\n"); return TRUE; } diff --git a/src/plugins/pgpcore/prefs_gpg.c b/src/plugins/pgpcore/prefs_gpg.c index ffdb10629..d4d907d22 100644 --- a/src/plugins/pgpcore/prefs_gpg.c +++ b/src/plugins/pgpcore/prefs_gpg.c @@ -594,7 +594,7 @@ gboolean prefs_gpg_should_skip_encryption_warning(const gchar *systemid) systems = g_strsplit(prefs_gpg_get_config()->skip_encryption_warning, ",", -1); while (systems && systems[i]) { - printf(" cmp %s %s\n", systems[i], systemid); + g_print(" cmp %s %s\n", systems[i], systemid); if (!strcmp(systems[i],systemid)) { g_strfreev(systems); return TRUE; diff --git a/src/plugins/spamassassin/libspamc.c b/src/plugins/spamassassin/libspamc.c index 3d00c5d94..dca8cda74 100644 --- a/src/plugins/spamassassin/libspamc.c +++ b/src/plugins/spamassassin/libspamc.c @@ -1186,7 +1186,7 @@ int transport_setup(struct transport *tp, int flags) WSADATA wsaData; int nCode; if ((nCode = WSAStartup(MAKEWORD(1, 1), &wsaData)) != 0) { - printf("WSAStartup() returned error code %d\n", nCode); + g_print("WSAStartup() returned error code %d\n", nCode); return EX_OSERR; } @@ -1318,7 +1318,7 @@ libspamc_log (int flags, int level, char *msg, ...) syslog (level, "%s", buf); #else (void) level; /* not used. suppress compiler warning */ - fprintf (stderr, "%s\n", buf); + g_printerr ("%s\n", buf); #endif } @@ -1355,7 +1355,7 @@ static void _test_locale_safe_string_to_float_val(float input) return; } - printf("FAIL: input=%f != output=%f\n", input, output); + g_print("FAIL: input=%f != output=%f\n", input, output); } static void unit_test_locale_safe_string_to_float(void) @@ -1368,7 +1368,7 @@ static void unit_test_locale_safe_string_to_float(void) float num; int i; - printf("starting unit_test_locale_safe_string_to_float\n"); + g_print("starting unit_test_locale_safe_string_to_float\n"); /* tests of precision */ for (i = 0; statictestset[i] != 0.0; i++) { _test_locale_safe_string_to_float_val(statictestset[i]); @@ -1380,7 +1380,7 @@ static void unit_test_locale_safe_string_to_float(void) for (num = -1000.0; num < 1000.0; num += 0.01) { _test_locale_safe_string_to_float_val(num); } - printf("finished unit_test_locale_safe_string_to_float\n"); + g_print("finished unit_test_locale_safe_string_to_float\n"); } void do_libspamc_unit_tests(void) diff --git a/src/pop.c b/src/pop.c index a4facf1b9..dbf35bb02 100644 --- a/src/pop.c +++ b/src/pop.c @@ -901,7 +901,7 @@ static Pop3ErrorValue pop3_ok(Pop3Session *session, const gchar *msg) g_free(session->error_msg); session->error_msg = g_strdup(msg); - fprintf(stderr, "POP3: %s\n", msg); + g_printerr("POP3: %s\n", msg); } else ok = PS_PROTOCOL; diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c index edc27906c..69c1b8da5 100644 --- a/src/prefs_customheader.c +++ b/src/prefs_customheader.c @@ -593,7 +593,7 @@ static void prefs_custom_header_val_from_file_cb(void) } if (g_ascii_strcasecmp("png", gdk_pixbuf_format_get_name(format))) { alertpanel_error(_("The image isn't in the correct format (PNG).")); - printf("%s\n", gdk_pixbuf_format_get_name(format)); + g_print("%s\n", gdk_pixbuf_format_get_name(format)); g_free(filename); return; } @@ -602,7 +602,7 @@ static void prefs_custom_header_val_from_file_cb(void) int i = 0; if (g_ascii_strcasecmp("xbm", gdk_pixbuf_format_get_name(format))) { alertpanel_error(_("The image isn't in the correct format (XBM).")); - printf("%s\n", gdk_pixbuf_format_get_name(format)); + g_print("%s\n", gdk_pixbuf_format_get_name(format)); g_free(filename); return; } diff --git a/src/prefs_msg_colors.c b/src/prefs_msg_colors.c index 32797d061..9acd629f7 100644 --- a/src/prefs_msg_colors.c +++ b/src/prefs_msg_colors.c @@ -717,7 +717,7 @@ static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data) prefs_common.color_new = rgbvalue; set_button_bg_color(color_buttons.btn_color_new, rgbvalue); } else { - fprintf(stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type); + g_printerr("Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type); } } diff --git a/src/procmime.c b/src/procmime.c index 01c951a9a..85fa87137 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -1898,8 +1898,8 @@ static gboolean output_func(GNode *node, gpointer data) depth = g_node_depth(node); for (i = 0; i < depth; i++) - printf(" "); - printf("%s/%s (offset:%d length:%d encoding: %d)\n", typenames[mimeinfo->type], mimeinfo->subtype, mimeinfo->offset, mimeinfo->length, mimeinfo->encoding_type); + g_print(" "); + g_print("%s/%s (offset:%d length:%d encoding: %d)\n", typenames[mimeinfo->type], mimeinfo->subtype, mimeinfo->offset, mimeinfo->length, mimeinfo->encoding_type); return FALSE; } diff --git a/src/textview.c b/src/textview.c index de774ac42..b7bca8f93 100644 --- a/src/textview.c +++ b/src/textview.c @@ -995,7 +995,7 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo) dup(pfd[1]); rc = execvp(argv[0], argv); close(pfd[1]); - printf (_("The command to view attachment " + g_print(_("The command to view attachment " "as text failed:\n" " %s\n" "Exit code %d\n"), buf, rc); @@ -1484,7 +1484,7 @@ do_quote: if (textview->uri_list) { lasturi = (ClickableText *)last->data; } else { - printf("oops (%d %d)\n", + g_print("oops (%d %d)\n", real_quotelevel, textview->prev_quote_level); } if (lasturi->is_quote == FALSE) { diff --git a/src/vcard.c b/src/vcard.c index 967a6e792..04a5eefdf 100644 --- a/src/vcard.c +++ b/src/vcard.c @@ -174,18 +174,18 @@ void vcard_free( VCardFile *cardFile ) { static gint vcard_open_file( VCardFile* cardFile ) { g_return_val_if_fail( cardFile != NULL, -1 ); - /* fprintf( stdout, "Opening file\n" ); */ + /* g_print( "Opening file\n" ); */ cardFile->addressCache->dataRead = FALSE; if( cardFile->path ) { cardFile->file = g_fopen( cardFile->path, "rb" ); if( ! cardFile->file ) { - /* fprintf( stderr, "can't open %s\n", cardFile->path ); */ + /* g_printerr( "can't open %s\n", cardFile->path ); */ cardFile->retVal = MGU_OPEN_FILE; return cardFile->retVal; } } else { - /* fprintf( stderr, "file not specified\n" ); */ + /* g_printerr( "file not specified\n" ); */ cardFile->retVal = MGU_NO_FILE; return cardFile->retVal; } @@ -445,7 +445,7 @@ static void vcard_read_file( VCardFile *cardFile ) { gchar *line = vcard_get_line( cardFile ); if( line == NULL ) break; - /* fprintf( stdout, "%s\n", line ); */ + /* g_print( "%s\n", line ); */ /* Parse line */ tagtemp = vcard_get_tagname( line, VCARD_SEP_TAG ); @@ -454,7 +454,7 @@ static void vcard_read_file( VCardFile *cardFile ) { continue; } - /* fprintf( stdout, "\ttemp: %s\n", tagtemp ); */ + /* g_print( "\ttemp: %s\n", tagtemp ); */ tagvalue = vcard_get_tagvalue( line, VCARD_SEP_TAG ); if( tagvalue == NULL ) { g_free( tagtemp ); @@ -469,40 +469,40 @@ static void vcard_read_file( VCardFile *cardFile ) { tagtemp = NULL; } - /* fprintf( stdout, "\tname: %s\n", tagname ); */ - /* fprintf( stdout, "\ttype: %s\n", tagtype ); */ - /* fprintf( stdout, "\tvalue: %s\n", tagvalue ); */ + /* g_print( "\tname: %s\n", tagname ); */ + /* g_print( "\ttype: %s\n", tagtype ); */ + /* g_print( "\tvalue: %s\n", tagvalue ); */ if( g_utf8_collate( tagtype, VCARD_TYPE_QP ) == 0 ) { /* Quoted-Printable: could span multiple lines */ tagvalue = vcard_read_qp( cardFile, tagvalue ); vcard_unescape_qp( tagvalue ); - /* fprintf( stdout, "QUOTED-PRINTABLE !!! final\n>%s<\n", tagvalue ); */ + /* g_print( "QUOTED-PRINTABLE !!! final\n>%s<\n", tagvalue ); */ } if( g_utf8_collate( tagname, VCARD_TAG_START ) == 0 && g_ascii_strcasecmp( tagvalue, VCARD_NAME ) == 0 ) { - /* fprintf( stdout, "start card\n" ); */ + /* g_print( "start card\n" ); */ vcard_free_lists( listName, listAddress, listRemarks, listID ); listName = listAddress = listRemarks = listID = NULL; } if( g_utf8_collate( tagname, VCARD_TAG_FULLNAME ) == 0 ) { - /* fprintf( stdout, "- full name: %s\n", tagvalue ); */ + /* g_print( "- full name: %s\n", tagvalue ); */ listName = g_slist_append( listName, g_strdup( tagvalue ) ); } if( g_utf8_collate( tagname, VCARD_TAG_EMAIL ) == 0 ) { - /* fprintf( stdout, "- address: %s\n", tagvalue ); */ + /* g_print( "- address: %s\n", tagvalue ); */ listAddress = g_slist_append( listAddress, g_strdup( tagvalue ) ); listRemarks = g_slist_append( listRemarks, g_strdup( tagtype ) ); } if( g_utf8_collate( tagname, VCARD_TAG_UID ) == 0 ) { - /* fprintf( stdout, "- id: %s\n", tagvalue ); */ + /* g_print( "- id: %s\n", tagvalue ); */ listID = g_slist_append( listID, g_strdup( tagvalue ) ); } if( g_utf8_collate( tagname, VCARD_TAG_END ) == 0 && g_ascii_strcasecmp( tagvalue, VCARD_NAME ) == 0 ) { /* vCard is complete */ - /* fprintf( stdout, "end card\n--\n" ); */ + /* g_print( "end card\n--\n" ); */ /* vcard_dump_lists( listName, listAddress, listRemarks, listID, stdout ); */ vcard_build_items( cardFile, listName, listAddress, listRemarks, listID ); vcard_free_lists( listName, listAddress, listRemarks, listID ); diff --git a/src/wizard.c b/src/wizard.c index 675e85266..b95eb4c83 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -408,7 +408,7 @@ static void wizard_read_defaults(void) PARSE_DEFAULT(tmpl.mboxfile); PARSE_DEFAULT(tmpl.mailbox); /* - printf("defaults:" + g_print("defaults:" "%s, %s, %s, %s, %s, %d, %s, %s, %s, %s, %s, %s, %d, %d\n", tmpl.name,tmpl.domain,tmpl.email,tmpl.organization,tmpl.smtpserver, tmpl.recvtype,tmpl.recvserver,tmpl.recvuser,tmpl.recvpass, -- 2.25.1