]>
Dogcows Code - chaz/homebank/blob - src/hb-xml.c
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2016 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"
28 #include "ui-dialogs.h"
30 /****************************************************************************/
32 /****************************************************************************/
41 /* our global datas */
42 extern struct HomeBank
*GLOBALS
;
43 extern struct Preferences
*PREFS
;
46 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
49 // v0.1 to v0.2 : we must change account reference by making a +1 to its index references
50 static void homebank_upgrade_to_v02(void)
52 GList
*lst_acc
, *lnk_acc
;
54 GHashTable
*h_old_acc
;
57 DB( g_print("\n[hb-xml] homebank_upgrade_to_v02\n") );
59 //keep old hashtable with us
60 h_old_acc
= GLOBALS
->h_acc
;
63 lst_acc
= g_hash_table_get_values(h_old_acc
);
64 lnk_acc
= g_list_first(lst_acc
);
65 while (lnk_acc
!= NULL
)
67 Account
*acc
= lnk_acc
->data
;
73 list
= g_queue_peek_head_link(acc
->txn_queue
);
76 Transaction
*entry
= list
->data
;
79 list
= g_list_next(list
);
81 lnk_acc
= g_list_next(lnk_acc
);
85 //we loose some small memory here
86 g_hash_table_steal_all(h_old_acc
);
88 list
= g_list_first(GLOBALS
->arc_list
);
91 Archive
*entry
= list
->data
;
94 list
= g_list_next(list
);
98 // v0.2 to v0.3 : we must assume categories exists : bugs 303886, 303738
99 static void homebank_upgrade_to_v03(void)
101 GList
*lst_acc
, *lnk_acc
;
104 DB( g_print("\n[hb-xml] homebank_upgrade_to_v03\n") );
106 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
107 lnk_acc
= g_list_first(lst_acc
);
108 while (lnk_acc
!= NULL
)
110 Account
*acc
= lnk_acc
->data
;
112 list
= g_queue_peek_head_link(acc
->txn_queue
);
115 Transaction
*entry
= list
->data
;
117 da_transaction_consistency(entry
);
118 list
= g_list_next(list
);
120 lnk_acc
= g_list_next(lnk_acc
);
122 g_list_free(lst_acc
);
125 list
= g_list_first(GLOBALS
->arc_list
);
128 Archive
*entry
= list
->data
;
130 da_archive_consistency(entry
);
131 list
= g_list_next(list
);
135 static void homebank_upgrade_to_v04(void)
137 DB( g_print("\n[hb-xml] homebank_upgrade_to_v04\n") );
139 GLOBALS
->arc_list
= da_archive_sort(GLOBALS
->arc_list
);
144 // we must assume kxferacc exists in archives for internal xfer : bug 528923
145 // if not, delete automation from the archive
146 static void homebank_upgrade_to_v05(void)
150 DB( g_print("\n[hb-xml] homebank_upgrade_to_v05\n") );
152 list
= g_list_first(GLOBALS
->arc_list
);
155 Archive
*entry
= list
->data
;
157 da_archive_consistency(entry
);
158 list
= g_list_next(list
);
163 // v0.5 to v0.6 : we must change kxferacc to 0 on non Xfer transactions
165 static void homebank_upgrade_to_v06(void)
167 GList
*lst_acc
, *lnk_acc
;
170 DB( g_print("\n[hb-xml] homebank_upgrade_to_v06\n") );
172 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
173 lnk_acc
= g_list_first(lst_acc
);
174 while (lnk_acc
!= NULL
)
176 Account
*acc
= lnk_acc
->data
;
178 list
= g_queue_peek_head_link(acc
->txn_queue
);
181 Transaction
*entry
= list
->data
;
182 da_transaction_consistency(entry
);
183 list
= g_list_next(list
);
185 lnk_acc
= g_list_next(lnk_acc
);
187 g_list_free(lst_acc
);
190 list
= g_list_first(GLOBALS
->arc_list
);
193 Archive
*entry
= list
->data
;
194 da_archive_consistency(entry
);
195 list
= g_list_next(list
);
200 // v0.7 AF_BUDGET deleted instead of AF_NOBUDGET
201 static void homebank_upgrade_to_v07(void)
205 DB( g_print("\n[hb-xml] homebank_upgrade_to_v07\n") );
207 lacc
= list
= g_hash_table_get_values(GLOBALS
->h_acc
);
210 Account
*acc
= list
->data
;
212 if( acc
->flags
& AF_OLDBUDGET
) // budget include
214 acc
->flags
&= ~(AF_OLDBUDGET
);
218 acc
->flags
|= AF_NOBUDGET
;
221 list
= g_list_next(list
);
227 static void homebank_upgrade_to_v08(void)
229 GList
*lst_acc
, *lnk_acc
;
232 DB( g_print("\n[hb-xml] homebank_upgrade_to_v08\n") );
234 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
235 lnk_acc
= g_list_first(lst_acc
);
236 while (lnk_acc
!= NULL
)
238 Account
*acc
= lnk_acc
->data
;
240 list
= g_queue_peek_head_link(acc
->txn_queue
);
243 Transaction
*entry
= list
->data
;
244 da_transaction_consistency(entry
);
245 list
= g_list_next(list
);
247 lnk_acc
= g_list_next(lnk_acc
);
249 g_list_free(lst_acc
);
255 static void homebank_upgrade_to_v10(void)
257 GList
*lst_acc
, *lnk_acc
;
260 DB( g_print("\n[hb-xml] homebank_upgrade_to_v10\n") );
262 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
263 lnk_acc
= g_list_first(lst_acc
);
264 while (lnk_acc
!= NULL
)
266 Account
*acc
= lnk_acc
->data
;
268 list
= g_queue_peek_head_link(acc
->txn_queue
);
271 Transaction
*entry
= list
->data
;
273 entry
->status
= TXN_STATUS_NONE
;
274 if(entry
->flags
& OF_OLDVALID
)
275 entry
->status
= TXN_STATUS_RECONCILED
;
277 if(entry
->flags
& OF_OLDREMIND
)
278 entry
->status
= TXN_STATUS_REMIND
;
281 entry
->flags
&= ~(OF_OLDVALID
|OF_OLDREMIND
);
283 list
= g_list_next(list
);
285 lnk_acc
= g_list_next(lnk_acc
);
287 g_list_free(lst_acc
);
292 static void homebank_upgrade_to_v11(void)
296 DB( g_print("\n[hb-xml] homebank_upgrade_to_v11\n") );
298 list
= g_list_first(GLOBALS
->arc_list
);
301 Archive
*entry
= list
->data
;
303 entry
->status
= TXN_STATUS_NONE
;
304 if(entry
->flags
& OF_OLDVALID
)
305 entry
->status
= TXN_STATUS_RECONCILED
;
307 if(entry
->flags
& OF_OLDREMIND
)
308 entry
->status
= TXN_STATUS_REMIND
;
311 entry
->flags
&= ~(OF_OLDVALID
|OF_OLDREMIND
);
313 list
= g_list_next(list
);
319 // v0.6 to v0.7 : assign a default currency
320 static void homebank_upgrade_to_v12(void)
322 // set a base currency to the hbfile if not
323 DB( g_print("GLOBALS->kcur %d\n", GLOBALS
->kcur
) );
325 ui_dialog_upgrade_choose_currency();
330 // lower v0.6 : we must assume categories/payee exists
331 // and strong link to xfer
333 static void homebank_upgrade_lower_v06(void)
335 GList
*lst_acc
, *lnk_acc
;
340 DB( g_print("\n[hb-xml] homebank_upgrade_lower_v06\n") );
342 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
343 lnk_acc
= g_list_first(lst_acc
);
344 while (lnk_acc
!= NULL
)
346 Account
*acc
= lnk_acc
->data
;
348 list
= g_queue_peek_head_link(acc
->txn_queue
);
351 Transaction
*entry
= list
->data
;
353 //also strong link internal xfer
354 if(entry
->paymode
== PAYMODE_INTXFER
&& entry
->kxfer
== 0)
356 Transaction
*child
= transaction_old_get_child_transfer(entry
);
359 transaction_xfer_change_to_child(entry
, child
);
363 da_transaction_consistency(entry
);
365 list
= g_list_next(list
);
367 lnk_acc
= g_list_next(lnk_acc
);
369 g_list_free(lst_acc
);
372 lrul
= list
= g_hash_table_get_values(GLOBALS
->h_rul
);
375 Assign
*entry
= list
->data
;
377 cat
= da_cat_get(entry
->kcat
);
380 DB( g_print(" !! fixing cat for rul: %d is unknow\n", entry
->kcat
) );
384 pay
= da_pay_get(entry
->kpay
);
387 DB( g_print(" !! fixing pay for rul: %d is unknow\n", entry
->kpay
) );
392 list
= g_list_next(list
);
398 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
401 static void homebank_load_xml_acc(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
403 Account
*entry
= da_acc_malloc();
406 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
408 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
410 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
411 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
412 else if(!strcmp (attribute_names
[i
], "pos" )) { entry
->pos
= atoi(attribute_values
[i
]); }
413 else if(!strcmp (attribute_names
[i
], "type" )) { entry
->type
= atoi(attribute_values
[i
]); }
414 else if(!strcmp (attribute_names
[i
], "curr" )) { entry
->kcur
= atoi(attribute_values
[i
]); }
415 else if(!strcmp (attribute_names
[i
], "name" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->name
= g_strdup(attribute_values
[i
]); }
416 else if(!strcmp (attribute_names
[i
], "number" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->number
= g_strdup(attribute_values
[i
]); }
417 else if(!strcmp (attribute_names
[i
], "bankname")) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->bankname
= g_strdup(attribute_values
[i
]); }
418 else if(!strcmp (attribute_names
[i
], "initial" )) { entry
->initial
= g_ascii_strtod(attribute_values
[i
], NULL
); }
420 else if(!strcmp (attribute_names
[i
], "minimum" )) { entry
->minimum
= g_ascii_strtod(attribute_values
[i
], NULL
); }
421 else if(!strcmp (attribute_names
[i
], "cheque1" )) { entry
->cheque1
= atoi(attribute_values
[i
]); }
422 else if(!strcmp (attribute_names
[i
], "cheque2" )) { entry
->cheque2
= atoi(attribute_values
[i
]); }
423 else if(!strcmp (attribute_names
[i
], "notes" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->notes
= g_strdup(attribute_values
[i
]); }
426 //all attribute loaded: append
427 da_acc_insert(entry
);
431 static void homebank_load_xml_asg(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
433 Assign
*entry
= da_asg_malloc();
437 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
439 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
441 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
442 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
443 else if(!strcmp (attribute_names
[i
], "field" )) { entry
->field
= atoi(attribute_values
[i
]); }
444 else if(!strcmp (attribute_names
[i
], "name" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->text
= g_strdup(attribute_values
[i
]); }
445 else if(!strcmp (attribute_names
[i
], "payee" )) { entry
->kpay
= atoi(attribute_values
[i
]); }
446 else if(!strcmp (attribute_names
[i
], "category")) { entry
->kcat
= atoi(attribute_values
[i
]); }
447 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
449 else if(!strcmp (attribute_names
[i
], "exact" )) { exact
= atoi(attribute_values
[i
]); }
452 /* in v08 exact moved to flag */
453 if( ctx
->file_version
<= 0.7)
455 entry
->flags
= (ASGF_DOCAT
|ASGF_DOPAY
);
457 entry
->flags
|= ASGF_EXACT
;
460 //all attribute loaded: append
461 da_asg_append(entry
);
466 static void homebank_load_xml_pay(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
468 Payee
*entry
= da_pay_malloc();
471 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
473 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
475 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
476 //else if(!strcmp (attribute_names[i], "flags")) { entry->flags = atoi(attribute_values[i]); }
477 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
478 else if(!strcmp (attribute_names
[i
], "category")) { entry
->kcat
= atoi(attribute_values
[i
]); }
479 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
482 //all attribute loaded: append
483 da_pay_insert(entry
);
487 static void homebank_load_xml_prop(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
491 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
493 if(!strcmp (attribute_names
[i
], "title" )) { g_free(GLOBALS
->owner
); GLOBALS
->owner
= g_strdup(attribute_values
[i
]); }
494 else if(!strcmp (attribute_names
[i
], "curr" )) { GLOBALS
->kcur
= atoi(attribute_values
[i
]); }
495 else if(!strcmp (attribute_names
[i
], "car_category")) { GLOBALS
->vehicle_category
= atoi(attribute_values
[i
]); }
496 else if(!strcmp (attribute_names
[i
], "auto_smode" )) { GLOBALS
->auto_smode
= atoi(attribute_values
[i
]); }
497 else if(!strcmp (attribute_names
[i
], "auto_weekday")) { GLOBALS
->auto_weekday
= atoi(attribute_values
[i
]); }
498 else if(!strcmp (attribute_names
[i
], "auto_nbdays" )) { GLOBALS
->auto_nbdays
= atoi(attribute_values
[i
]); }
503 static void homebank_load_xml_cat(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
505 Category
*entry
= da_cat_malloc();
509 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
511 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
513 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
514 else if(!strcmp (attribute_names
[i
], "parent")) { entry
->parent
= atoi(attribute_values
[i
]); }
515 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
516 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
523 tmpname
= g_strdup_printf ("b%d", j
);
524 if(!(strcmp (attribute_names
[i
], tmpname
))) { entry
->budget
[j
] = g_ascii_strtod(attribute_values
[i
], NULL
); }
527 if(entry
->budget
[j
]) budget
= TRUE
;
530 entry
->flags
|= GF_BUDGET
;
534 //all attribute loaded: append
535 da_cat_insert( entry
);
539 static void homebank_load_xml_cur(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
541 Currency
*entry
= da_cur_malloc ();
544 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
546 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
548 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
549 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
550 else if(!strcmp (attribute_names
[i
], "iso" )) { entry
->iso_code
= g_strdup(attribute_values
[i
]); }
551 else if(!strcmp (attribute_names
[i
], "symb" )) { entry
->symbol
= g_strdup(attribute_values
[i
]); }
552 else if(!strcmp (attribute_names
[i
], "syprf" )) { entry
->sym_prefix
= atoi(attribute_values
[i
]); }
553 else if(!strcmp (attribute_names
[i
], "dchar" )) { entry
->decimal_char
= g_strdup(attribute_values
[i
]); }
554 else if(!strcmp (attribute_names
[i
], "gchar" )) { entry
->grouping_char
= g_strdup(attribute_values
[i
]); }
555 else if(!strcmp (attribute_names
[i
], "frac" )) { entry
->frac_digits
= atoi(attribute_values
[i
]); }
556 else if(!strcmp (attribute_names
[i
], "rate" )) { entry
->rate
= g_ascii_strtod(attribute_values
[i
], NULL
); }
557 else if(!strcmp (attribute_names
[i
], "mdate ")) { entry
->mdate
= atoi(attribute_values
[i
]); }
561 //all attribute loaded: append
562 da_cur_insert (entry
);
566 static void homebank_load_xml_tag(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
568 Tag
*entry
= da_tag_malloc();
571 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
573 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
575 if(!strcmp (attribute_names
[i
], "key" )) { entry
->key
= atoi(attribute_values
[i
]); }
576 //else if(!strcmp (attribute_names[i], "flags")) { entry->flags = atoi(attribute_values[i]); }
577 else if(!strcmp (attribute_names
[i
], "name" )) { entry
->name
= g_strdup(attribute_values
[i
]); }
580 //all attribute loaded: append
581 da_tag_insert(entry
);
585 static void homebank_load_xml_fav(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
587 Archive
*entry
= da_archive_malloc();
591 gboolean split
= FALSE
;
594 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
596 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
598 if(!strcmp (attribute_names
[i
], "amount" )) { entry
->amount
= g_ascii_strtod(attribute_values
[i
], NULL
); }
599 else if(!strcmp (attribute_names
[i
], "account" )) { entry
->kacc
= atoi(attribute_values
[i
]); }
600 else if(!strcmp (attribute_names
[i
], "dst_account")) { entry
->kxferacc
= atoi(attribute_values
[i
]); }
601 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
602 else if(!strcmp (attribute_names
[i
], "st" )) { entry
->status
= atoi(attribute_values
[i
]); }
603 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
604 else if(!strcmp (attribute_names
[i
], "payee" )) { entry
->kpay
= atoi(attribute_values
[i
]); }
605 else if(!strcmp (attribute_names
[i
], "category" )) { entry
->kcat
= atoi(attribute_values
[i
]); }
606 else if(!strcmp (attribute_names
[i
], "wording" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->wording
= g_strdup(attribute_values
[i
]); }
607 else if(!strcmp (attribute_names
[i
], "nextdate" )) { entry
->nextdate
= atoi(attribute_values
[i
]); }
608 else if(!strcmp (attribute_names
[i
], "every" )) { entry
->every
= atoi(attribute_values
[i
]); }
609 else if(!strcmp (attribute_names
[i
], "unit" )) { entry
->unit
= atoi(attribute_values
[i
]); }
610 else if(!strcmp (attribute_names
[i
], "limit" )) { entry
->limit
= atoi(attribute_values
[i
]); }
611 else if(!strcmp (attribute_names
[i
], "weekend" )) { entry
->weekend
= atoi(attribute_values
[i
]); }
612 else if(!strcmp (attribute_names
[i
], "scat" )) { scat
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
613 else if(!strcmp (attribute_names
[i
], "samt" )) { samt
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
614 else if(!strcmp (attribute_names
[i
], "smem" )) { smem
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
620 if (da_splits_parse(entry
->splits
, scat
, samt
, smem
) > 0)
622 entry
->flags
|= OF_SPLIT
; //Flag that Splits are active
626 //all attribute loaded: append
627 GLOBALS
->arc_list
= g_list_append(GLOBALS
->arc_list
, entry
);
631 static void homebank_load_xml_ope(ParseContext
*ctx
, const gchar
**attribute_names
, const gchar
**attribute_values
)
633 Transaction
*entry
= da_transaction_malloc();
637 gboolean split
= FALSE
;
640 for (i
= 0; attribute_names
[i
] != NULL
; i
++)
642 //DB( g_print(" att='%s' val='%s'\n", attribute_names[i], attribute_values[i]) );
644 if(!strcmp (attribute_names
[i
], "date" )) { entry
->date
= atoi(attribute_values
[i
]); }
645 else if(!strcmp (attribute_names
[i
], "amount" )) { entry
->amount
= g_ascii_strtod(attribute_values
[i
], NULL
); }
646 else if(!strcmp (attribute_names
[i
], "account" )) { entry
->kacc
= atoi(attribute_values
[i
]); }
647 else if(!strcmp (attribute_names
[i
], "dst_account")) { entry
->kxferacc
= atoi(attribute_values
[i
]); }
648 else if(!strcmp (attribute_names
[i
], "paymode" )) { entry
->paymode
= atoi(attribute_values
[i
]); }
649 else if(!strcmp (attribute_names
[i
], "st" )) { entry
->status
= atoi(attribute_values
[i
]); }
650 else if(!strcmp (attribute_names
[i
], "flags" )) { entry
->flags
= atoi(attribute_values
[i
]); }
651 else if(!strcmp (attribute_names
[i
], "payee" )) { entry
->kpay
= atoi(attribute_values
[i
]); }
652 else if(!strcmp (attribute_names
[i
], "category" )) { entry
->kcat
= atoi(attribute_values
[i
]); }
653 else if(!strcmp (attribute_names
[i
], "wording" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->wording
= g_strdup(attribute_values
[i
]); }
654 else if(!strcmp (attribute_names
[i
], "info" )) { if(strcmp(attribute_values
[i
],"(null)") && attribute_values
[i
] != NULL
) entry
->info
= g_strdup(attribute_values
[i
]); }
655 else if(!strcmp (attribute_names
[i
], "tags" ))
657 if(attribute_values
[i
] != NULL
&& strlen(attribute_values
[i
]) > 0 && strcmp(attribute_values
[i
],"(null)") != 0 )
659 transaction_tags_parse(entry
, attribute_values
[i
]);
662 else if(!strcmp (attribute_names
[i
], "kxfer" )) { entry
->kxfer
= atoi(attribute_values
[i
]); }
663 else if(!strcmp (attribute_names
[i
], "scat" )) { scat
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
664 else if(!strcmp (attribute_names
[i
], "samt" )) { samt
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
665 else if(!strcmp (attribute_names
[i
], "smem" )) { smem
= (gchar
*)attribute_values
[i
]; split
= TRUE
; }
669 //if(entry->kcat < 0)
674 if (da_splits_parse(entry
->splits
, scat
, samt
, smem
) > 0)
676 entry
->flags
|= OF_SPLIT
; //Flag that Splits are active
680 //all attribute loaded: append
681 // we use prepend here, the list will be reversed later for perf reason
682 da_transaction_prepend(entry
);
689 start_element_handler (GMarkupParseContext
*context
,
690 const gchar
*element_name
,
691 const gchar
**attribute_names
,
692 const gchar
**attribute_values
,
696 ParseContext
*ctx
= user_data
;
697 //GtkUIManager *self = ctx->self;
699 //DB( g_print("** start element: %s\n", element_name) );
701 switch(element_name
[0])
705 if(!strcmp (element_name
, "account")) //account
707 homebank_load_xml_acc(ctx
, attribute_names
, attribute_values
);
709 else if(!strcmp (element_name
, "asg")) //assign
711 homebank_load_xml_asg(ctx
, attribute_names
, attribute_values
);
718 if(!strcmp (element_name
, "pay"))
720 homebank_load_xml_pay(ctx
, attribute_names
, attribute_values
);
722 else if(!strcmp (element_name
, "properties"))
724 homebank_load_xml_prop(ctx
, attribute_names
, attribute_values
);
731 if(!strcmp (element_name
, "cat"))
733 homebank_load_xml_cat(ctx
, attribute_names
, attribute_values
);
735 else if(!strcmp (element_name
, "cur"))
737 homebank_load_xml_cur(ctx
, attribute_names
, attribute_values
);
744 if(!strcmp (element_name
, "tags"))
746 homebank_load_xml_tag(ctx
, attribute_names
, attribute_values
);
752 if(!strcmp (element_name
, "fav"))
754 homebank_load_xml_fav(ctx
, attribute_names
, attribute_values
);
761 if(!strcmp (element_name
, "ope"))
763 homebank_load_xml_ope(ctx
, attribute_names
, attribute_values
);
773 end_element_handler (GMarkupParseContext *context,
774 const gchar *element_name,
778 ParseContext *ctx = user_data;
780 //DB( g_print("-- end element: %s\n", element_name) );
786 static GMarkupParser hb_parser
= {
787 start_element_handler
,
788 NULL
, //end_element_handler,
789 NULL
, //text_handler,
795 static gboolean
hb_xml_get_version(ParseContext
*ctx
, gchar
*buffer
)
799 ctx
->file_version
= 0.0;
800 ctx
->data_version
= 0;
802 /* v3.4 add :: prevent load of future file version */
803 v_buffer
= g_strstr_len(buffer
, 50, "<homebank v=");
804 if( v_buffer
== NULL
)
807 DB( g_print("- id line: --(%.50s)\n\n", v_buffer
) );
809 ctx
->file_version
= g_ascii_strtod(v_buffer
+13, NULL
); /* a little hacky, but works ! */
810 if( ctx
->file_version
== 0.0 )
811 ctx
->file_version
= 0.1;
812 else if( ctx
->file_version
== 5.0 ) //was a mistake
813 ctx
->file_version
= 1.0;
815 v_buffer
= g_strstr_len(buffer
+13, 50, "d=");
818 DB( g_print(" d=%s)\n\n", v_buffer
) );
820 ctx
->data_version
= atoi(v_buffer
+3);
827 ** XML load homebank file: hbfile
829 gint
homebank_load_xml(gchar
*filename
)
834 GError
*error
= NULL
;
836 GMarkupParseContext
*context
;
839 DB( g_print("\n[hb-xml] homebank_load_xml\n") );
841 GValue filename_val
= G_VALUE_INIT
;
842 ext_hook("load_file", EXT_STRING(&filename_val
, filename
), NULL
);
845 if (!g_file_get_contents (filename
, &buffer
, &length
, &error
))
847 //g_message ("%s", error->message);
848 retval
= XML_IO_ERROR
;
849 g_error_free (error
);
853 if( hb_xml_get_version(&ctx
, buffer
) == FALSE
)
855 return XML_FILE_ERROR
;
858 if( ctx
.file_version
> FILE_VERSION
)
860 DB( g_print("- failed: version %f is not supported (max is %f)\n", ctx
.file_version
, FILE_VERSION
) );
861 return XML_VERSION_ERROR
;
865 DB( g_print("- file ok : v=%.1f data_v=%06d\n", ctx
.file_version
, ctx
.data_version
) );
867 /* 1st: validate the file is well in utf-8 */
868 DB( g_print("- ensure UTF-8\n") );
869 buffer
= homebank_utf8_ensure(buffer
);
871 /* then process the buffer */
873 GTimer
*t
= g_timer_new();
874 g_print("- start parse\n");
877 context
= g_markup_parse_context_new (&hb_parser
, 0, &ctx
, NULL
);
880 rc
= g_markup_parse_context_parse (context
, buffer
, length
, &error
);
883 g_print("failed: %s\n", error
->message
);
888 g_markup_parse_context_end_parse(context
, &error
);
891 g_print("failed: %s\n", error
->message
);
894 g_markup_parse_context_free (context
);
897 DB( g_print("- end parse : %f sec\n", g_timer_elapsed(t
, NULL
)) );
898 DB( g_timer_destroy (t
) );
900 /* file upgrade / bugfix */
901 if( ctx
.file_version
<= 0.1 )
902 homebank_upgrade_to_v02();
903 if( ctx
.file_version
<= 0.2 )
904 homebank_upgrade_to_v03();
905 if( ctx
.file_version
<= 0.3 )
906 homebank_upgrade_to_v04();
907 if( ctx
.file_version
<= 0.4 )
908 homebank_upgrade_to_v05();
909 if( ctx
.file_version
<= 0.5 )
911 homebank_upgrade_to_v06();
912 homebank_upgrade_lower_v06();
914 if( ctx
.file_version
<= 0.6 )
916 homebank_upgrade_to_v07();
917 hbfile_sanity_check();
919 if( ctx
.file_version
<= 0.7 ) // <= 4.5
921 homebank_upgrade_to_v08();
923 if( ctx
.file_version
<= 0.8 ) // <= 4.6
925 hbfile_sanity_check();
927 if( ctx
.file_version
<= 0.9 ) // <= 4.6.3
929 hbfile_sanity_check();
930 homebank_upgrade_to_v10();
932 if( ctx
.file_version
<= 1.0 ) // <= 5.0.0
934 hbfile_sanity_check();
935 homebank_upgrade_to_v11();
937 //starting 5.0.4 data upgrade is done without changing file_version
938 if( ctx
.data_version
< 050005 ) // <= 5.0.5
940 hbfile_sanity_check();
942 if( ctx
.file_version
<= 1.1 ) // <= 5.1.0
944 hbfile_sanity_check();
945 homebank_upgrade_to_v12();
958 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
961 ** misc xml attributes methods
963 static void hb_xml_append_txt(GString
*gstring
, gchar
*attrname
, gchar
*value
)
965 if(value
!= NULL
&& *value
!= 0)
967 gchar
*escaped
= g_markup_escape_text(value
, -1);
968 g_string_append_printf(gstring
, "%s=\"%s\" ", attrname
, escaped
);
974 append_escaped_text (GString
*str
,
988 next
= g_utf8_next_char (p
);
993 g_string_append (str
, "&");
997 g_string_append (str
, "<");
1001 g_string_append (str
, ">");
1005 g_string_append (str
, "'");
1009 g_string_append (str
, """);
1013 c
= g_utf8_get_char (p
);
1014 if ((0x1 <= c
&& c
<= 0x8) ||
1015 (0xa <= c
&& c
<= 0xd) || //chnaged here from b<->c to a<->d
1016 (0xe <= c
&& c
<= 0x1f) ||
1017 (0x7f <= c
&& c
<= 0x84) ||
1018 (0x86 <= c
&& c
<= 0x9f))
1019 g_string_append_printf (str
, "&#x%x;", c
);
1021 g_string_append_len (str
, p
, next
- p
);
1029 // we override g_markup_escape_text from glib to encode \n (LF) & \r (CR)
1030 static void hb_xml_append_txt_crlf(GString
*gstring
, gchar
*attrname
, gchar
*value
)
1032 if(value
!= NULL
&& *value
!= 0)
1037 //gchar *escaped = g_markup_escape_text(value, -1);
1038 length
= strlen (value
);
1039 escaped
= g_string_sized_new (length
);
1040 append_escaped_text (escaped
, value
, length
);
1041 g_string_append_printf(gstring
, "%s=\"%s\" ", attrname
, escaped
->str
);
1042 g_string_free (escaped
, TRUE
);
1046 static void hb_xml_append_int0(GString
*gstring
, gchar
*attrname
, guint32 value
)
1048 g_string_append_printf(gstring
, "%s=\"%d\" ", attrname
, value
);
1051 static void hb_xml_append_int(GString
*gstring
, gchar
*attrname
, guint32 value
)
1055 hb_xml_append_int0(gstring
, attrname
, value
);
1059 static void hb_xml_append_amt(GString
*gstring
, gchar
*attrname
, gdouble amount
)
1061 char buf
[G_ASCII_DTOSTR_BUF_SIZE
];
1063 //we must use this, as fprintf use locale decimal settings and not '.'
1064 g_ascii_dtostr (buf
, sizeof (buf
), amount
);
1065 g_string_append_printf(gstring
, "%s=\"%s\" ", attrname
, buf
);
1069 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
1073 ** XML properties save
1075 static gint
homebank_save_xml_prop(GIOChannel
*io
)
1079 gint retval
= XML_OK
;
1080 GError
*error
= NULL
;
1082 title
= GLOBALS
->owner
== NULL
? "" : GLOBALS
->owner
;
1084 node
= g_string_sized_new(255);
1086 g_string_assign(node
, "<properties ");
1088 hb_xml_append_txt(node
, "title", title
);
1089 hb_xml_append_int(node
, "curr", GLOBALS
->kcur
);
1090 hb_xml_append_int(node
, "car_category", GLOBALS
->vehicle_category
);
1091 hb_xml_append_int0(node
, "auto_smode", GLOBALS
->auto_smode
);
1092 hb_xml_append_int(node
, "auto_weekday", GLOBALS
->auto_weekday
);
1093 hb_xml_append_int(node
, "auto_nbdays", GLOBALS
->auto_nbdays
);
1095 g_string_append(node
, "/>\n");
1098 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1101 retval
= XML_IO_ERROR
;
1102 g_error_free(error
);
1105 g_string_free(node
, TRUE
);
1111 ** XML currency save
1113 static gint
homebank_save_xml_cur(GIOChannel
*io
)
1117 char buf1
[G_ASCII_DTOSTR_BUF_SIZE
];
1118 gint retval
= XML_OK
;
1120 list
= g_hash_table_get_values(GLOBALS
->h_cur
);
1121 while (list
!= NULL
)
1123 Currency
*item
= list
->data
;
1125 tmpstr
= g_markup_printf_escaped(
1126 "<cur key=\"%d\" iso=\"%s\" name=\"%s\" symb=\"%s\" syprf=\"%d\" dchar=\"%s\" gchar=\"%s\" frac=\"%d\" rate=\"%s\" mdate=\"%d\" />\n",
1133 item
->grouping_char
,
1135 g_ascii_dtostr (buf1
, sizeof (buf1
), item
->rate
),
1139 g_io_channel_write_chars(io
, tmpstr
, -1, NULL
, NULL
);
1142 list
= g_list_next(list
);
1152 static gint
homebank_save_xml_acc(GIOChannel
*io
)
1156 gint retval
= XML_OK
;
1157 GError
*error
= NULL
;
1159 node
= g_string_sized_new(255);
1161 lacc
= list
= account_glist_sorted(0);
1162 while (list
!= NULL
)
1164 Account
*item
= list
->data
;
1166 item
->flags
&= ~(AF_ADDED
|AF_CHANGED
); //delete flag
1168 g_string_assign(node
, "<account ");
1170 hb_xml_append_int(node
, "key", item
->key
);
1171 hb_xml_append_int(node
, "flags", item
->flags
);
1172 hb_xml_append_int(node
, "pos", item
->pos
);
1173 hb_xml_append_int(node
, "type", item
->type
);
1174 hb_xml_append_int(node
, "curr", item
->kcur
);
1175 hb_xml_append_txt(node
, "name", item
->name
);
1176 hb_xml_append_txt(node
, "number", item
->number
);
1177 hb_xml_append_txt(node
, "bankname", item
->bankname
);
1178 hb_xml_append_amt(node
, "initial", item
->initial
);
1180 hb_xml_append_amt(node
, "minimum", item
->minimum
);
1181 hb_xml_append_int(node
, "cheque1", item
->cheque1
);
1182 hb_xml_append_int(node
, "cheque2", item
->cheque2
);
1183 hb_xml_append_txt_crlf(node
, "notes", item
->notes
);
1185 g_string_append(node
, "/>\n");
1188 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1192 retval
= XML_IO_ERROR
;
1193 g_error_free(error
);
1196 list
= g_list_next(list
);
1199 g_string_free(node
, TRUE
);
1206 static gint
homebank_save_xml_pay(GIOChannel
*io
)
1210 gint retval
= XML_OK
;
1211 GError
*error
= NULL
;
1213 node
= g_string_sized_new(255);
1215 lpay
= list
= payee_glist_sorted(0);
1216 while (list
!= NULL
)
1218 Payee
*item
= list
->data
;
1222 g_string_assign(node
, "<pay ");
1224 hb_xml_append_int(node
, "key", item
->key
);
1225 hb_xml_append_txt(node
, "name", item
->name
);
1226 hb_xml_append_int(node
, "category", item
->kcat
);
1227 hb_xml_append_int(node
, "paymode" , item
->paymode
);
1229 g_string_append(node
, "/>\n");
1232 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1236 retval
= XML_IO_ERROR
;
1237 g_error_free(error
);
1241 list
= g_list_next(list
);
1244 g_string_free(node
, TRUE
);
1249 ** XML category save
1251 static gint
homebank_save_xml_cat(GIOChannel
*io
)
1255 char buf
[G_ASCII_DTOSTR_BUF_SIZE
];
1257 gint retval
= XML_OK
;
1258 GError
*error
= NULL
;
1260 node
= g_string_sized_new(255);
1262 lcat
= list
= category_glist_sorted(0);
1263 while (list
!= NULL
)
1265 Category
*item
= list
->data
;
1269 g_string_assign(node
, "<cat ");
1271 hb_xml_append_int(node
, "key", item
->key
);
1272 hb_xml_append_int(node
, "parent", item
->parent
);
1273 hb_xml_append_int(node
, "flags", item
->flags
);
1274 hb_xml_append_txt(node
, "name", item
->name
);
1278 if(item
->budget
[i
] != 0)
1280 g_string_append_printf(node
,"b%d=\"%s\" ", i
, g_ascii_dtostr (buf
, sizeof (buf
), item
->budget
[i
]));
1284 g_string_append(node
, "/>\n");
1287 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1291 retval
= XML_IO_ERROR
;
1292 g_error_free(error
);
1296 list
= g_list_next(list
);
1299 g_string_free(node
, TRUE
);
1306 static gint
homebank_save_xml_tag(GIOChannel
*io
)
1310 gint retval
= XML_OK
;
1311 GError
*error
= NULL
;
1313 ltag
= list
= tag_glist_sorted(0);
1314 while (list
!= NULL
)
1316 Tag
*item
= list
->data
;
1320 tmpstr
= g_markup_printf_escaped("<tag key=\"%d\" name=\"%s\"/>\n",
1326 g_io_channel_write_chars(io
, tmpstr
, -1, NULL
, &error
);
1331 retval
= XML_IO_ERROR
;
1332 g_error_free(error
);
1335 list
= g_list_next(list
);
1345 static gint
homebank_save_xml_asg(GIOChannel
*io
)
1349 gint retval
= XML_OK
;
1350 GError
*error
= NULL
;
1352 node
= g_string_sized_new(255);
1354 lasg
= list
= assign_glist_sorted(0);
1355 while (list
!= NULL
)
1357 Assign
*item
= list
->data
;
1359 g_string_assign(node
, "<asg ");
1361 hb_xml_append_int(node
, "key" , item
->key
);
1362 hb_xml_append_int(node
, "flags" , item
->flags
);
1363 hb_xml_append_int(node
, "field" , item
->field
);
1364 hb_xml_append_txt(node
, "name" , item
->text
);
1365 hb_xml_append_int(node
, "payee" , item
->kpay
);
1366 hb_xml_append_int(node
, "category", item
->kcat
);
1367 hb_xml_append_int(node
, "paymode" , item
->paymode
);
1369 g_string_append(node
, "/>\n");
1372 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1376 retval
= XML_IO_ERROR
;
1377 g_error_free(error
);
1380 list
= g_list_next(list
);
1383 g_string_free(node
, TRUE
);
1392 static gint
homebank_save_xml_arc(GIOChannel
*io
)
1396 gint retval
= XML_OK
;
1397 GError
*error
= NULL
;
1399 node
= g_string_sized_new(255);
1401 list
= g_list_first(GLOBALS
->arc_list
);
1402 while (list
!= NULL
)
1404 Archive
*item
= list
->data
;
1406 g_string_assign(node
, "<fav ");
1408 hb_xml_append_amt(node
, "amount", item
->amount
);
1409 hb_xml_append_int(node
, "account", item
->kacc
);
1410 hb_xml_append_int(node
, "dst_account", item
->kxferacc
);
1411 hb_xml_append_int(node
, "paymode", item
->paymode
);
1412 hb_xml_append_int(node
, "st", item
->status
);
1413 hb_xml_append_int(node
, "flags", item
->flags
);
1414 hb_xml_append_int(node
, "payee", item
->kpay
);
1415 hb_xml_append_int(node
, "category", item
->kcat
);
1416 hb_xml_append_txt(node
, "wording", item
->wording
);
1417 hb_xml_append_int(node
, "nextdate", item
->nextdate
);
1418 hb_xml_append_int(node
, "every", item
->every
);
1419 hb_xml_append_int(node
, "unit", item
->unit
);
1420 hb_xml_append_int(node
, "limit", item
->limit
);
1421 hb_xml_append_int(node
, "weekend", item
->weekend
);
1423 if(da_splits_count(item
->splits
) > 0)
1425 gchar
*cats
, *amounts
, *memos
;
1427 da_splits_tostring(item
->splits
, &cats
, &amounts
, &memos
);
1428 g_string_append_printf(node
, "scat=\"%s\" ", cats
);
1429 g_string_append_printf(node
, "samt=\"%s\" ", amounts
);
1432 gchar
*escaped
= g_markup_escape_text(memos
, -1);
1433 g_string_append_printf(node
, "smem=\"%s\" ", escaped
);
1441 g_string_append(node
, "/>\n");
1444 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1447 retval
= XML_IO_ERROR
;
1448 g_error_free(error
);
1451 list
= g_list_next(list
);
1453 g_string_free(node
, TRUE
);
1459 ** XML transaction save
1461 static gint
homebank_save_xml_ope(GIOChannel
*io
)
1463 GList
*lst_acc
, *lnk_acc
;
1467 gint retval
= XML_OK
;
1468 GError
*error
= NULL
;
1470 node
= g_string_sized_new(255);
1472 lst_acc
= g_hash_table_get_values(GLOBALS
->h_acc
);
1473 lnk_acc
= g_list_first(lst_acc
);
1474 while (lnk_acc
!= NULL
)
1476 Account
*acc
= lnk_acc
->data
;
1478 list
= g_queue_peek_head_link(acc
->txn_queue
);
1479 while (list
!= NULL
)
1481 Transaction
*item
= list
->data
;
1483 item
->flags
&= ~(OF_AUTO
|OF_ADDED
|OF_CHANGED
); //delete flag
1484 tagstr
= transaction_tags_tostring(item
);
1486 g_string_assign(node
, "<ope ");
1488 hb_xml_append_int(node
, "date", item
->date
);
1489 hb_xml_append_amt(node
, "amount", item
->amount
);
1490 hb_xml_append_int(node
, "account", item
->kacc
);
1491 hb_xml_append_int(node
, "dst_account", item
->kxferacc
);
1492 hb_xml_append_int(node
, "paymode", item
->paymode
);
1493 hb_xml_append_int(node
, "st", item
->status
);
1494 hb_xml_append_int(node
, "flags", item
->flags
);
1495 hb_xml_append_int(node
, "payee", item
->kpay
);
1496 hb_xml_append_int(node
, "category", item
->kcat
);
1497 hb_xml_append_txt(node
, "wording", item
->wording
);
1498 hb_xml_append_txt(node
, "info", item
->info
);
1499 hb_xml_append_txt(node
, "tags", tagstr
);
1500 hb_xml_append_int(node
, "kxfer", item
->kxfer
);
1502 if(da_splits_count(item
->splits
) > 0)
1504 gchar
*cats
, *amounts
, *memos
;
1506 da_splits_tostring(item
->splits
, &cats
, &amounts
, &memos
);
1507 g_string_append_printf(node
, "scat=\"%s\" ", cats
);
1508 g_string_append_printf(node
, "samt=\"%s\" ", amounts
);
1511 gchar
*escaped
= g_markup_escape_text(memos
, -1);
1512 g_string_append_printf(node
, "smem=\"%s\" ", escaped
);
1520 g_string_append(node
, "/>\n");
1525 g_io_channel_write_chars(io
, node
->str
, -1, NULL
, &error
);
1529 retval
= XML_IO_ERROR
;
1530 g_error_free(error
);
1533 list
= g_list_next(list
);
1536 lnk_acc
= g_list_next(lnk_acc
);
1538 g_list_free(lst_acc
);
1540 g_string_free(node
, TRUE
);
1545 ** XML save homebank file: hbfile
1547 gint
homebank_save_xml(gchar
*filename
)
1550 char buf1
[G_ASCII_DTOSTR_BUF_SIZE
];
1552 gint retval
= XML_OK
;
1553 GError
*error
= NULL
;
1555 GValue filename_val
= G_VALUE_INIT
;
1556 ext_hook("save_file", EXT_STRING(&filename_val
, filename
), NULL
);
1558 io
= g_io_channel_new_file(filename
, "w", &error
);
1561 g_message("file error on: %s", filename
);
1562 retval
= XML_IO_ERROR
;
1565 g_print("failed: %s\n", error
->message
);
1567 g_error_free(error
);
1571 g_io_channel_write_chars(io
, "<?xml version=\"1.0\"?>\n", -1, NULL
, NULL
);
1573 outstr
= g_strdup_printf("<homebank v=\"%s\" d=\"%06d\">\n", g_ascii_dtostr (buf1
, sizeof (buf1
), FILE_VERSION
), HB_VERSION_NUM
);
1574 g_io_channel_write_chars(io
, outstr
, -1, NULL
, NULL
);
1577 retval
= homebank_save_xml_prop(io
);
1578 retval
= homebank_save_xml_cur(io
);
1579 retval
= homebank_save_xml_acc(io
);
1580 retval
= homebank_save_xml_pay(io
);
1581 retval
= homebank_save_xml_cat(io
);
1582 retval
= homebank_save_xml_tag(io
);
1583 retval
= homebank_save_xml_asg(io
);
1584 retval
= homebank_save_xml_arc(io
);
1585 retval
= homebank_save_xml_ope(io
);
1587 g_io_channel_write_chars(io
, "</homebank>\n", -1, NULL
, NULL
);
1589 g_io_channel_unref (io
);
This page took 0.123744 seconds and 4 git commands to generate.