talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 928a2e256c52c916a14efbc37521d70949f43586
parent 741ecb32d8d3a1737ab1b10348487a52a85d2f40
Author: Ricardo Mones <ricardo@mones.org>
Date:   Sat, 26 Nov 2022 19:38:00 +0100

Don't include unused debug functions in binary

Unless requested by user with the new configure flag.

Diffstat:
Mconfigure.ac | 12++++++++++++
Msrc/addrbook.c | 5+++--
Msrc/addrbook.h | 7++++---
Msrc/addrclip.c | 5+++--
Msrc/addrclip.h | 5+++--
Msrc/addressbook.c | 21+++++++++++++++------
Msrc/addrindex.c | 5+++--
7 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -333,6 +333,10 @@ AC_ARG_ENABLE(tests, [ --enable-tests Build unit tests], [enable_tests=$enableval], [enable_tests=no]) +AC_ARG_ENABLE(addressbook-debug, + [ --enable-addressbook-debug Build with addressbook debug calls], + [enable_addressbook_debug=$enableval], [enable_addressbook_debug=no]) + manualdir='${docdir}/manual' AC_ARG_WITH(manualdir, [ --with-manualdir=DIR Manual directory], @@ -1046,6 +1050,14 @@ else fi AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes") +AC_MSG_CHECKING([whether to build addressbook debug calls]) +if test x$enable_addressbook_debug = xyes; then + AC_MSG_RESULT(yes) + AC_DEFINE(DEBUG_ADDRBOOK, 1, [Define if you want addressbook debug calls]) +else + AC_MSG_RESULT(no) +fi + dnl ************************* dnl ** section for plugins ** dnl ************************* diff --git a/src/addrbook.c b/src/addrbook.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Copyright (C) 2001-2022 Match Grun and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* General functions for accessing address book files */ @@ -232,6 +231,7 @@ static void addrbook_print_book(AddressBookFile *book, FILE *stream) addrcache_print(book->addressCache, stream); } +#ifdef DEBUG_ADDRBOOK /** * Dump entire address book traversing folders. * \param book Address book. @@ -247,6 +247,7 @@ void addrbook_dump_book(AddressBookFile *book, FILE *stream) folder = book->addressCache->rootFolder; addritem_print_item_folder(folder, stream); } +#endif /** * Remove specified group from address book. Note that object should still diff --git a/src/addrbook.h b/src/addrbook.h @@ -1,11 +1,11 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2001 Match Grun + * Copyright (C) 2001-2022 Match Grun and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -52,7 +51,9 @@ struct _AddressBookFile { AddressBookFile *addrbook_create_book ( void ); void addrbook_free_book ( AddressBookFile *book ); +#ifdef DEBUG_ADDRBOOK void addrbook_dump_book ( AddressBookFile *book, FILE *stream ); +#endif void addrbook_set_name ( AddressBookFile *book, const gchar *value ); void addrbook_set_path ( AddressBookFile *book, const gchar *value ); void addrbook_set_file ( AddressBookFile *book, const gchar *value ); diff --git a/src/addrclip.c b/src/addrclip.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2002-2012 Match Grun and the Claws Mail team + * Copyright (C) 2002-2022 Match Grun and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -149,6 +148,7 @@ void addrclip_add( AddressClipboard *clipBoard, AddrSelectList *asl ) { } } +#ifdef DEBUG_ADDRBOOK /* * Show clipboard contents. * Enter: clipBoard Clipboard. @@ -186,6 +186,7 @@ void addrclip_list_show( AddressClipboard *clipBoard, FILE *stream ) { node = g_list_next( node ); } } +#endif /* Pasted address pointers */ typedef struct _AddrClip_EMail_ AddrClip_EMail; diff --git a/src/addrclip.h b/src/addrclip.h @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2002-2012 Match Grun and the Claws Mail team + * Copyright (C) 2002-2022 Match Grun and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -52,8 +51,10 @@ void addrclip_set_index ( AddressClipboard *clipBoard, void addrclip_add ( AddressClipboard *clipBoard, AddrSelectList *asl ); gboolean addrclip_is_empty ( AddressClipboard *clipBoard ); +#ifdef DEBUG_ADDRBOOK void addrclip_list_show ( AddressClipboard *clipBoard, FILE *stream ); +#endif void addrclip_delete_item ( AddressClipboard *clipBoard ); GList *addrclip_paste_copy ( AddressClipboard *clipBoard, AddressBookFile *book, diff --git a/src/addressbook.c b/src/addressbook.c @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ #ifdef HAVE_CONFIG_H @@ -2175,7 +2174,9 @@ static void addressbook_clip_cut_cb( GtkAction *action, gpointer data ) { _clipBoard_->cutFlag = TRUE; addrclip_clear( _clipBoard_ ); addrclip_add( _clipBoard_, _addressSelect_ ); - /* addrclip_list_show( _clipBoard_, stdout ); */ +#ifdef DEBUG_ADDRBOOK + addrclip_list_show( _clipBoard_, stdout ); +#endif } /** @@ -2185,7 +2186,9 @@ static void addressbook_clip_copy_cb(GtkAction *action, gpointer data) { _clipBoard_->cutFlag = FALSE; addrclip_clear( _clipBoard_ ); addrclip_add( _clipBoard_, _addressSelect_ ); - /* addrclip_list_show( _clipBoard_, stdout ); */ +#ifdef DEBUG_ADDRBOOK + addrclip_list_show( _clipBoard_, stdout ); +#endif } /** @@ -2239,7 +2242,9 @@ static void addressbook_clip_paste_cb( GtkAction *action, gpointer data ) { folderGroup = addrclip_paste_copy( _clipBoard_, abf, folder ); } - /* addrclip_list_show( _clipBoard_, stdout ); */ +#ifdef DEBUG_ADDRBOOK + addrclip_list_show( _clipBoard_, stdout ); +#endif if( folderGroup ) { /* Update tree by inserting node for each folder or group */ addressbook_treenode_add_list( @@ -2318,7 +2323,9 @@ static void addressbook_treenode_cut_cb( GtkAction *action, gpointer data ) { addressbook_treenode_to_clipboard(); addrclip_clear( _clipBoard_ ); addrclip_add( _clipBoard_, _addressSelect_ ); - /* addrclip_list_show( _clipBoard_, stdout ); */ +#ifdef DEBUG_ADDRBOOK + addrclip_list_show( _clipBoard_, stdout ); +#endif } /** @@ -2329,7 +2336,9 @@ static void addressbook_treenode_copy_cb( GtkAction *action, gpointer data ) { addressbook_treenode_to_clipboard(); addrclip_clear( _clipBoard_ ); addrclip_add( _clipBoard_, _addressSelect_ ); - /* addrclip_list_show( _clipBoard_, stdout ); */ +#ifdef DEBUG_ADDRBOOK + addrclip_list_show( _clipBoard_, stdout ); +#endif } /** diff --git a/src/addrindex.c b/src/addrindex.c @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ /* @@ -2169,7 +2168,9 @@ static gboolean addrindex_process_book( AddressIndex *addrIndex, XMLFile *file, addrindex_process_node( abf, rootNode, abf->addressCache->rootFolder, NULL, NULL ); - /* addrbook_dump_book( abf, stdout ); */ +#ifdef DEBUG_ADDRBOOK + addrbook_dump_book( abf, stdout ); +#endif addrbook_save_data( abf ); addrIndex->retVal = abf->retVal; if( abf->retVal == MGU_SUCCESS ) retVal = TRUE;