]>
Dogcows Code - chaz/homebank/blob - src/hb-misc.h
c6b5e14aa159abb65a43f84f5e2a09b0a43e4494
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2019 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/>.
20 #ifndef __HB_MISC__H__
21 #define __HB_MISC__H__
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
);
27 gchar
*hb_str_rate(gchar
*outstr
, gint outlen
, gdouble rate
);
29 gchar
*hb_str_formatd(gchar
*outstr
, gint outlen
, gchar
*buf1
, Currency
*cur
, gboolean showsymbol
);
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
);
35 gint
hb_filename_type_get_by_extension(gchar
*filepath
);
37 gchar
*hb_filename_new_for_backup(gchar
*filename
);
38 GPtrArray
*hb_filename_backup_list(gchar
*filename
);
40 gchar
*hb_filename_backup_get_filtername(gchar
*filename
);
42 gchar
*hb_filename_new_with_extension(gchar
*filename
, const gchar
*extension
);
44 gchar
*get_normal_color_amount(gdouble value
);
45 gchar
*get_minimum_color_amount(gdouble value
, gdouble minvalue
);
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
);
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);
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
);
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
);
63 gchar
*hb_sprint_date(gchar
*outstr
, guint32 julian
);
65 guint32
hb_date_get_julian(gchar
*string
, gint datefmt
);
67 gboolean
hb_string_isdate(gchar
*str
);
68 gboolean
hb_string_isdigit(gchar
*str
);
69 gboolean
hb_string_isprint(gchar
*str
);
72 void hb_print_date(guint32 jdate
, gchar
*label
);
74 void hex_dump(guchar
*ptr
, guint length
);
This page took 0.037415 seconds and 4 git commands to generate.