GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
import-parse.h
1 /*
2  * import-parse.h -- a generic "parser" API for importers.. Allows importers
3  * to parse dates and numbers, and provides a UI to ask for users to
4  * resolve ambiguities.
5  *
6  * Created by: Derek Atkins <[email protected]>
7  * Copyright (c) 2003 Derek Atkins <[email protected]>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of
12  * the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, contact:
21  *
22  * Free Software Foundation Voice: +1-617-542-5942
23  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
24  * Boston, MA 02110-1301, USA [email protected]
25  */
26 
27 #ifndef IMPORT_PARSE_H
28 #define IMPORT_PARSE_H
29 
30 #include "qof.h"
31 
32 typedef enum
33 {
34  GNCIF_NONE = 0,
35 
36  /* number formats */
37  GNCIF_NUM_PERIOD = (1 << 1),
38  GNCIF_NUM_COMMA = (1 << 2),
39 
40  /* date formats */
41  GNCIF_DATE_MDY = (1 << 8),
42  GNCIF_DATE_DMY = (1 << 9),
43  GNCIF_DATE_YMD = (1 << 10),
44  GNCIF_DATE_YDM = (1 << 11)
45 } GncImportFormat;
46 
47 
48 GncImportFormat gnc_import_test_numeric(const char* str, GncImportFormat fmts);
49 GncImportFormat gnc_import_test_date(const char* str, GncImportFormat fmts);
50 
51 
52 GncImportFormat gnc_import_choose_fmt(const char* msg, GncImportFormat fmts,
53  gpointer user_data);
54 
55 gboolean gnc_import_parse_numeric(const char* str, GncImportFormat fmt,
56  gnc_numeric *val);
57 gboolean gnc_import_parse_date(const char *date, GncImportFormat fmt,
58  Timespec *val);
59 
60 /* Set and clear flags in bit-flags */
61 #define import_set_flag(i,f) (i |= f)
62 #define import_clear_flag(i,f) (i &= ~f)
63 
64 
65 #endif /* IMPORT_PARSE_H */
Use a 64-bit unsigned int timespec.
Definition: gnc-date.h:299