GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
guile-util.h
1 /********************************************************************\
2  * guile-util.h -- utility functions for using guile for GnuCash *
3  * Copyright (C) 1999 Linas Vepstas *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License*
16  * along with this program; if not, contact: *
17  * *
18  * Free Software Foundation Voice: +1-617-542-5942 *
19  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20  * Boston, MA 02110-1301, USA [email protected] *
21  * *
22 \********************************************************************/
23 
24 #ifndef GUILE_UTIL_H
25 #define GUILE_UTIL_H
26 
27 #include <glib.h>
28 #include <libguile.h>
29 
30 #include "qof.h"
31 #include "Account.h"
32 #include "gnc-guile-utils.h"
33 
34 /* Don't use this to get hold of symbols that are considered private
35  * to a given module unless the C code you're writing is considered
36  * part of that module. */
37 SCM gnc_scm_lookup(const char *module, const char *symbol);
38 
39 /* The next set of functions is for manipulating scheme
40  * representations of splits and transactions. */
41 gboolean gnc_is_split_scm(SCM scm);
42 gboolean gnc_is_trans_scm(SCM scm);
43 
44 SCM gnc_copy_split(Split *split, gboolean use_cut_semantics);
45 void gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
46  QofBook *book);
47 
48 void gnc_split_scm_set_account(SCM split_scm, Account *account);
49 void gnc_split_scm_set_memo(SCM split_scm, const char *memo);
50 void gnc_split_scm_set_action(SCM split_scm, const char *action);
51 void gnc_split_scm_set_reconcile_state(SCM split_scm, char reconcile_state);
52 void gnc_split_scm_set_amount(SCM split_scm, gnc_numeric amount);
53 void gnc_split_scm_set_value(SCM split_scm, gnc_numeric value);
54 
55 char * gnc_split_scm_get_memo(SCM split_scm);
56 char * gnc_split_scm_get_action(SCM split_scm);
57 gnc_numeric gnc_split_scm_get_amount(SCM split_scm);
58 gnc_numeric gnc_split_scm_get_value(SCM split_scm);
59 
60 SCM gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics);
61 void gnc_copy_trans_scm_onto_trans(SCM trans_scm, Transaction *trans,
62  gboolean do_commit, QofBook *book);
63 void gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
64  Transaction *trans,
65  const GncGUID *guid_1,
66  const GncGUID *guid_2,
67  gboolean do_commit,
68  QofBook *book);
69 
70 void gnc_trans_scm_set_date(SCM trans_scm, Timespec *ts);
71 void gnc_trans_scm_set_num(SCM trans_scm, const char *num);
72 void gnc_trans_scm_set_description(SCM trans_scm, const char *description);
73 void gnc_trans_scm_set_notes(SCM trans_scm, const char *notes);
74 void gnc_trans_scm_append_split_scm(SCM trans_scm, SCM split_scm);
75 
76 SCM gnc_trans_scm_get_split_scm(SCM trans_scm, int index);
77 SCM gnc_trans_scm_get_other_split_scm(SCM trans_scm, SCM split_scm);
78 int gnc_trans_scm_get_num_splits(SCM trans_scm);
79 
80 /* Two functions that return string synonyms for the terms 'debit' and
81  * 'credit' as appropriate for the given account type and user preferences.
82  * They should be g_freed when no longer needed. */
83 char * gnc_get_debit_string(GNCAccountType account_type);
84 char * gnc_get_credit_string(GNCAccountType account_type);
85 
87 typedef struct _Process Process;
88 
101 Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
102 
112 gint gnc_process_get_fd(const Process *proc, const gint std_fd);
113 
120 void gnc_detach_process(Process *proc, const gboolean kill_it);
121 
130 time64 gnc_parse_time_to_time64 (const gchar *s, const gchar *format);
131 
132 #endif
Use a 64-bit unsigned int timespec.
Definition: gnc-date.h:299
Definition: guid.h:65
Account handling public routines.
GNCAccountType
Definition: Account.h:96
Definition: SplitP.h:71
gint64 time64
Definition: gnc-date.h:83