X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank;a=blobdiff_plain;f=src%2Fhb-split.h;fp=src%2Fhb-split.h;h=2106276e4520f52346245b5a987ba81d6e97d6e2;hp=0000000000000000000000000000000000000000;hb=59c5e08a64798d4303ae7eb3a2713bc93d98fa7b;hpb=8988b3bef0760b4cab8144715cc3d8f55688861c diff --git a/src/hb-split.h b/src/hb-split.h new file mode 100644 index 0000000..2106276 --- /dev/null +++ b/src/hb-split.h @@ -0,0 +1,49 @@ +/* HomeBank -- Free, easy, personal accounting for everyone. + * Copyright (C) 1995-2016 Maxime DOYEN + * + * This file is part of HomeBank. + * + * HomeBank is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * HomeBank is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __HB_SPLIT_H__ +#define __HB_SPLIT_H__ + + +#define TXN_MAX_SPLIT 10 + +typedef struct _split Split; + + +struct _split +{ + guint32 kcat; + gdouble amount; + gchar *memo; +}; + + +void da_splits_append(Split *txn_splits[], Split *new_split); +void da_splits_free(Split *txn_splits[]); +guint da_splits_count(Split *txn_splits[]); +guint da_splits_clone(Split *stxn_splits[], Split *dtxn_splits[]); + +Split *da_split_new(guint32 kcat, gdouble amount, gchar *memo); +guint da_splits_parse(Split *ope_splits[], gchar *cats, gchar *amounts, gchar *memos); +guint da_splits_tostring(Split *ope_splits[], gchar **cats, gchar **amounts, gchar **memos); + +void split_cat_consistency (Split *txn_splits[]); + + +#endif \ No newline at end of file