summaryrefslogtreecommitdiff
path: root/legacy/eet/src/lib/eet_data.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-09-15 17:05:56 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-09-15 17:05:56 +0000
commit64f3a6da0f21ae57f003046a99ae7e9ba306eed9 (patch)
tree3b603e6ae19f8982ccddae06835f4d686ff920b3 /legacy/eet/src/lib/eet_data.c
parent0c6ed213ada3cca2d3362c202c0c587b75576fc2 (diff)
eet: add eet_data_xattr helper.
SVN revision: 63413
Diffstat (limited to '')
-rw-r--r--legacy/eet/src/lib/eet_data.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c
index 5ae125669c..7b2d3945f9 100644
--- a/legacy/eet/src/lib/eet_data.c
+++ b/legacy/eet/src/lib/eet_data.c
@@ -4884,3 +4884,43 @@ eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
4884 return eet_data_descriptor_encode_cipher(edd, data_in, NULL, size_ret); 4884 return eet_data_descriptor_encode_cipher(edd, data_in, NULL, size_ret);
4885} /* eet_data_descriptor_encode */ 4885} /* eet_data_descriptor_encode */
4886 4886
4887EAPI void *
4888eet_data_xattr_cipher_get(const char *filename,
4889 const char *attribute,
4890 Eet_Data_Descriptor *edd,
4891 const char *cipher_key)
4892{
4893 void *blob;
4894 void *ret;
4895 int size;
4896
4897 blob = eina_xattr_get(filename, attribute, &size);
4898 if (!blob) return NULL;
4899
4900 ret = eet_data_descriptor_decode_cipher(edd, blob, cipher_key, size);
4901 free(blob);
4902
4903 return ret;
4904}
4905
4906EAPI Eina_Bool
4907eet_data_xattr_cipher_set(const char *filename,
4908 const char *attribute,
4909 Eet_Data_Descriptor *edd,
4910 const char *cipher_key,
4911 const void *data,
4912 Eina_Xattr_Flags flags)
4913{
4914 void *blob;
4915 int size;
4916 Eina_Bool ret;
4917
4918 blob = eet_data_descriptor_encode_cipher(edd, data, cipher_key, &size);
4919 if (!blob) return EINA_FALSE;
4920
4921 ret = eina_xattr_set(filename, attribute, blob, size, flags);
4922 free(blob);
4923
4924 return ret;
4925}
4926