GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sixtp-utils.h
1 /********************************************************************
2  * sixtp-utils.h *
3  * Copyright 2001 Gnumatic, Inc. *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License*
16  * along with this program; if not, contact: *
17  * *
18  * Free Software Foundation Voice: +1-617-542-5942 *
19  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20  * Boston, MA 02110-1301, USA [email protected] *
21  * *
22  ********************************************************************/
23 
24 #ifndef SIXTP_UTILS_H
25 #define SIXTP_UTILS_H
26 
27 #include "qof.h"
28 
29 #include "sixtp.h"
30 
31 typedef struct
32 {
33  Timespec ts;
34  guint s_block_count;
35  guint ns_block_count;
37 
38 #define TIMESPEC_TIME_FORMAT "%Y-%m-%d %H:%M:%S"
39 #define TIMESPEC_PARSE_TIME_FORMAT "%Y-%m-%d %H:%M:%S"
40 #define TIMESPEC_SEC_FORMAT_MAX 256
41 
42 gboolean isspace_str(const gchar *str, int nomorethan);
43 
44 gboolean allow_and_ignore_only_whitespace(GSList *sibling_data,
45  gpointer parent_data,
46  gpointer global_data,
47  gpointer *result,
48  const char *text,
49  int length);
50 
51 gboolean generic_accumulate_chars(GSList *sibling_data,
52  gpointer parent_data,
53  gpointer global_data,
54  gpointer *result,
55  const char *text,
56  int length);
57 
58 
59 void generic_free_data_for_children(gpointer data_for_children,
60  GSList* data_from_children,
61  GSList* sibling_data,
62  gpointer parent_data,
63  gpointer global_data,
64  gpointer *result,
65  const gchar *tag);
66 
67 gchar * concatenate_child_result_chars(GSList *data_from_children);
68 
69 gboolean string_to_double(const char *str, double *result);
70 
71 gboolean string_to_gint64(const gchar *str, gint64 *v);
72 
73 gboolean string_to_gint32(const gchar *str, gint32 *v);
74 
75 gboolean hex_string_to_binary(const gchar *str, void **v, guint64 *data_len);
76 
77 gboolean generic_return_chars_end_handler(gpointer data_for_children,
78  GSList* data_from_children,
79  GSList* sibling_data,
80  gpointer parent_data,
81  gpointer global_data,
82  gpointer *result,
83  const gchar *tag);
84 
85 sixtp* simple_chars_only_parser_new(sixtp_end_handler end_handler);
86 
87 gboolean string_to_timespec_secs(const gchar *str, Timespec *ts);
88 gboolean string_to_timespec_nsecs(const gchar *str, Timespec *ts);
89 
90 gboolean generic_timespec_start_handler(GSList* sibling_data,
91  gpointer parent_data,
92  gpointer global_data,
93  gpointer *data_for_children,
94  gpointer *result,
95  const gchar *tag, gchar **attrs);
96 
97 gboolean timespec_parse_ok(TimespecParseInfo *info);
98 
99 gboolean generic_timespec_secs_end_handler(
100  gpointer data_for_children,
101  GSList *data_from_children, GSList *sibling_data,
102  gpointer parent_data, gpointer global_data,
103  gpointer *result, const gchar *tag);
104 
105 gboolean generic_timespec_nsecs_end_handler(
106  gpointer data_for_children,
107  GSList *data_from_children, GSList *sibling_data,
108  gpointer parent_data, gpointer global_data,
109  gpointer *result, const gchar *tag);
110 
111 
112 sixtp* generic_timespec_parser_new(sixtp_end_handler end_handler);
113 
114 gboolean generic_guid_end_handler(
115  gpointer data_for_children,
116  GSList *data_from_children, GSList *sibling_data,
117  gpointer parent_data, gpointer global_data,
118  gpointer *result, const gchar *tag);
119 
120 sixtp* generic_guid_parser_new(void);
121 
122 gboolean generic_gnc_numeric_end_handler(
123  gpointer data_for_children,
124  GSList *data_from_children, GSList *sibling_data,
125  gpointer parent_data, gpointer global_data,
126  gpointer *result, const gchar *tag);
127 
128 sixtp* generic_gnc_numeric_parser_new(void);
129 
130 sixtp* restore_char_generator(sixtp_end_handler ender);
131 
132 
133 
134 #endif /* _SIXTP_UTILS_H_ */
Definition: sixtp.h:93
Use a 64-bit unsigned int timespec.
Definition: gnc-date.h:299