|
GnuCash 2.4.99
|
00001 /********************************************************************\ 00002 * engine-helpers.h -- gnucash engine helper functions * 00003 * Copyright (C) 2000 Linas Vepstas <linas@linas.org> * 00004 * Copyright (C) 2001 Linux Developers Group, Inc. * 00005 * * 00006 * This program is free software; you can redistribute it and/or * 00007 * modify it under the terms of the GNU General Public License as * 00008 * published by the Free Software Foundation; either version 2 of * 00009 * the License, or (at your option) any later version. * 00010 * * 00011 * This program is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License* 00017 * along with this program; if not, contact: * 00018 * * 00019 * Free Software Foundation Voice: +1-617-542-5942 * 00020 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 00021 * Boston, MA 02110-1301, USA gnu@gnu.org * 00022 * * 00023 \********************************************************************/ 00024 00025 #ifndef ENGINE_HELPERS_H 00026 #define ENGINE_HELPERS_H 00027 00028 #include <glib.h> 00029 #include <libguile.h> 00030 00031 #include "gnc-engine.h" 00032 #include "Account.h" 00033 #include "Query.h" 00034 #include "Transaction.h" 00035 00036 Timespec gnc_transaction_get_date_posted(const Transaction *t); 00037 Timespec gnc_transaction_get_date_entered(const Transaction *t); 00038 00039 Timespec gnc_split_get_date_reconciled(const Split *s); 00040 00041 void gnc_transaction_set_date(Transaction *t, Timespec ts); 00042 00043 /* Helpers for various types */ 00044 00045 SCM gnc_timespec2timepair(Timespec t); 00046 Timespec gnc_timepair2timespec(SCM x); 00047 GDate gnc_timepair_to_GDate(SCM x); 00048 int gnc_timepair_p(SCM x); 00049 00050 SCM gnc_guid2scm(GncGUID guid); 00051 GncGUID gnc_scm2guid(SCM guid_scm); 00052 int gnc_guid_p(SCM guid_scm); 00053 00054 /* for a list of strings */ 00055 GSList * gnc_query_scm2path (SCM path_scm); 00056 00057 /* These two functions convert a query object into a scheme 00058 * representation of the query and vice-versa. They do not 00059 * simply convert a query pointer to a guile query pointer! */ 00060 SCM gnc_query2scm (QofQuery * q); 00061 QofQuery * gnc_scm2query (SCM query_scm); 00062 00063 SCM gnc_gint64_to_scm(const gint64 x); 00064 gint64 gnc_scm_to_gint64(SCM num); 00065 int gnc_gh_gint64_p(SCM num); 00066 00067 SCM gnc_numeric_to_scm(gnc_numeric arg); 00068 gnc_numeric gnc_scm_to_numeric(SCM arg); 00069 int gnc_numeric_p(SCM arg); 00070 gnc_commodity * gnc_scm_to_commodity(SCM scm); 00071 SCM gnc_commodity_to_scm (const gnc_commodity *commodity); 00072 SCM gnc_book_to_scm (const QofBook *book); 00073 00074 #endif
1.7.4