]> Dogcows Code - chaz/homebank/blob - src/hb-archive.h
import homebank-5.2.4
[chaz/homebank] / src / hb-archive.h
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2019 Maxime DOYEN
3 *
4 * This file is part of HomeBank.
5 *
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * HomeBank is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef __HB_ARCHIVE_H__
21 #define __HB_ARCHIVE_H__
22
23 #include "hb-transaction.h"
24 #include "hb-split.h"
25
26 typedef struct _archive Archive;
27
28 struct _archive
29 {
30 guint32 key;
31 gdouble amount;
32 guint32 kacc;
33 gushort paymode;
34 gushort flags;
35 guint32 kpay;
36 guint32 kcat;
37 gchar *memo;
38
39 //guint32 date;
40 //gushort pos;
41 gushort status, _pad1;
42 //gchar *info;
43 guint32 *tags;
44 //guint32 kxfer; //strong link xfer key
45 guint32 kxferacc;
46
47 GPtrArray *splits;
48
49 guint32 nextdate;
50 gushort daygap;
51 gushort every;
52 gushort unit;
53 gushort limit;
54 gushort weekend;
55 };
56
57
58 /* list define archive (defarchive) */
59 enum
60 {
61 LST_DEFARC_DATAS,
62 LST_DEFARC_OLDPOS,
63 LST_DEFARC_AUTO,
64 NUM_LST_DEFARC
65 };
66
67 /*
68 ** scheduled unit
69 */
70 enum
71 {
72 AUTO_UNIT_DAY,
73 AUTO_UNIT_WEEK,
74 AUTO_UNIT_MONTH,
75 //AUTO_UNIT_QUARTER,
76 AUTO_UNIT_YEAR
77 };
78
79
80
81
82 Archive *da_archive_malloc(void);
83 Archive *da_archive_clone(Archive *src_item);
84 guint archive_add_get_nbdays(void);
85 void da_archive_free(Archive *item);
86 void da_archive_destroy(GList *list);
87 GList *da_archive_sort(GList *list);
88
89 guint da_archive_length(void);
90 gboolean da_archive_append(Archive *item);
91 gboolean da_archive_append_new(Archive *item);
92 guint32 da_archive_get_max_key(void);
93 Archive *da_archive_get(guint32 key);
94
95
96 void da_archive_consistency(Archive *item);
97
98 Archive *da_archive_init_from_transaction(Archive *arc, Transaction *txn);
99
100 gboolean scheduled_is_postable(Archive *arc);
101 guint32 scheduled_get_postdate(Archive *arc, guint32 postdate);
102 guint32 scheduled_get_latepost_count(Archive *arc, guint32 jrefdate);
103 guint32 scheduled_date_advance(Archive *arc);
104 guint32 scheduled_date_get_post_max(void);
105 gint scheduled_post_all_pending(void);
106
107
108 #endif
109
This page took 0.038762 seconds and 4 git commands to generate.