From 2e1b9f937b3e0e2f9752a03ae91b05954787b1f5 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Mon, 7 Oct 2019 16:39:23 +0200 Subject: [PATCH] engine - drop guile wrappers for obsolete functions These were marked deprecated early in the 3.x release cycle. --- bindings/engine.i | 2 - libgnucash/engine/CMakeLists.txt | 2 - libgnucash/engine/engine-deprecated.c | 208 -------------------------- libgnucash/engine/engine-deprecated.h | 90 ----------- po/POTFILES.in | 1 - 5 files changed, 303 deletions(-) delete mode 100644 libgnucash/engine/engine-deprecated.c delete mode 100644 libgnucash/engine/engine-deprecated.h diff --git a/bindings/engine.i b/bindings/engine.i index 6ecfbdfc0b..91d60c4c1c 100644 --- a/bindings/engine.i +++ b/bindings/engine.i @@ -33,7 +33,6 @@ #include "gnc-pricedb.h" #include "gnc-lot.h" #include "gnc-session.h" -#include "engine-deprecated.h" #include "engine-helpers.h" #include "gnc-engine-guile.h" #include "policy.h" @@ -80,7 +79,6 @@ engine-common.i */ %newobject gnc_account_get_full_name; %include "engine-common.i" -%include "engine-deprecated.h" #if defined(SWIGGUILE) %ignore QofLogModule; diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt index 704777ca8a..06b4e2c59d 100644 --- a/libgnucash/engine/CMakeLists.txt +++ b/libgnucash/engine/CMakeLists.txt @@ -10,7 +10,6 @@ set(engine_noinst_HEADERS SX-book.h SX-ttinfo.h TransactionP.h - engine-deprecated.h gnc-backend-prov.hpp gnc-date-p.h gnc-int128.hpp @@ -139,7 +138,6 @@ set (engine_SOURCES Transaction.c cap-gains.c cashobjects.c - engine-deprecated.c gnc-aqbanking-templates.cpp gnc-budget.c gnc-commodity.c diff --git a/libgnucash/engine/engine-deprecated.c b/libgnucash/engine/engine-deprecated.c deleted file mode 100644 index eba2641216..0000000000 --- a/libgnucash/engine/engine-deprecated.c +++ /dev/null @@ -1,208 +0,0 @@ -/********************************************************************\ - * engine-deprecated.i: Guile wrappers for deleted C functions. * - * Copyright 2018 John Ralls * - * * - * 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 2 of * - * the License, or (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 * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* The functions in this file have been removed from the C library and are - * provided here for backward compatibility. They will be removed completely - * from the next major release of GnuCash. - */ - -#include "engine-deprecated.h" - -#include - -void xaccSplitSetDateReconciledTS(Split* s, Timespec *ts) -{ - scm_c_issue_deprecation_warning("xaccSplitSetDateReconciled is deprecated. Use xaccSplitSetDateReconciledSecs instead."); - xaccSplitSetDateReconciledSecs (s, ts->tv_sec); -} - -void xaccSplitGetDateReconciledTS(Split* s, Timespec *ts) -{ - scm_c_issue_deprecation_warning("xaccSplitGetDateReconciled is deprecated. Use xaccSplitGetDateReconciledSecs instead."); - ts->tv_sec = xaccSplitGetDateReconciled (s); - ts->tv_nsec = 0; -} - -Timespec xaccSplitRetDateReconciledTS(Split* s) -{ - Timespec ts = {0, 0}; - scm_c_issue_deprecation_warning("xaccSplitSetDateReconciled is deprecated. Use xaccSplitSetDateReconciledSecs instead."); - ts.tv_sec = xaccSplitGetDateReconciled (s); - return ts; -} - -Timespec -gnc_transaction_get_date_posted(const Transaction *t) -{ - Timespec ts = {0, 0}; - scm_c_issue_deprecation_warning("gnc_transaction_get_date_posted is deprecated. Use xaccTransRetDatePosted instead."); - ts.tv_sec = xaccTransRetDatePosted(t); - return ts; -} - -Timespec -gnc_transaction_get_date_entered(const Transaction *t) -{ - Timespec ts = {0, 0}; - scm_c_issue_deprecation_warning("gnc_transaction_get_date_entered is deprecated. Use xaccTransGetDateEntered instead."); - ts.tv_sec = xaccTransRetDateEntered(t); - return ts; -} - -Timespec -gnc_split_get_date_reconciled(const Split *s) -{ - Timespec ts = {0, 0}; - scm_c_issue_deprecation_warning("gnc_split_get_date_reconciled is deprecated. Use xaccSplitGetDateReconciled instead."); - ts.tv_sec = xaccSplitGetDateReconciled(s); - return ts; -} - -void -gnc_transaction_set_date(Transaction *t, Timespec ts) -{ - scm_c_issue_deprecation_warning("gnc_transaction_set_date is deprecated. Use xaccTransSetDatePostedSecs instead."); - xaccTransSetDatePostedSecs(t, ts.tv_sec); -} - -Timespec -gncTaxTableLastModified (const GncTaxTable *table) -{ - Timespec t = {0, 0}; - scm_c_issue_deprecation_warning("gncTaxTableLastModified is deprecated. Use gncTaxTableLastModifiedSecs instead."); - t.tv_sec = gncTaxTableLastModifiedSecs (table); - return t; -} - -void -gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, - GList *lots, Account *posted_acc, Account *xfer_acc, - gnc_numeric amount, gnc_numeric exch, Timespec date, - const char *memo, const char *num, - gboolean auto_pay) -{ - scm_c_issue_deprecation_warning("gncOwnerApplyPayment is deprecated. Use gncOwnerApplyPaymentSecs instead."); - gncOwnerApplyPaymentSecs (owner, preset_txn, lots, posted_acc, - xfer_acc, amount, exch, date.tv_sec, - memo, num, auto_pay); -} - -GNCLot* -gncOwnerCreatePaymentLot (const GncOwner *owner, - Transaction **preset_txn, Account *posted_acc, - Account *xfer_acc, gnc_numeric amount, - gnc_numeric exch, Timespec date, - const char *memo, const char *num) -{ - GNCLot* lot = NULL; - scm_c_issue_deprecation_warning("gncOwnerCreatePaymentLot is deprecated. Use gncOwnerCreatePaymentLotSecs instead."); - lot = gncOwnerCreatePaymentLotSecs (owner, preset_txn, posted_acc, - xfer_acc, amount, exch, date.tv_sec, - memo, num); - return lot; -} - -void -gnc_price_set_time (GNCPrice *p, Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_price_set_time is deprecated. Use gnc_price_set_time64 instead."); - gnc_price_set_time64(p, t.tv_sec); -} - -Timespec -gnc_price_get_time (GNCPrice *p) -{ - Timespec t = {0, 0}; - scm_c_issue_deprecation_warning("gnc_price_get_time is deprecated. Use gnc_price_get_time64 instead."); - t.tv_sec = gnc_price_get_time64(p); - return t; -} - -GNCPrice* -gnc_pricedb_lookup_at_time(GNCPriceDB *db, - const gnc_commodity *commodity, - const gnc_commodity *currency, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_lookup_at_time is deprecated. Use gnc_pricedb_lookup_at_time64 instead."); - return gnc_pricedb_lookup_at_time64(db, commodity, currency, t.tv_sec); -} - -GNCPrice* -gnc_pricedb_lookup_day(GNCPriceDB *db, - const gnc_commodity *commodity, - const gnc_commodity *currency, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_lookup_day is deprecated. Use gnc_pricedb_lookup_day_t64 instead."); - return gnc_pricedb_lookup_day_t64(db, commodity, currency, t.tv_sec); -} - -GNCPrice* -gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db, - const gnc_commodity *c, - const gnc_commodity *currency, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_lookup_nearest_in_time is deprecated. Use gnc_pricedb_lookup_nearest_in_time64 instead."); - return gnc_pricedb_lookup_nearest_in_time64(db, c, currency, t.tv_sec); -} - -PriceList* -gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db, - const gnc_commodity *c, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_lookup_nearest_in_time_any_currency is deprecated. Use gnc_pricedb_lookup_nearest_in_time_any_currency_t64 instead."); - return gnc_pricedb_lookup_nearest_in_time_any_currency_t64(db, c, t.tv_sec); -} - -GNCPrice* -gnc_pricedb_lookup_latest_before(GNCPriceDB *db, - gnc_commodity *c, - gnc_commodity *currency, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_lookup_latest_before is deprecated. Use gnc_pricedb_lookup_latest_before_t64 instead."); - return gnc_pricedb_lookup_latest_before_t64(db, c, currency, t.tv_sec); -} - -PriceList* -gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db, - const gnc_commodity *c, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_lookup_latest_before_any_currency is deprecated. Use gnc_pricedb_lookup_latest_before_any_currency_t64 instead."); - return gnc_pricedb_lookup_latest_before_any_currency_t64(db, c, t.tv_sec); -} - -gnc_numeric -gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb, - gnc_numeric balance, - const gnc_commodity *balance_currency, - const gnc_commodity *new_currency, - Timespec t) -{ - scm_c_issue_deprecation_warning("gnc_pricedb_convert_balance_nearest_price is deprecated. Use gnc_pricedb_convert_balance_nearest_price_t64 instead."); - return gnc_pricedb_convert_balance_nearest_price_t64(pdb, balance, balance_currency, new_currency, t.tv_sec); -} diff --git a/libgnucash/engine/engine-deprecated.h b/libgnucash/engine/engine-deprecated.h deleted file mode 100644 index 90bd4a1ad6..0000000000 --- a/libgnucash/engine/engine-deprecated.h +++ /dev/null @@ -1,90 +0,0 @@ -/********************************************************************\ - * engine-deprecated.h: Guile wrappers for deleted C functions. * - * Copyright 2018 John Ralls * - * * - * 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 2 of * - * the License, or (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 * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" -#include "Split.h" -#include "Transaction.h" -#include "gncTaxTable.h" -#include "gncOwner.h" - -typedef struct -{ - time64 tv_sec; - time64 tv_nsec; -} Timespec; - - -void xaccSplitSetDateReconciledTS(Split* s, Timespec *ts); -void xaccSplitGetDateReconciledTS(Split* s, Timespec *ts); -Timespec xaccSplitRetDateReconciledTS(Split* s); - -Timespec gnc_transaction_get_date_posted(const Transaction *t); -Timespec gnc_transaction_get_date_entered(const Transaction *t); -Timespec gnc_split_get_date_reconciled(const Split *s); -void gnc_transaction_set_date(Transaction *t, Timespec ts); - -Timespec gncTaxTableLastModified (const GncTaxTable *table); - -void gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, - GList *lots, Account *posted_acc, Account *xfer_acc, - gnc_numeric amount, gnc_numeric exch, Timespec date, - const char *memo, const char *num, - gboolean auto_pay); - -GNCLot* gncOwnerCreatePaymentLot (const GncOwner *owner, - Transaction **preset_txn, Account *posted_acc, - Account *xfer_acc, gnc_numeric amount, - gnc_numeric exch, Timespec date, - const char *memo, const char *num); - -void gnc_price_set_time (GNCPrice *p, Timespec t); -Timespec gnc_price_get_time (GNCPrice *p); -GNCPrice* gnc_pricedb_lookup_at_time(GNCPriceDB *db, - const gnc_commodity *commodity, - const gnc_commodity *currency, - Timespec t); -GNCPrice* gnc_pricedb_lookup_day(GNCPriceDB *db, - const gnc_commodity *commodity, - const gnc_commodity *currency, - Timespec t); -GNCPrice* gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db, - const gnc_commodity *c, - const gnc_commodity *currency, - Timespec t); -PriceList* gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db, - const gnc_commodity *c, - Timespec t); -GNCPrice* gnc_pricedb_lookup_latest_before(GNCPriceDB *db, - gnc_commodity *c, - gnc_commodity *currency, - Timespec t); -PriceList* gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db, - const gnc_commodity *c, - Timespec t); -gnc_numeric -gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb, - gnc_numeric balance, - const gnc_commodity *balance_currency, - const gnc_commodity *new_currency, - Timespec t); - diff --git a/po/POTFILES.in b/po/POTFILES.in index 3134ba0bbc..96b91a996b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -626,7 +626,6 @@ libgnucash/doc/doxygen_main_page.c libgnucash/engine/Account.cpp libgnucash/engine/cap-gains.c libgnucash/engine/cashobjects.c -libgnucash/engine/engine-deprecated.c libgnucash/engine/engine-helpers.c libgnucash/engine/gncAddress.c libgnucash/engine/gnc-aqbanking-templates.cpp