} BlueSkyRCStr;
BlueSkyRCStr *bluesky_string_new(gpointer data, gsize len);
-BlueSkyRCStr *bluesky_string_new_from_string(GString *s);
+BlueSkyRCStr *bluesky_string_new_from_gstring(GString *s);
void bluesky_string_ref(BlueSkyRCStr *string);
void bluesky_string_unref(BlueSkyRCStr *string);
BlueSkyRCStr *bluesky_string_dup(BlueSkyRCStr *string);
{
GString *buf = g_string_new("");
bluesky_serialize_inode(buf, inode);
-
- gsize len = buf->len;
- BlueSkyRCStr *data = bluesky_string_new(g_string_free(buf, FALSE), len);
+ BlueSkyRCStr *data = bluesky_string_new_from_gstring(buf);
char key[64];
sprintf(key, "inode-%016"PRIx64, inode->inum);
{
GString *buf = g_string_new("");
bluesky_serialize_superblock(buf, fs);
+ BlueSkyRCStr *data = bluesky_string_new_from_gstring(buf);
g_print("Syncing superblock...\n");
- gsize len = buf->len;
- BlueSkyRCStr *data = bluesky_string_new(g_string_free(buf, FALSE), len);
bluesky_store_put(fs->store, "superblock", data);
}
&handler, &info);
BlueSkyRCStr *raw, *decrypted;
- raw = bluesky_string_new_from_string(info.buf);
+ raw = bluesky_string_new_from_gstring(info.buf);
decrypted = bluesky_crypt_decrypt(raw, store->encryption_key);
bluesky_string_unref(raw);
return decrypted;
}
/* Create a new BlueSkyRCStr from a GString. The GString is destroyed. */
-BlueSkyRCStr *bluesky_string_new_from_string(GString *s)
+BlueSkyRCStr *bluesky_string_new_from_gstring(GString *s)
{
gsize len = s->len;
return bluesky_string_new(g_string_free(s, FALSE), len);