aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Tessier <ronald.tessier@linux.intel.com>2012-08-24 15:06:07 +0200
committerDenis Kenzior <denkenz@gmail.com>2012-08-28 09:24:51 -0500
commitdec81919302a11a5804eb8a33df0b0e6abdb4962 (patch)
tree75c756b5ac063158f0079fcf468b153db6aadbf1
parent986c6d74814cc4f809ebd9eeab0d9edb91b761b3 (diff)
downloadmmsd-dec81919302a11a5804eb8a33df0b0e6abdb4962.tar.gz
store: Define MMS_META_UUID_XXX len and suffix
-rw-r--r--src/store.c8
-rw-r--r--src/store.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/store.c b/src/store.c
index b09c17b..f1c5714 100644
--- a/src/store.c
+++ b/src/store.c
@@ -42,8 +42,6 @@
#define TFR
#endif
-#define MMS_SHA1_UUID_LEN 20
-
static const char *digest_to_str(const unsigned char *digest)
{
static char buf[MMS_SHA1_UUID_LEN * 2 + 1];
@@ -293,7 +291,7 @@ void mms_store_remove(const char *service_id, const char *uuid)
unlink(pdu_path);
- meta_path = g_strdup_printf("%s%s", pdu_path, ".status");
+ meta_path = g_strdup_printf("%s%s", pdu_path, MMS_META_UUID_SUFFIX);
g_free(pdu_path);
@@ -312,7 +310,7 @@ GKeyFile *mms_store_meta_open(const char *service_id, const char *uuid)
if (pdu_path == NULL)
return NULL;
- meta_path = g_strdup_printf("%s%s", pdu_path, ".status");
+ meta_path = g_strdup_printf("%s%s", pdu_path, MMS_META_UUID_SUFFIX);
g_free(pdu_path);
@@ -337,7 +335,7 @@ static void meta_store_sync(const char *service_id, const char *uuid,
if (pdu_path == NULL)
return;
- meta_path = g_strdup_printf("%s%s", pdu_path, ".status");
+ meta_path = g_strdup_printf("%s%s", pdu_path, MMS_META_UUID_SUFFIX);
g_free(pdu_path);
diff --git a/src/store.h b/src/store.h
index ba2c080..fb2ca9f 100644
--- a/src/store.h
+++ b/src/store.h
@@ -19,6 +19,11 @@
*
*/
+#define MMS_SHA1_UUID_LEN 20
+#define MMS_META_UUID_SUFFIX ".status"
+#define MMS_META_UUID_SUFFIX_LEN 7
+#define MMS_META_UUID_LEN (MMS_SHA1_UUID_LEN * 2)
+
const char *mms_store(const char *service_id, unsigned char *pdu,
unsigned int len);
const char *mms_store_file(const char *service_id, const char *path);