2 #ifndef __BSE_STORAGE_H__
3 #define __BSE_STORAGE_H__
11 #define BSE_TYPE_STORAGE (BSE_TYPE_ID (BseStorage))
12 #define BSE_STORAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_STORAGE, BseStorage))
13 #define BSE_STORAGE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_STORAGE, BseStorageClass))
14 #define BSE_IS_STORAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_STORAGE))
15 #define BSE_IS_STORAGE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_STORAGE))
16 #define BSE_STORAGE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_STORAGE, BseStorageClass))
20 #define BSE_STORAGE_VERSION(self, vmaj, min, vmic) ( \
21 BSE_VERSION_CMP (self->major_version, self->minor_version, self->micro_version, vmaj, min, vmic) >= 0)
22 #define BSE_STORAGE_COMPAT(self, vmaj, min, vmic) ( \
23 BSE_VERSION_CMP (self->major_version, self->minor_version, self->micro_version, vmaj, min, vmic) <= 0)
24 #define BSE_STORAGE_SELF_CONTAINED(st) ((BSE_OBJECT_FLAGS (st) & BSE_STORAGE_SELF_CONTAINED) != 0)
25 #define BSE_STORAGE_DBLOCK_CONTAINED(st) ((BSE_OBJECT_FLAGS (st) & BSE_STORAGE_DBLOCK_CONTAINED) != 0)
26 #define BSE_STORAGE_IS_UNDO(st) BSE_STORAGE_DBLOCK_CONTAINED (st)
29 BSE_STORAGE_SELF_CONTAINED = 1 << (BSE_OBJECT_FLAGS_USHIFT + 0),
30 BSE_STORAGE_DBLOCK_CONTAINED = 1 << (BSE_OBJECT_FLAGS_USHIFT + 1)
32 #define BSE_STORAGE_FLAGS_USHIFT (BSE_OBJECT_FLAGS_USHIFT + 2)
33 #define BSE_STORAGE_MODE_MASK (BSE_STORAGE_SELF_CONTAINED | BSE_STORAGE_DBLOCK_CONTAINED)
37 #define bse_storage_scanner_parse_or_return sfi_scanner_parse_or_return
38 #define bse_storage_scanner_peek_or_return sfi_scanner_peek_or_return
42 typedef struct _BseStorageDBlock BseStorageDBlock;
43 typedef struct _BseStorageItemLink BseStorageItemLink;
44 typedef void (*BseStorageRestoreLink) (gpointer data,
52 SfiPPool *stored_items;
53 SfiPPool *referenced_items;
59 GHashTable *path_table;
61 SfiPPool *restorable_objects;
64 BseStorageDBlock *dblocks;
75 void bse_storage_compat_dhreset (
BseStorage *
self);
76 void bse_storage_compat_dhmixf (
BseStorage *
self,
78 void bse_storage_compat_dhoscf (
BseStorage *
self,
80 void bse_storage_compat_dhchannels (
BseStorage *
self,
86 void bse_storage_prepare_write (
BseStorage *
self,
88 void bse_storage_turn_readable (
BseStorage *
self,
89 const gchar *storage_name);
90 Bse::ErrorType bse_storage_input_file (
BseStorage *
self,
91 const gchar *file_name);
94 const gchar *text_name);
95 GTokenType bse_storage_restore_item (
BseStorage *
self,
99 void bse_storage_store_child (
BseStorage *
self,
101 const gchar* bse_storage_item_get_compat_type (
BseItem *item);
115 void bse_storage_put_item_link (
BseStorage *
self,
118 void bse_storage_put_data_handle (
BseStorage *
self,
119 guint significant_bits,
120 GslDataHandle *dhandle);
121 void bse_storage_put_xinfos (
BseStorage *
self,
123 Bse::ErrorType bse_storage_flush_fd (
BseStorage *
self,
128 #define bse_storage_error(s, ...) bse_storage_error_str (s, Rapicorn::string_format (__VA_ARGS__).c_str())
130 #define bse_storage_warn(s, ...) bse_storage_warn_str (s, Rapicorn::string_format (__VA_ARGS__).c_str())
132 #define bse_storage_warn_skip(s, ...) bse_storage_skip (s, Rapicorn::string_format (__VA_ARGS__).c_str())
134 GTokenType bse_storage_parse_param_value (
BseStorage *
self,
139 BseStorageRestoreLink restore_link,
141 void bse_storage_add_restorable (
BseStorage *
self,
143 void bse_storage_finish_parsing (
BseStorage *
self);
144 GTokenType bse_storage_parse_data_handle (
BseStorage *
self,
145 GslDataHandle **data_handle_p,
149 gboolean bse_storage_match_data_handle (
BseStorage *
self,
151 GTokenType bse_storage_parse_data_handle_rest (
BseStorage *
self,
152 GslDataHandle **data_handle_p,
156 GTokenType bse_storage_parse_xinfos (
BseStorage *
self,
158 GTokenType bse_storage_parse_rest (
BseStorage *
self,
159 gpointer context_data,
160 BseTryStatement try_statement,
162 gboolean bse_storage_check_parse_negate (
BseStorage *
self);
166 #define bse_storage_get_scanner(s) ((s)->rstore->scanner)
167 #define bse_storage_unexp_token(s,et) sfi_rstore_unexp_token ((s)->rstore, et)
168 #define bse_storage_push_level(s) sfi_wstore_push_level ((s)->wstore)
169 #define bse_storage_pop_level(s) sfi_wstore_pop_level ((s)->wstore)
170 #define bse_storage_break(s) sfi_wstore_break ((s)->wstore)
171 #define bse_storage_putc(s,c) sfi_wstore_putc ((s)->wstore, c)
172 #define bse_storage_puts(s,b) sfi_wstore_puts ((s)->wstore, b)
173 #define bse_storage_printf(s, ...) bse_storage_puts (s, Rapicorn::string_format (__VA_ARGS__).c_str())
Definition: bsestorage.hh:71
Definition: bseobject.hh:60
Definition: bseobject.hh:93
Definition: sfiring.hh:23
Definition: bsestorage.hh:49
Definition: sfistore.hh:14
GTokenType bse_storage_parse_item_link(BseStorage *self, BseItem *from_item, BseStorageRestoreLink restore_link, gpointer data)
Definition: bsestorage.cc:1058
Definition: bseitem.hh:34