GnuCash  5.6-150-g038405b370+
QuickFill.h
Go to the documentation of this file.
1 /********************************************************************\
2  * QuickFill.h -- the quickfill tree data structure *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20  * *
21 \********************************************************************/
50 #ifndef QUICKFILL_H
51 #define QUICKFILL_H
52 
53 #include <glib.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 typedef enum
60 {
61  QUICKFILL_LIFO,
62  QUICKFILL_ALPHA
63 } QuickFillSort;
64 
65 typedef struct _QuickFill QuickFill;
66 
67 
68 /* PROTOTYPES ******************************************************/
69 
70 QuickFill * gnc_quickfill_new (void);
71 void gnc_quickfill_destroy (QuickFill *qf);
72 void gnc_quickfill_purge (QuickFill *qf);
73 
76 const char * gnc_quickfill_string (QuickFill *qf);
77 
87 QuickFill * gnc_quickfill_get_char_match (QuickFill *qf, gunichar c);
88 
101 QuickFill * gnc_quickfill_get_string_match (QuickFill *qf,
102  const char *str);
103 
107 QuickFill * gnc_quickfill_get_string_len_match (QuickFill *qf,
108  const char *str, int len);
109 
123 QuickFill * gnc_quickfill_get_unique_len_match (QuickFill *qf, int *len);
124 
126 void gnc_quickfill_insert (QuickFill *root, const char *text,
127  QuickFillSort sort_code);
128 
129 void gnc_quickfill_remove (QuickFill *root, const gchar *text,
130  QuickFillSort sort_code);
131 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* QUICKFILL_H */
void gnc_quickfill_insert(QuickFill *root, const char *text, QuickFillSort sort_code)
Add the string "text" to the collection of searchable strings.
Definition: QuickFill.c:229
QuickFill * gnc_quickfill_get_char_match(QuickFill *qf, gunichar c)
Return the subnode of the tree whose strings all hold &#39;c&#39; as the next letter.
Definition: QuickFill.c:135
QuickFill * gnc_quickfill_get_string_len_match(QuickFill *qf, const char *str, int len)
Same as gnc_quickfill_get_string_match(), except that the string length is explicitly specified...
Definition: QuickFill.c:150
QuickFill * gnc_quickfill_get_string_match(QuickFill *qf, const char *str)
Return a subnode in the tree whose strings all match the string &#39;str&#39; as the next substring...
Definition: QuickFill.c:179
const char * gnc_quickfill_string(QuickFill *qf)
For the given node &#39;qf&#39;, return the best-guess matching string.
Definition: QuickFill.c:123
QuickFill * gnc_quickfill_get_unique_len_match(QuickFill *qf, int *len)
Walk a &#39;unique&#39; part of the QuickFill tree.
Definition: QuickFill.c:199