2 #ifndef __SFI_STORE_H__
3 #define __SFI_STORE_H__
11 typedef gint (*SfiStoreReadBin) (gpointer data,
19 guint needs_break : 1;
23 #define SFI_TOKEN_UNMATCHED ((GTokenType) (G_TOKEN_LAST + 1))
24 #define SFI_TOKEN_LAST ((GTokenType) (SFI_TOKEN_UNMATCHED + 1))
26 typedef GTokenType (*SfiStoreParser) (gpointer context_data,
42 void sfi_wstore_destroy (
SfiWStore *wstore);
43 void sfi_wstore_push_level (
SfiWStore *wstore);
44 void sfi_wstore_pop_level (
SfiWStore *wstore);
45 void sfi_wstore_break (
SfiWStore *wstore);
50 #define sfi_wstore_printf(wstore, ...) sfi_wstore_puts (wstore, Rapicorn::string_format (__VA_ARGS__).c_str())
55 void sfi_wstore_put_value (
SfiWStore *wstore,
57 void sfi_wstore_put_param (
SfiWStore *wstore,
60 void sfi_wstore_put_binary (
SfiWStore *wstore,
61 SfiStoreReadBin reader,
63 GDestroyNotify destroy);
64 gint sfi_wstore_flush_fd (
SfiWStore *wstore,
66 const gchar* sfi_wstore_peek_text (
SfiWStore *wstore,
71 SfiRStore* sfi_rstore_new (
void);
72 SfiRStore* sfi_rstore_new_open (
const gchar *fname);
73 void sfi_rstore_destroy (SfiRStore *rstore);
74 void sfi_rstore_input_fd (SfiRStore *rstore,
77 void sfi_rstore_input_text (SfiRStore *rstore,
79 const gchar *text_name);
80 gboolean sfi_rstore_eof (SfiRStore *rstore);
81 GTokenType sfi_rstore_parse_param (SfiRStore *rstore,
84 GTokenType sfi_rstore_ensure_bin_offset (SfiRStore *rstore);
85 guint64 sfi_rstore_get_bin_offset (SfiRStore *rstore);
86 GTokenType sfi_rstore_parse_binary (SfiRStore *rstore,
89 GTokenType sfi_rstore_parse_zbinary (SfiRStore *rstore,
92 GTokenType sfi_rstore_parse_until (SfiRStore *rstore,
93 GTokenType closing_token,
94 gpointer context_data,
95 SfiStoreParser try_statement,
97 guint sfi_rstore_parse_all (SfiRStore *rstore,
98 gpointer context_data,
99 SfiStoreParser try_statement,
101 void sfi_rstore_error (SfiRStore *rstore,
const std::string &msg);
102 void sfi_rstore_unexp_token (SfiRStore *rstore,
103 GTokenType expected_token);
104 void sfi_rstore_warn (SfiRStore *rstore,
const std::string &msg);
105 GTokenType sfi_rstore_warn_skip (SfiRStore *rstore,
const std::string &msg);
106 typedef gboolean (SfiRStoreQuickScan) (SfiRStore *rstore,
108 void sfi_rstore_quick_scan (SfiRStore *rstore,
109 const gchar *identifier,
110 SfiRStoreQuickScan qcheck,
115 #define sfi_scanner_parse_or_return(scanner, token) G_STMT_START { \
116 GTokenType _t = GTokenType (token); \
117 if (g_scanner_get_next_token (scanner) != _t) \
120 #define sfi_scanner_peek_or_return(scanner, token) G_STMT_START { \
121 GTokenType _t = GTokenType (token); \
122 GScanner *__s = (scanner); \
123 if (g_scanner_peek_next_token (__s) != _t) \
125 g_scanner_get_next_token (__s); \
Definition: sfistore.hh:30
Definition: sfiring.hh:23
Definition: sfistore.hh:14