[libdmapsharing] Add blob functions to DMAPRecord interface
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Add blob functions to DMAPRecord interface
- Date: Sat, 29 May 2010 17:45:55 +0000 (UTC)
commit 3577d481ebd08c0b85516c37746967c21d12ad52
Author: W. Michael Petullo <mike flyn org>
Date: Sat May 29 03:39:56 2010 -0500
Add blob functions to DMAPRecord interface
Add blob functions to DMAPRecord interface in order to facilitate
database backends. Install dmap-md5.h.
Signed-off-by: W. Michael Petullo <mike flyn org>
ChangeLog | 8 ++++++++
libdmapsharing/Makefile.am | 2 +-
libdmapsharing/daap-record.c | 12 ------------
libdmapsharing/daap-record.h | 18 ------------------
libdmapsharing/dmap-record.c | 12 ++++++++++++
libdmapsharing/dmap-record.h | 19 +++++++++++++++++++
libdmapsharing/dmap.h | 1 +
7 files changed, 41 insertions(+), 31 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0e5656e..40d28e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+29 May 2010 W. Michael Petullo <mike flyn org>
+
+ * Add blob functions to DMAPRecord interface.
+
+28 May 2010 W. Michael Petullo <mike flyn org>
+
+ * Install dmap-md5.h.
+
27 May 2010 W. Michael Petullo <mike flyn org>
* Fix crash upon finalizing DMAPShare that was caused by misuse of
diff --git a/libdmapsharing/Makefile.am b/libdmapsharing/Makefile.am
index aaf2fe7..920648e 100644
--- a/libdmapsharing/Makefile.am
+++ b/libdmapsharing/Makefile.am
@@ -69,6 +69,7 @@ libdmapsharinginclude_HEADERS = \
dmap-container-db.h \
dmap-container-record.h \
dmap-db.h \
+ dmap-md5.h \
dmap-mdns-browser.h \
dmap-mdns-publisher.h \
dmap-record.h \
@@ -80,7 +81,6 @@ libdmapsharinginclude_HEADERS = \
noinst_HEADERS = \
dmap-marshal.h \
dmap-config.h \
- dmap-md5.h \
dmap-mdns-avahi.h \
dmap-structure.h \
dmap-utils.h \
diff --git a/libdmapsharing/daap-record.c b/libdmapsharing/daap-record.c
index 30abb13..54e764b 100644
--- a/libdmapsharing/daap-record.c
+++ b/libdmapsharing/daap-record.c
@@ -216,15 +216,3 @@ daap_record_read (DAAPRecord *record, GError **err)
{
return DAAP_RECORD_GET_INTERFACE (record)->read (record, err);
}
-
-GByteArray *
-daap_record_to_blob (DAAPRecord *record)
-{
- return DAAP_RECORD_GET_INTERFACE (record)->to_blob (record);
-}
-
-DAAPRecord *
-daap_record_new_from_blob (DAAPRecord *record, GByteArray *blob)
-{
- return DAAP_RECORD_GET_INTERFACE (record)->new_from_blob (record, blob);
-}
diff --git a/libdmapsharing/daap-record.h b/libdmapsharing/daap-record.h
index 7194b31..e1b8a57 100644
--- a/libdmapsharing/daap-record.h
+++ b/libdmapsharing/daap-record.h
@@ -71,8 +71,6 @@ struct _DAAPRecordInterface {
gboolean (*itunes_compat) (DAAPRecord *record);
GInputStream * (*read) (DAAPRecord *record, GError **err);
- GByteArray * (*to_blob) (DAAPRecord *record);
- DAAPRecord * (*new_from_blob) (DAAPRecord *record, GByteArray *blob);
};
GType daap_record_get_type (void);
@@ -95,22 +93,6 @@ gboolean daap_record_itunes_compat (DAAPRecord *record);
*/
GInputStream *daap_record_read (DAAPRecord *record, GError **err);
-/**
- * daap_record_to_blob:
- * @record: a DAAPRecord.
- *
- * Returns: A serialized representation of the record.
- */
-GByteArray *daap_record_to_blob (DAAPRecord *record);
-
-/**
- * daap_record_new_from_blob:
- * @blob: a serialized DAAPRecord representation.
- *
- * Returns: A DAAPRecord.
- */
-DAAPRecord *daap_record_new_from_blob (DAAPRecord *record, GByteArray *blob);
-
#endif /* __DAAP_RECORD_H */
G_END_DECLS
diff --git a/libdmapsharing/dmap-record.c b/libdmapsharing/dmap-record.c
index 3b650dc..ecf3862 100644
--- a/libdmapsharing/dmap-record.c
+++ b/libdmapsharing/dmap-record.c
@@ -52,3 +52,15 @@ dmap_record_get_type (void)
}
return object_type;
}
+
+GByteArray *
+dmap_record_to_blob (DMAPRecord *record)
+{
+ return DMAP_RECORD_GET_INTERFACE (record)->to_blob (record);
+}
+
+DMAPRecord *
+dmap_record_set_from_blob (DMAPRecord *record, GByteArray *blob)
+{
+ return DMAP_RECORD_GET_INTERFACE (record)->set_from_blob (record, blob);
+}
diff --git a/libdmapsharing/dmap-record.h b/libdmapsharing/dmap-record.h
index 4b0fa2b..25b902f 100644
--- a/libdmapsharing/dmap-record.h
+++ b/libdmapsharing/dmap-record.h
@@ -65,6 +65,9 @@ typedef struct _DMAPRecordInterface DMAPRecordInterface;
struct _DMAPRecordInterface {
GTypeInterface parent;
+
+ GByteArray * (*to_blob) (DMAPRecord *record);
+ DMAPRecord * (*set_from_blob) (DMAPRecord *record, GByteArray *blob);
};
typedef unsigned long long bitwise;
@@ -77,6 +80,22 @@ struct MLCL_Bits {
GType dmap_record_get_type (void);
+/**
+ * dmap_record_to_blob:
+ * @record: A DMAPRecord.
+ *
+ * Returns: A byte array representation of the record.
+ */
+GByteArray *dmap_record_to_blob (DMAPRecord *record);
+
+/**
+ * dmap_record_from_blob:
+ * @blob: A byte array representation of a record.
+ *
+ * Returns: The record.
+ */
+DMAPRecord *dmap_record_set_from_blob (DMAPRecord *record, GByteArray *blob);
+
#endif /* __DMAP_RECORD_H */
G_END_DECLS
diff --git a/libdmapsharing/dmap.h b/libdmapsharing/dmap.h
index 2ca757e..c3aecbc 100644
--- a/libdmapsharing/dmap.h
+++ b/libdmapsharing/dmap.h
@@ -7,6 +7,7 @@
#include <libdmapsharing/dmap-container-db.h>
#include <libdmapsharing/dmap-container-record.h>
#include <libdmapsharing/dmap-db.h>
+#include <libdmapsharing/dmap-md5.h>
#include <libdmapsharing/dmap-mdns-browser.h>
#include <libdmapsharing/dmap-mdns-publisher.h>
#include <libdmapsharing/dmap-record.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]