]>
Dogcows Code - chaz/homebank/blob - hb-xml.c
2d2e8130e5aa7fd3ce096295aa1e9e6a8af5d31d
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2017 Maxime DOYEN
4 * This file is part of HomeBank.
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.
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.
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/>.
23 #include "hb-transaction.h"
26 #include "ui-dialogs.h"
28 /****************************************************************************/
30 /****************************************************************************/
39 /* our global datas */
40 extern struct HomeBank
*GLOBALS
;
41 extern struct Preferences
*PREFS
;
44 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
47 // v0.1 to v0.2 : we must change account reference by making a +1 to its index references
48 static void homebank_upgrade_to_v02(void)
50 GList
*lst_acc
, *lnk_acc
;
52 GHashTable
*h_old_acc
;
55 DB( g_print("\n[hb-xml] homebank_upgrade_to_v02\n") );
57 //keep old hashtable with us
58 h_old_acc
= GLOBALS
->h_acc
;
61 lst_acc
= g_hash_table_get_values(h_old_acc
);
62 lnk_acc
= g_list_first(lst_acc
);
63 while (lnk_acc
!= NULL
)
65 Account
*acc
= lnk_acc
->data
;
71 list
= g_queue_peek_head_link(acc
->txn_queue
);
74 Transaction
*entry
= list
->data
;
77 list
= g_list_next(list
);
79 lnk_acc
= g_list_next(lnk_acc
);
83 //we loose some small memory here
84 g_hash_table_steal_all(h_old_acc
);
86 list
= g_list_first(GLOBALS
->arc_list
);
89 Archive
*entry
= list
->data
;
92 list
= g_list_next(list
);
96 // v0.2 to v0.3 : we must assume categories exists : bugs 303886, 303738
97 static void homebank_upgrade_to_v03(void)
99 GList
*lst_acc
, *lnk_acc
;
102 DB( g_print("\n[hb-xml] homebank_upgrade_to_v03\n") );
104 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
105 lnk_acc
= g_list_first(lst_acc
);
106 while (lnk_acc
!= NULL
)
108 Account
*acc
= lnk_acc
->data
;
110 list
= g_queue_peek_head_link(acc
->txn_queue
);
113 Transaction
*entry
= list
->data
;
115 da_transaction_consistency(entry
);
116 list
= g_list_next(list
);
118 lnk_acc
= g_list_next(lnk_acc
);
120 g_list_free(lst_acc
);
123 list
= g_list_first(GLOBALS
->arc_list
);
126 Archive
*entry
= list
->data
;
128 da_archive_consistency(entry
);
129 list
= g_list_next(list
);
133 static void homebank_upgrade_to_v04(void)
135 DB( g_print("\n[hb-xml] homebank_upgrade_to_v04\n") );
137 GLOBALS
->arc_list
= da_archive_sort(GLOBALS
->arc_list
);
142 // we must assume kxferacc exists in archives for internal xfer : bug 528923
143 // if not, delete automation from the archive
144 static void homebank_upgrade_to_v05(void)
148 DB( g_print("\n[hb-xml] homebank_upgrade_to_v05\n") );
150 list
= g_list_first(GLOBALS
->arc_list
);
153 Archive
*entry
= list
->data
;
155 da_archive_consistency(entry
);
156 list
= g_list_next(list
);
161 // v0.5 to v0.6 : we must change kxferacc to 0 on non Xfer transactions
163 static void homebank_upgrade_to_v06(void)
165 GList
*lst_acc
, *lnk_acc
;
168 DB( g_print("\n[hb-xml] homebank_upgrade_to_v06\n") );
170 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
171 lnk_acc
= g_list_first(lst_acc
);
172 while (lnk_acc
!= NULL
)
174 Account
*acc
= lnk_acc
->data
;
176 list
= g_queue_peek_head_link(acc
->txn_queue
);
179 Transaction
*entry
= list
->data
;
180 da_transaction_consistency(entry
);
181 list
= g_list_next(list
);
183 lnk_acc
= g_list_next(lnk_acc
);
185 g_list_free(lst_acc
);
188 list
= g_list_first(GLOBALS
->arc_list
);
191 Archive
*entry
= list
->data
;
192 da_archive_consistency(entry
);
193 list
= g_list_next(list
);
198 // v0.7 AF_BUDGET deleted instead of AF_NOBUDGET
199 static void homebank_upgrade_to_v07(void)
203 DB( g_print("\n[hb-xml] homebank_upgrade_to_v07\n") );
205 lacc
= list
= g_hash_table_get_values(GLOBALS
->h_acc
);
208 Account
*acc
= list
->data
;
210 if( acc
->flags
& AF_OLDBUDGET
) // budget include
212 acc
->flags
&= ~(AF_OLDBUDGET
);
216 acc
->flags
|= AF_NOBUDGET
;
219 list
= g_list_next(list
);
225 static void homebank_upgrade_to_v08(void)
227 GList
*lst_acc
, *lnk_acc
;
230 DB( g_print("\n[hb-xml] homebank_upgrade_to_v08\n") );
232 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
233 lnk_acc
= g_list_first(lst_acc
);
234 while (lnk_acc
!= NULL
)
236 Account
*acc
= lnk_acc
->data
;
238 list
= g_queue_peek_head_link(acc
->txn_queue
);
241 Transaction
*entry
= list
->data
;
242 da_transaction_consistency(entry
);
243 list
= g_list_next(list
);
245 lnk_acc
= g_list_next(lnk_acc
);
247 g_list_free(lst_acc
);
253 static void homebank_upgrade_to_v10(void)
255 GList
*lst_acc
, *lnk_acc
;
258 DB( g_print("\n[hb-xml] homebank_upgrade_to_v10\n") );
260 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
261 lnk_acc
= g_list_first(lst_acc
);
262 while (lnk_acc
!= NULL
)
264 Account
*acc
= lnk_acc
->data
;
266 list
= g_queue_peek_head_link(acc
->txn_queue
);
269 Transaction
*entry
= list
->data
;
271 entry
->status
= TXN_STATUS_NONE
;
272 if(entry
->flags
& OF_OLDVALID
)
273 entry
->status
= TXN_STATUS_RECONCILED
;
275 if(entry
->flags
& OF_OLDREMIND
)
276 entry
->status
= TXN_STATUS_REMIND
;
279 entry
->flags
&= ~(OF_OLDVALID
|OF_OLDREMIND
);
281 list
= g_list_next(list
);
283 lnk_acc
= g_list_next(lnk_acc
);
285 g_list_free(lst_acc
);
290 static void homebank_upgrade_to_v11(void)
294 DB( g_print("\n[hb-xml] homebank_upgrade_to_v11\n") );
296 list
= g_list_first(GLOBALS
->arc_list
);
299 Archive
*entry
= list
->data
;
301 entry
->status
= TXN_STATUS_NONE
;
302 if(entry
->flags
& OF_OLDVALID
)
303 entry
->status
= TXN_STATUS_RECONCILED
;
305 if(entry
->flags
& OF_OLDREMIND
)
306 entry
->status
= TXN_STATUS_REMIND
;
309 entry
->flags
&= ~(OF_OLDVALID
|OF_OLDREMIND
);
311 list
= g_list_next(list
);
317 // v0.6 to v0.7 : assign a default currency
318 static void homebank_upgrade_to_v12(void)
320 // set a base currency to the hbfile if not
321 DB( g_print("GLOBALS->kcur %d\n", GLOBALS
->kcur
) );
323 ui_dialog_upgrade_choose_currency();
328 // lower v0.6 : we must assume categories/payee exists
329 // and strong link to xfer
331 static void homebank_upgrade_lower_v06(void)
333 GList
*lst_acc
, *lnk_acc
;
338 DB( g_print("\n[hb-xml] homebank_upgrade_lower_v06\n") );
340 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
341 lnk_acc
= g_list_first(lst_acc
);
342 while (lnk_acc
!= NULL
)
344 Account
*acc
= lnk_acc
->data
;
346 list
= g_queue_peek_head_link(acc
->txn_queue
);
349 Transaction
*entry
= list
->data
;
351 //also strong link internal xfer
352 if(entry
->paymode
== PAYMODE_INTXFER
&& entry
->kxfer
== 0)
354 Transaction
*child
= transaction_old_get_child_transfer(entry
);
357 transaction_xfer_change_to_child(entry
, child
);
361 da_transaction_consistency(entry
);
363 list
= g_list_next(list
);
365 lnk_acc
= g_list_next(lnk_acc
);
367 g_list_free(lst_acc
);
370 lrul
= list
= g_hash_table_get_values(GLOBALS
->h_rul
);
373 Assign
*entry
= list
->data
;
375 cat
= da_cat_get(entry
->kcat
);
378 DB( g_print(" !! fixing cat for rul: %d is unknow\n", entry
->kcat
) );
382 pay
= da_pay_get(entry
->kpay
);
385 DB( g_print(" !! fixing pay for rul: %d is unknow\n", entry
->kpay
) );
390 list
= g_list_next(list
);
396 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
399 static void homebank_load_xml_acc(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
401 Account
*entry
= da_acc_malloc();
404 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
406 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
408 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
409 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
410 else if(!strcmp (attribute_names
[i
], "pos" )) { entry
->pos
= atoi(attribute_values
[i
]); }
411 else if(!strcmp (attribute_names
[i
], "type" )) { entry
->type
= atoi(attribute_values
[i
]); }
412 else if(!strcmp (attribute_names
[i
], "curr" )) { entry
->kcur
= atoi(attribute_values
[i
]); }
413 else if(!strcmp (attribute_names
[i
], "name" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->name
= g_strdup(attribute_values
[i
]); }
414 else if(!strcmp (attribute_names
[i
], "number" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->number
= g_strdup(attribute_values
[i
]); }
415 else if(!strcmp (attribute_names
[i
], "bankname")) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->bankname
= g_strdup(attribute_values
[i
]); }
416 else if(!strcmp (attribute_names
[i
], "initial" )) { entry
->initial
= g_ascii_strtod(attribute_values
[i
], NULL
); }
418 else if(!strcmp (attribute_names
[i
], "minimum" )) { entry
->minimum
= g_ascii_strtod(attribute_values
[i
], NULL
); }
419 else if(!strcmp (attribute_names
[i
], "cheque1" )) { entry
->cheque1
= atoi(attribute_values
[i
]); }
420 else if(!strcmp (attribute_names
[i
], "cheque2" )) { entry
->cheque2
= atoi(attribute_values
[i
]); }
421 else if(!strcmp (attribute_names
[i
], "notes" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->notes
= g_strdup(attribute_values
[i
]); }
424 //all attribute loaded: append
425 da_acc_insert(entry
);
429 static void homebank_load_xml_asg(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
431 Assign
*entry
= da_asg_malloc();
435 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
437 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
439 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
440 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
441 else if(!strcmp (attribute_names
[i
], "field" )) { entry
->field
= atoi(attribute_values
[i
]); }
442 else if(!strcmp (attribute_names
[i
], "name" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->text
= g_strdup(attribute_values
[i
]); }
443 else if(!strcmp (attribute_names
[i
], "payee" )) { entry
->kpay
= atoi(attribute_values
[i
]); }
444 else if(!strcmp (attribute_names
[i
], "category")) { entry
->kcat
= atoi(attribute_values
[i
]); }
445 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
447 else if(!strcmp (attribute_names
[i
], "exact" )) { exact
= atoi(attribute_values
[i
]); }
450 /* in v08 exact moved to flag */
451 if( ctx
->file_version
<= 0.7)
453 entry
->flags
= (ASGF_DOCAT
|ASGF_DOPAY
);
455 entry
->flags
|= ASGF_EXACT
;
458 //all attribute loaded: append
459 da_asg_append(entry
);
464 static void homebank_load_xml_pay(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
466 Payee
*entry
= da_pay_malloc();
469 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
471 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
473 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
474 //else if(!strcmp (attribute_names[i], "flags")) { entry->flags = atoi(attribute_values[i]); }
475 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
476 else if(!strcmp (attribute_names
[i
], "category")) { entry
->kcat
= atoi(attribute_values
[i
]); }
477 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
480 //all attribute loaded: append
481 da_pay_insert(entry
);
485 static void homebank_load_xml_prop(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
489 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
491 if(!strcmp (attribute_names
[i
], "title" )) { g_free(GLOBALS
->owner
); GLOBALS
->owner
= g_strdup(attribute_values
[i
]); }
492 else if(!strcmp (attribute_names
[i
], "curr" )) { GLOBALS
->kcur
= atoi(attribute_values
[i
]); }
493 else if(!strcmp (attribute_names
[i
], "car_category")) { GLOBALS
->vehicle_category
= atoi(attribute_values
[i
]); }
494 else if(!strcmp (attribute_names
[i
], "auto_smode" )) { GLOBALS
->auto_smode
= atoi(attribute_values
[i
]); }
495 else if(!strcmp (attribute_names
[i
], "auto_weekday")) { GLOBALS
->auto_weekday
= atoi(attribute_values
[i
]); }
496 else if(!strcmp (attribute_names
[i
], "auto_nbdays" )) { GLOBALS
->auto_nbdays
= atoi(attribute_values
[i
]); }
501 static void homebank_load_xml_cat(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
503 Category
*entry
= da_cat_malloc();
507 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
509 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
511 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
512 else if(!strcmp (attribute_names
[i
], "parent")) { entry
->parent
= atoi(attribute_values
[i
]); }
513 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
514 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
521 tmpname
= g_strdup_printf ("b%d", j
);
522 if(!(strcmp (attribute_names
[i
], tmpname
))) { entry
->budget
[j
] = g_ascii_strtod(attribute_values
[i
], NULL
); }
525 if(entry
->budget
[j
]) budget
= TRUE
;
528 entry
->flags
|= GF_BUDGET
;
532 //all attribute loaded: append
533 da_cat_insert( entry
);
537 static void homebank_load_xml_cur(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
539 Currency
*entry
= da_cur_malloc ();
542 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
544 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
546 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
547 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
548 else if(!strcmp (attribute_names
[i
], "iso" )) { entry
->iso_code
= g_strdup(attribute_values
[i
]); }
549 else if(!strcmp (attribute_names
[i
], "symb" )) { entry
->symbol
= g_strdup(attribute_values
[i
]); }
550 else if(!strcmp (attribute_names
[i
], "syprf" )) { entry
->sym_prefix
= atoi(attribute_values
[i
]); }
551 else if(!strcmp (attribute_names
[i
], "dchar" )) { entry
->decimal_char
= g_strdup(attribute_values
[i
]); }
552 else if(!strcmp (attribute_names
[i
], "gchar" )) { entry
->grouping_char
= g_strdup(attribute_values
[i
]); }
553 else if(!strcmp (attribute_names
[i
], "frac" )) { entry
->frac_digits
= atoi(attribute_values
[i
]); }
554 else if(!strcmp (attribute_names
[i
], "rate" )) { entry
->rate
= g_ascii_strtod(attribute_values
[i
], NULL
); }
555 else if(!strcmp (attribute_names
[i
], "mdate ")) { entry
->mdate
= atoi(attribute_values
[i
]); }
559 //all attribute loaded: append
560 da_cur_insert (entry
);
564 static void homebank_load_xml_tag(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
566 Tag
*entry
= da_tag_malloc();
569 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
571 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
573 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
574 //else if(!strcmp (attribute_names[i], "flags")) { entry->flags = atoi(attribute_values[i]); }
575 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
578 //all attribute loaded: append
579 da_tag_insert(entry
);
583 static void homebank_load_xml_fav(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
585 Archive
*entry
= da_archive_malloc();
589 gboolean split
= FALSE
;
592 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
594 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
596 if(!strcmp (attribute_names
[i
], "amount" )) { entry
->amount
= g_ascii_strtod(attribute_values
[i
], NULL
); }
597 else if(!strcmp (attribute_names
[i
], "account" )) { entry
->kacc
= atoi(attribute_values
[i
]); }
598 else if(!strcmp (attribute_names
[i
], "dst_account")) { entry
->kxferacc
= atoi(attribute_values
[i
]); }
599 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
600 else if(!strcmp (attribute_names
[i
], "st" )) { entry
->status
= atoi(attribute_values
[i
]); }
601 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
602 else if(!strcmp (attribute_names
[i
], "payee" )) { entry
->kpay
= atoi(attribute_values
[i
]); }
603 else if(!strcmp (attribute_names
[i
], "category" )) { entry
->kcat
= atoi(attribute_values
[i
]); }
604 else if(!strcmp (attribute_names
[i
], "wording" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->wording
= g_strdup(attribute_values
[i
]); }
605 else if(!strcmp (attribute_names
[i
], "nextdate" )) { entry
->nextdate
= atoi(attribute_values
[i
]); }
606 else if(!strcmp (attribute_names
[i
], "every" )) { entry
->every
= atoi(attribute_values
[i
]); }
607 else if(!strcmp (attribute_names
[i
], "unit" )) { entry
->unit
= atoi(attribute_values
[i
]); }
608 else if(!strcmp (attribute_names
[i
], "limit" )) { entry
->limit
= atoi(attribute_values
[i
]); }
609 else if(!strcmp (attribute_names
[i
], "weekend" )) { entry
->weekend
= atoi(attribute_values
[i
]); }
610 else if(!strcmp (attribute_names
[i
], "scat" )) { scat
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
611 else if(!strcmp (attribute_names
[i
], "samt" )) { samt
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
612 else if(!strcmp (attribute_names
[i
], "smem" )) { smem
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
618 if (da_splits_parse(entry
->splits
, scat
, samt
, smem
) > 0)
620 entry
->flags
|= OF_SPLIT
; //Flag that Splits are active
624 //all attribute loaded: append
625 GLOBALS
->arc_list
= g_list_append(GLOBALS
->arc_list
, entry
);
629 static void homebank_load_xml_ope(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
631 Transaction
*entry
= da_transaction_malloc();
635 gboolean split
= FALSE
;
638 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
640 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
642 if(!strcmp (attribute_names
[i
], "date" )) { entry
->date
= atoi(attribute_values
[i
]); }
643 else if(!strcmp (attribute_names
[i
], "amount" )) { entry
->amount
= g_ascii_strtod(attribute_values
[i
], NULL
); }
644 else if(!strcmp (attribute_names
[i
], "account" )) { entry
->kacc
= atoi(attribute_values
[i
]); }
645 else if(!strcmp (attribute_names
[i
], "dst_account")) { entry
->kxferacc
= atoi(attribute_values
[i
]); }
646 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
647 else if(!strcmp (attribute_names
[i
], "st" )) { entry
->status
= atoi(attribute_values
[i
]); }
648 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
649 else if(!strcmp (attribute_names
[i
], "payee" )) { entry
->kpay
= atoi(attribute_values
[i
]); }
650 else if(!strcmp (attribute_names
[i
], "category" )) { entry
->kcat
= atoi(attribute_values
[i
]); }
651 else if(!strcmp (attribute_names
[i
], "wording" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->wording
= g_strdup(attribute_values
[i
]); }
652 else if(!strcmp (attribute_names
[i
], "info" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->info
= g_strdup(attribute_values
[i
]); }
653 else if(!strcmp (attribute_names
[i
], "tags" ))
655 if(attribute_values
[i
] != NULL
&& strlen(attribute_values
[i
]) > 0 && strcmp(attribute_values
[i
],"(null)") != 0 )
657 transaction_tags_parse(entry
, attribute_values
[i
]);
660 else if(!strcmp (attribute_names
[i
], "kxfer" )) { entry
->kxfer
= atoi(attribute_values
[i
]); }
661 else if(!strcmp (attribute_names
[i
], "scat" )) { scat
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
662 else if(!strcmp (attribute_names
[i
], "samt" )) { samt
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
663 else if(!strcmp (attribute_names
[i
], "smem" )) { smem
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
667 //if(entry->kcat < 0)
672 if (da_splits_parse(entry
->splits
, scat
, samt
, smem
) > 0)
674 entry
->flags
|= OF_SPLIT
; //Flag that Splits are active
678 //all attribute loaded: append
679 // we use prepend here, the list will be reversed later for perf reason
680 da_transaction_prepend(entry
);
687 start_element_handler (GMarkupParseContext
*context
,
688 const gchar
*element_name
,
689 const gchar
**attribute_names
,
690 const gchar
**attribute_values
,
694 ParseContext
*ctx
= user_data
;
695 //GtkUIManager *self = ctx->self;
697 //DB( g_print("** start element: %s\n", element_name) );
699 switch(element_name
[0])
703 if(!strcmp (element_name
, "account")) //account
705 homebank_load_xml_acc(ctx
, attribute_names
, attribute_values
);
707 else if(!strcmp (element_name
, "asg")) //assign
709 homebank_load_xml_asg(ctx
, attribute_names
, attribute_values
);
716 if(!strcmp (element_name
, "pay"))
718 homebank_load_xml_pay(ctx
, attribute_names
, attribute_values
);
720 else if(!strcmp (element_name
, "properties"))
722 homebank_load_xml_prop(ctx
, attribute_names
, attribute_values
);
729 if(!strcmp (element_name
, "cat"))
731 homebank_load_xml_cat(ctx
, attribute_names
, attribute_values
);
733 else if(!strcmp (element_name
, "cur"))
735 homebank_load_xml_cur(ctx
, attribute_names
, attribute_values
);
742 if(!strcmp (element_name
, "tags"))
744 homebank_load_xml_tag(ctx
, attribute_names
, attribute_values
);
750 if(!strcmp (element_name
, "fav"))
752 homebank_load_xml_fav(ctx
, attribute_names
, attribute_values
);
759 if(!strcmp (element_name
, "ope"))
761 homebank_load_xml_ope(ctx
, attribute_names
, attribute_values
);
771 end_element_handler (GMarkupParseContext *context,
772 const gchar *element_name,
776 ParseContext *ctx = user_data;
778 //DB( g_print("-- end element: %s\n", element_name) );
784 static GMarkupParser hb_parser
= {
785 start_element_handler
,
786 NULL
, //end_element_handler,
787 NULL
, //text_handler,
793 static gboolean
hb_xml_get_version(ParseContext
*ctx
, gchar
*buffer
)
797 ctx
->file_version
= 0.0;
798 ctx
->data_version
= 0;
800 /* v3.4 add :: prevent load of future file version */
801 v_buffer
= g_strstr_len(buffer
, 50, "<homebank v=");
802 if( v_buffer
== NULL
)
805 DB( g_print("- id line: --(%.50s)\n\n", v_buffer
) );
807 ctx
->file_version
= g_ascii_strtod(v_buffer
+13, NULL
); /* a little hacky, but works ! */
808 if( ctx
->file_version
== 0.0 )
809 ctx
->file_version
= 0.1;
810 else if( ctx
->file_version
== 5.0 ) //was a mistake
811 ctx
->file_version
= 1.0;
813 v_buffer
= g_strstr_len(buffer
+13, 50, "d=");
816 DB( g_print(" d=%s)\n\n", v_buffer
) );
818 ctx
->data_version
= atoi(v_buffer
+3);
825 ** XML load homebank file: hbfile
827 gint
homebank_load_xml(gchar
*filename
)
832 GError
*error
= NULL
;
834 GMarkupParseContext
*context
;
837 DB( g_print("\n[hb-xml] homebank_load_xml\n") );
840 if (!g_file_get_contents (filename
, &buffer
, &length
, &error
))
842 //g_message ("%s", error->message);
843 retval
= XML_IO_ERROR
;
844 g_error_free (error
);
848 if( hb_xml_get_version(&ctx
, buffer
) == FALSE
)
850 return XML_FILE_ERROR
;
853 if( ctx
.file_version
> FILE_VERSION
)
855 DB( g_print("- failed: version %f is not supported (max is %f)\n", ctx
.file_version
, FILE_VERSION
) );
856 return XML_VERSION_ERROR
;
860 DB( g_print("- file ok : v=%.1f data_v=%06d\n", ctx
.file_version
, ctx
.data_version
) );
862 /* 1st: validate the file is well in utf-8 */
863 DB( g_print("- ensure UTF-8\n") );
864 buffer
= homebank_utf8_ensure(buffer
);
866 /* then process the buffer */
868 GTimer
*t
= g_timer_new();
869 g_print("- start parse\n");
872 context
= g_markup_parse_context_new (&hb_parser
, 0, &ctx
, NULL
);
875 rc
= g_markup_parse_context_parse (context
, buffer
, length
, &error
);
878 g_print("failed: %s\n", error
->message
);
883 g_markup_parse_context_end_parse(context
, &error
);
886 g_print("failed: %s\n", error
->message
);
889 g_markup_parse_context_free (context
);
892 DB( g_print("- end parse : %f sec\n", g_timer_elapsed(t
, NULL
)) );
893 DB( g_timer_destroy (t
) );
895 /* file upgrade / bugfix */
896 if( ctx
.file_version
<= 0.1 )
897 homebank_upgrade_to_v02();
898 if( ctx
.file_version
<= 0.2 )
899 homebank_upgrade_to_v03();
900 if( ctx
.file_version
<= 0.3 )
901 homebank_upgrade_to_v04();
902 if( ctx
.file_version
<= 0.4 )
903 homebank_upgrade_to_v05();
904 if( ctx
.file_version
<= 0.5 )
906 homebank_upgrade_to_v06();
907 homebank_upgrade_lower_v06();
909 if( ctx
.file_version
<= 0.6 )
911 homebank_upgrade_to_v07();
912 hbfile_sanity_check();
914 if( ctx
.file_version
<= 0.7 ) // <= 4.5
916 homebank_upgrade_to_v08();
918 if( ctx
.file_version
<= 0.8 ) // <= 4.6
920 hbfile_sanity_check();
922 if( ctx
.file_version
<= 0.9 ) // <= 4.6.3
924 hbfile_sanity_check();
925 homebank_upgrade_to_v10();
927 if( ctx
.file_version
<= 1.0 ) // <= 5.0.0
929 hbfile_sanity_check();
930 homebank_upgrade_to_v11();
932 //starting 5.0.4 data upgrade is done without changing file_version
933 if( ctx
.data_version
< 050005 ) // <= 5.0.5
935 hbfile_sanity_check();
937 if( ctx
.file_version
<= 1.1 ) // <= 5.1.0
939 hbfile_sanity_check();
940 homebank_upgrade_to_v12();
953 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
956 ** misc xml attributes methods
958 static void hb_xml_append_txt(GString
*gstring
, gchar
*attrname
, gchar
*value
)
960 if(value
!= NULL
&& *value
!= 0)
962 gchar
*escaped
= g_markup_escape_text(value
, -1);
963 g_string_append_printf(gstring
, "%s=\"%s\" ", attrname
, escaped
);
969 append_escaped_text (GString
*str
,
983 next
= g_utf8_next_char (p
);
988 g_string_append (str
, "&");
992 g_string_append (str
, "<");
996 g_string_append (str
, ">");
1000 g_string_append (str
, "'");
1004 g_string_append (str
, """);
1008 c
= g_utf8_get_char (p
);
1009 if ((0x1 <= c
&& c
<= 0x8) ||
1010 (0xa <= c
&& c
<= 0xd) || //chnaged here from b<->c to a<->d
1011 (0xe <= c
&& c
<= 0x1f) ||
1012 (0x7f <= c
&& c
<= 0x84) ||
1013 (0x86 <= c
&& c
<= 0x9f))
1014 g_string_append_printf (str
, "&#x%x;", c
);
1016 g_string_append_len (str
, p
, next
- p
);
1024 // we override g_markup_escape_text from glib to encode \n (LF) & \r (CR)
1025 static void hb_xml_append_txt_crlf(GString
*gstring
, gchar
*attrname
, gchar
*value
)
1027 if(value
!= NULL
&& *value
!= 0)
1032 //gchar *escaped = g_markup_escape_text(value, -1);
1033 length
= strlen (value
);
1034 escaped
= g_string_sized_new (length
);
1035 append_escaped_text (escaped
, value
, length
);
1036 g_string_append_printf(gstring
, "%s=\"%s\" ", attrname
, escaped
->str
);
1037 g_string_free (escaped
, TRUE
);
1041 static void hb_xml_append_int0(GString
*gstring
, gchar
*attrname
, guint32 value
)
1043 g_string_append_printf(gstring
, "%s=\"%d\" ", attrname
, value
);
1046 static void hb_xml_append_int(GString
*gstring
, gchar
*attrname
, guint32 value
)
1050 hb_xml_append_int0(gstring
, attrname
, value
);
1054 static void hb_xml_append_amt(GString
*gstring
, gchar
*attrname
, gdouble amount
)
1056 char buf
[G_ASCII_DTOSTR_BUF_SIZE
];
1058 //we must use this, as fprintf use locale decimal settings and not '.'
1059 g_ascii_dtostr (buf
, sizeof (buf
), amount
);
1060 g_string_append_printf(gstring
, "%s=\"%s\" ", attrname
, buf
);
1064 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
1068 ** XML properties save
1070 static gint
homebank_save_xml_prop(GIOChannel
*io
)
1074 gint retval
= XML_OK
;
1075 GError
*error
= NULL
;
1077 title
= GLOBALS
->owner
== NULL
? "" : GLOBALS
->owner
;
1079 node
= g_string_sized_new(255);
1081 g_string_assign(node
, "<properties ");
1083 hb_xml_append_txt(node
, "title", title
);
1084 hb_xml_append_int(node
, "curr", GLOBALS
->kcur
);
1085 hb_xml_append_int(node
, "car_category", GLOBALS
->vehicle_category
);
1086 hb_xml_append_int0(node
, "auto_smode", GLOBALS
->auto_smode
);
1087 hb_xml_append_int(node
, "auto_weekday", GLOBALS
->auto_weekday
);
1088 hb_xml_append_int(node
, "auto_nbdays", GLOBALS
->auto_nbdays
);
1090 g_string_append(node
, "/>\n");
1093 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1096 retval
= XML_IO_ERROR
;
1097 g_error_free(error
);
1100 g_string_free(node
, TRUE
);
1106 ** XML currency save
1108 static gint
homebank_save_xml_cur(GIOChannel
*io
)
1112 char buf1
[G_ASCII_DTOSTR_BUF_SIZE
];
1113 gint retval
= XML_OK
;
1115 list
= g_hash_table_get_values(GLOBALS
->h_cur
);
1116 while (list
!= NULL
)
1118 Currency
*item
= list
->data
;
1120 tmpstr
= g_markup_printf_escaped(
1121 "<cur key=\"%d\" iso=\"%s\" name=\"%s\" symb=\"%s\" syprf=\"%d\" dchar=\"%s\" gchar=\"%s\" frac=\"%d\" rate=\"%s\" mdate=\"%d\" />\n",
1128 item
->grouping_char
,
1130 g_ascii_dtostr (buf1
, sizeof (buf1
), item
->rate
),
1134 g_io_channel_write_chars(io
, tmpstr
, -1, NULL
, NULL
);
1137 list
= g_list_next(list
);
1147 static gint
homebank_save_xml_acc(GIOChannel
*io
)
1151 gint retval
= XML_OK
;
1152 GError
*error
= NULL
;
1154 node
= g_string_sized_new(255);
1156 lacc
= list
= account_glist_sorted(0);
1157 while (list
!= NULL
)
1159 Account
*item
= list
->data
;
1161 item
->flags
&= ~(AF_ADDED
|AF_CHANGED
); //delete flag
1163 g_string_assign(node
, "<account ");
1165 hb_xml_append_int(node
, "key", item
->key
);
1166 hb_xml_append_int(node
, "flags", item
->flags
);
1167 hb_xml_append_int(node
, "pos", item
->pos
);
1168 hb_xml_append_int(node
, "type", item
->type
);
1169 hb_xml_append_int(node
, "curr", item
->kcur
);
1170 hb_xml_append_txt(node
, "name", item
->name
);
1171 hb_xml_append_txt(node
, "number", item
->number
);
1172 hb_xml_append_txt(node
, "bankname", item
->bankname
);
1173 hb_xml_append_amt(node
, "initial", item
->initial
);
1175 hb_xml_append_amt(node
, "minimum", item
->minimum
);
1176 hb_xml_append_int(node
, "cheque1", item
->cheque1
);
1177 hb_xml_append_int(node
, "cheque2", item
->cheque2
);
1178 hb_xml_append_txt_crlf(node
, "notes", item
->notes
);
1180 g_string_append(node
, "/>\n");
1183 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1187 retval
= XML_IO_ERROR
;
1188 g_error_free(error
);
1191 list
= g_list_next(list
);
1194 g_string_free(node
, TRUE
);
1201 static gint
homebank_save_xml_pay(GIOChannel
*io
)
1205 gint retval
= XML_OK
;
1206 GError
*error
= NULL
;
1208 node
= g_string_sized_new(255);
1210 lpay
= list
= payee_glist_sorted(0);
1211 while (list
!= NULL
)
1213 Payee
*item
= list
->data
;
1217 g_string_assign(node
, "<pay ");
1219 hb_xml_append_int(node
, "key", item
->key
);
1220 hb_xml_append_txt(node
, "name", item
->name
);
1221 hb_xml_append_int(node
, "category", item
->kcat
);
1222 hb_xml_append_int(node
, "paymode" , item
->paymode
);
1224 g_string_append(node
, "/>\n");
1227 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1231 retval
= XML_IO_ERROR
;
1232 g_error_free(error
);
1236 list
= g_list_next(list
);
1239 g_string_free(node
, TRUE
);
1244 ** XML category save
1246 static gint
homebank_save_xml_cat(GIOChannel
*io
)
1250 char buf
[G_ASCII_DTOSTR_BUF_SIZE
];
1252 gint retval
= XML_OK
;
1253 GError
*error
= NULL
;
1255 node
= g_string_sized_new(255);
1257 lcat
= list
= category_glist_sorted(0);
1258 while (list
!= NULL
)
1260 Category
*item
= list
->data
;
1264 g_string_assign(node
, "<cat ");
1266 hb_xml_append_int(node
, "key", item
->key
);
1267 hb_xml_append_int(node
, "parent", item
->parent
);
1268 hb_xml_append_int(node
, "flags", item
->flags
);
1269 hb_xml_append_txt(node
, "name", item
->name
);
1273 if(item
->budget
[i
] != 0)
1275 g_string_append_printf(node
,"b%d=\"%s\" ", i
, g_ascii_dtostr (buf
, sizeof (buf
), item
->budget
[i
]));
1279 g_string_append(node
, "/>\n");
1282 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1286 retval
= XML_IO_ERROR
;
1287 g_error_free(error
);
1291 list
= g_list_next(list
);
1294 g_string_free(node
, TRUE
);
1301 static gint
homebank_save_xml_tag(GIOChannel
*io
)
1305 gint retval
= XML_OK
;
1306 GError
*error
= NULL
;
1308 ltag
= list
= tag_glist_sorted(0);
1309 while (list
!= NULL
)
1311 Tag
*item
= list
->data
;
1315 tmpstr
= g_markup_printf_escaped("<tag key=\"%d\" name=\"%s\"/>\n",
1321 g_io_channel_write_chars(io
, tmpstr
, -1, NULL
, &error
);
1326 retval
= XML_IO_ERROR
;
1327 g_error_free(error
);
1330 list
= g_list_next(list
);
1340 static gint
homebank_save_xml_asg(GIOChannel
*io
)
1344 gint retval
= XML_OK
;
1345 GError
*error
= NULL
;
1347 node
= g_string_sized_new(255);
1349 lasg
= list
= assign_glist_sorted(0);
1350 while (list
!= NULL
)
1352 Assign
*item
= list
->data
;
1354 g_string_assign(node
, "<asg ");
1356 hb_xml_append_int(node
, "key" , item
->key
);
1357 hb_xml_append_int(node
, "flags" , item
->flags
);
1358 hb_xml_append_int(node
, "field" , item
->field
);
1359 hb_xml_append_txt(node
, "name" , item
->text
);
1360 hb_xml_append_int(node
, "payee" , item
->kpay
);
1361 hb_xml_append_int(node
, "category", item
->kcat
);
1362 hb_xml_append_int(node
, "paymode" , item
->paymode
);
1364 g_string_append(node
, "/>\n");
1367 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1371 retval
= XML_IO_ERROR
;
1372 g_error_free(error
);
1375 list
= g_list_next(list
);
1378 g_string_free(node
, TRUE
);
1387 static gint
homebank_save_xml_arc(GIOChannel
*io
)
1391 gint retval
= XML_OK
;
1392 GError
*error
= NULL
;
1394 node
= g_string_sized_new(255);
1396 list
= g_list_first(GLOBALS
->arc_list
);
1397 while (list
!= NULL
)
1399 Archive
*item
= list
->data
;
1401 g_string_assign(node
, "<fav ");
1403 hb_xml_append_amt(node
, "amount", item
->amount
);
1404 hb_xml_append_int(node
, "account", item
->kacc
);
1405 hb_xml_append_int(node
, "dst_account", item
->kxferacc
);
1406 hb_xml_append_int(node
, "paymode", item
->paymode
);
1407 hb_xml_append_int(node
, "st", item
->status
);
1408 hb_xml_append_int(node
, "flags", item
->flags
);
1409 hb_xml_append_int(node
, "payee", item
->kpay
);
1410 hb_xml_append_int(node
, "category", item
->kcat
);
1411 hb_xml_append_txt(node
, "wording", item
->wording
);
1412 hb_xml_append_int(node
, "nextdate", item
->nextdate
);
1413 hb_xml_append_int(node
, "every", item
->every
);
1414 hb_xml_append_int(node
, "unit", item
->unit
);
1415 hb_xml_append_int(node
, "limit", item
->limit
);
1416 hb_xml_append_int(node
, "weekend", item
->weekend
);
1418 if(da_splits_count(item
->splits
) > 0)
1420 gchar
*cats
, *amounts
, *memos
;
1422 da_splits_tostring(item
->splits
, &cats
, &amounts
, &memos
);
1423 g_string_append_printf(node
, "scat=\"%s\" ", cats
);
1424 g_string_append_printf(node
, "samt=\"%s\" ", amounts
);
1427 gchar
*escaped
= g_markup_escape_text(memos
, -1);
1428 g_string_append_printf(node
, "smem=\"%s\" ", escaped
);
1436 g_string_append(node
, "/>\n");
1439 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1442 retval
= XML_IO_ERROR
;
1443 g_error_free(error
);
1446 list
= g_list_next(list
);
1448 g_string_free(node
, TRUE
);
1454 ** XML transaction save
1456 static gint
homebank_save_xml_ope(GIOChannel
*io
)
1458 GList
*lst_acc
, *lnk_acc
;
1462 gint retval
= XML_OK
;
1463 GError
*error
= NULL
;
1465 node
= g_string_sized_new(255);
1467 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
1468 lnk_acc
= g_list_first(lst_acc
);
1469 while (lnk_acc
!= NULL
)
1471 Account
*acc
= lnk_acc
->data
;
1473 list
= g_queue_peek_head_link(acc
->txn_queue
);
1474 while (list
!= NULL
)
1476 Transaction
*item
= list
->data
;
1478 item
->flags
&= ~(OF_AUTO
|OF_ADDED
|OF_CHANGED
); //delete flag
1479 tagstr
= transaction_tags_tostring(item
);
1481 g_string_assign(node
, "<ope ");
1483 hb_xml_append_int(node
, "date", item
->date
);
1484 hb_xml_append_amt(node
, "amount", item
->amount
);
1485 hb_xml_append_int(node
, "account", item
->kacc
);
1486 hb_xml_append_int(node
, "dst_account", item
->kxferacc
);
1487 hb_xml_append_int(node
, "paymode", item
->paymode
);
1488 hb_xml_append_int(node
, "st", item
->status
);
1489 hb_xml_append_int(node
, "flags", item
->flags
);
1490 hb_xml_append_int(node
, "payee", item
->kpay
);
1491 hb_xml_append_int(node
, "category", item
->kcat
);
1492 hb_xml_append_txt(node
, "wording", item
->wording
);
1493 hb_xml_append_txt(node
, "info", item
->info
);
1494 hb_xml_append_txt(node
, "tags", tagstr
);
1495 hb_xml_append_int(node
, "kxfer", item
->kxfer
);
1497 if(da_splits_count(item
->splits
) > 0)
1499 gchar
*cats
, *amounts
, *memos
;
1501 da_splits_tostring(item
->splits
, &cats
, &amounts
, &memos
);
1502 g_string_append_printf(node
, "scat=\"%s\" ", cats
);
1503 g_string_append_printf(node
, "samt=\"%s\" ", amounts
);
1506 gchar
*escaped
= g_markup_escape_text(memos
, -1);
1507 g_string_append_printf(node
, "smem=\"%s\" ", escaped
);
1515 g_string_append(node
, "/>\n");
1520 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1524 retval
= XML_IO_ERROR
;
1525 g_error_free(error
);
1528 list
= g_list_next(list
);
1531 lnk_acc
= g_list_next(lnk_acc
);
1533 g_list_free(lst_acc
);
1535 g_string_free(node
, TRUE
);
1540 ** XML save homebank file: hbfile
1542 gint
homebank_save_xml(gchar
*filename
)
1545 char buf1
[G_ASCII_DTOSTR_BUF_SIZE
];
1547 gint retval
= XML_OK
;
1548 GError
*error
= NULL
;
1550 io
= g_io_channel_new_file(filename
, "w", &error
);
1553 g_message("file error on: %s", filename
);
1554 retval
= XML_IO_ERROR
;
1557 g_print("failed: %s\n", error
->message
);
1559 g_error_free(error
);
1563 g_io_channel_write_chars(io
, "<?xml version=\"1.0\"?>\n", -1, NULL
, NULL
);
1565 outstr
= g_strdup_printf("<homebank v=\"%s\" d=\"%06d\">\n", g_ascii_dtostr (buf1
, sizeof (buf1
), FILE_VERSION
), HB_VERSION_NUM
);
1566 g_io_channel_write_chars(io
, outstr
, -1, NULL
, NULL
);
1569 retval
= homebank_save_xml_prop(io
);
1570 retval
= homebank_save_xml_cur(io
);
1571 retval
= homebank_save_xml_acc(io
);
1572 retval
= homebank_save_xml_pay(io
);
1573 retval
= homebank_save_xml_cat(io
);
1574 retval
= homebank_save_xml_tag(io
);
1575 retval
= homebank_save_xml_asg(io
);
1576 retval
= homebank_save_xml_arc(io
);
1577 retval
= homebank_save_xml_ope(io
);
1579 g_io_channel_write_chars(io
, "</homebank>\n", -1, NULL
, NULL
);
1581 g_io_channel_unref (io
);
This page took 0.104386 seconds and 3 git commands to generate.