GnuCash c935c2f+
Loading...
Searching...
No Matches
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
56extern "C" {
57#endif
58
59typedef enum
60{
61 QUICKFILL_LIFO,
62 QUICKFILL_ALPHA
63} QuickFillSort;
64
65typedef struct _QuickFill QuickFill;
66
67
68/* PROTOTYPES ******************************************************/
69
70QuickFill * gnc_quickfill_new (void);
71void gnc_quickfill_destroy (QuickFill *qf);
72void gnc_quickfill_purge (QuickFill *qf);
73
76const char * gnc_quickfill_string (QuickFill *qf);
77
87QuickFill * gnc_quickfill_get_char_match (QuickFill *qf, gunichar c);
88
101QuickFill * gnc_quickfill_get_string_match (QuickFill *qf,
102 const char *str);
103
107QuickFill * gnc_quickfill_get_string_len_match (QuickFill *qf,
108 const char *str, int len);
109
123QuickFill * gnc_quickfill_get_unique_len_match (QuickFill *qf, int *len);
124
126void gnc_quickfill_insert (QuickFill *root, const char *text,
127 QuickFillSort sort_code);
128
129void gnc_quickfill_remove (QuickFill *root, const gchar *text,
130 QuickFillSort sort_code);
131
134#ifdef __cplusplus
135}
136#endif
137
138#endif /* QUICKFILL_H */
QuickFill * gnc_quickfill_get_string_match(QuickFill *qf, const char *str)
Return a subnode in the tree whose strings all match the string 'str' as the next substring.
Definition QuickFill.c:179
const char * gnc_quickfill_string(QuickFill *qf)
For the given node 'qf', return the best-guess matching string.
Definition QuickFill.c:123
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
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_unique_len_match(QuickFill *qf, int *len)
Walk a 'unique' part of the QuickFill tree.
Definition QuickFill.c:199
QuickFill * gnc_quickfill_get_char_match(QuickFill *qf, gunichar c)
Return the subnode of the tree whose strings all hold 'c' as the next letter.
Definition QuickFill.c:135