gchar *bluesky_lowercase(const gchar *s);
/* Reference-counted blocks of memory, used for passing data in and out of
- * storage backends and in other places. */
+ * storage backends and in other places. This may also refer to read-only
+ * mmaped data. */
typedef struct {
gint refcount;
+ const char *addr;
+ size_t len;
+} BlueSkyMmap;
+
+typedef struct {
+ gint refcount;
+ BlueSkyMmap *mmap;
gchar *data;
gsize len;
} BlueSkyRCStr;
BlueSkyRCStr *bluesky_string_new(gpointer data, gsize len);
BlueSkyRCStr *bluesky_string_new_from_gstring(GString *s);
+BlueSkyRCStr *bluesky_string_new_from_mmap(BlueSkyMmap *mmap,
+ int offset, gsize len);
void bluesky_string_ref(BlueSkyRCStr *string);
void bluesky_string_unref(BlueSkyRCStr *string);
BlueSkyRCStr *bluesky_string_dup(BlueSkyRCStr *string);