]> Dogcows Code - chaz/homebank/blob - src/hb-misc.h
import homebank-5.2.4
[chaz/homebank] / src / hb-misc.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_MISC__H__
21 #define __HB_MISC__H__
22
23 double hb_amount_round(const double x, unsigned int n);
24 gdouble hb_amount_base(gdouble value, guint32 kcur);
25 gdouble hb_amount_to_euro(gdouble amount);
26
27 gchar *hb_str_rate(gchar *outstr, gint outlen, gdouble rate);
28
29 gchar *hb_str_formatd(gchar *outstr, gint outlen, gchar *buf1, Currency *cur, gboolean showsymbol);
30
31 void hb_strfmon(gchar *outstr, gint outlen, gdouble value, guint32 kcur, gboolean minor);
32 void hb_strfmon_int(gchar *outstr, gint outlen, gdouble value, guint32 kcur, gboolean minor);
33 void hb_strfnum(gchar *outstr, gint outlen, gdouble value, guint32 kcur, gboolean minor);
34
35 gint hb_filename_type_get_by_extension(gchar *filepath);
36
37 gchar *hb_filename_new_for_backup(gchar *filename);
38 GPtrArray *hb_filename_backup_list(gchar *filename);
39
40 gchar *hb_filename_backup_get_filtername(gchar *filename);
41
42 gchar *hb_filename_new_with_extension(gchar *filename, const gchar *extension);
43
44 gchar *get_normal_color_amount(gdouble value);
45 gchar *get_minimum_color_amount(gdouble value, gdouble minvalue);
46
47 void hb_label_set_amount(GtkLabel *label, gdouble value, guint32 kcur, gboolean minor);
48 void hb_label_set_colvalue(GtkLabel *label, gdouble value, guint32 kcur, gboolean minor);
49
50 //void get_period_minmax(guint month, guint year, guint32 *mindate, guint32 *maxdate);
51 //void get_range_minmax(guint32 refdate, gint range, guint32 *mindate, guint32 *maxdate);
52
53 gint hb_string_compare(gchar *s1, gchar *s2);
54 gint hb_string_utf8_strstr(gchar *haystack, gchar *needle, gboolean exact);
55 gint hb_string_utf8_compare(gchar *s1, gchar *s2);
56
57 void hb_string_strip_crlf(gchar *str);
58 void hb_string_replace_char(gchar c, gchar *str);
59 gchar *hb_string_copy_jsonpair(gchar *dst, gchar *str);
60 void hb_string_inline(gchar *str);
61 gchar* hb_strdup_nobrackets (const gchar *str);
62
63 gchar *hb_sprint_date(gchar *outstr, guint32 julian);
64
65 guint32 hb_date_get_julian(gchar *string, gint datefmt);
66
67 gboolean hb_string_isdate(gchar *str);
68 gboolean hb_string_isdigit(gchar *str);
69 gboolean hb_string_isprint(gchar *str);
70
71
72 void hb_print_date(guint32 jdate, gchar *label);
73
74 void hex_dump(guchar *ptr, guint length);
75
76
77 #endif
This page took 0.034115 seconds and 4 git commands to generate.