Diff between 971be76c6295eddaf30ddb812a75a379440a29d2 and e12802a76b6a26d7556be8392aa9af75b8e983c5

Changed Files

File Additions Deletions Status
gobex/gobex-header.h +5 -0 modified
gobex/gobex.c +30 -0 modified
gobex/gobex.h +8 -0 modified

Full Patch

diff --git a/gobex/gobex-header.h b/gobex/gobex-header.h
index b7d23eb..2420e75 100644
--- a/gobex/gobex-header.h
+++ b/gobex/gobex-header.h
@@ -55,6 +55,11 @@
 #define G_OBEX_HDR_SRM			0x97
 #define G_OBEX_HDR_SRM_PARAMETERS	0x98
 
+/* Action header values */
+#define G_OBEX_ACTION_COPY		0x00
+#define G_OBEX_ACTION_MOVE		0x01
+#define G_OBEX_ACTION_SETPERM		0x02
+
 typedef struct _GObexHeader GObexHeader;
 
 gboolean g_obex_header_get_unicode(GObexHeader *header, const char **str);
diff --git a/gobex/gobex.c b/gobex/gobex.c
index 7c2fbcc..5d63c6e 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -1008,3 +1008,33 @@ guint g_obex_delete(GObex *obex, const char *name, GObexResponseFunc func,
 
 	return g_obex_send_req(obex, req, -1, func, user_data, err);
 }
+
+guint g_obex_copy(GObex *obex, const char *name, const char *dest,
+			GObexResponseFunc func, gpointer user_data,
+			GError **err)
+{
+	GObexPacket *req;
+
+	req = g_obex_packet_new(G_OBEX_OP_PUT, TRUE,
+					G_OBEX_HDR_ACTION, G_OBEX_ACTION_COPY,
+					G_OBEX_HDR_NAME, name,
+					G_OBEX_HDR_DESTNAME, dest,
+					G_OBEX_HDR_INVALID);
+
+	return g_obex_send_req(obex, req, -1, func, user_data, err);
+}
+
+guint g_obex_move(GObex *obex, const char *name, const char *dest,
+			GObexResponseFunc func, gpointer user_data,
+			GError **err)
+{
+	GObexPacket *req;
+
+	req = g_obex_packet_new(G_OBEX_OP_PUT, TRUE,
+					G_OBEX_HDR_ACTION, G_OBEX_ACTION_MOVE,
+					G_OBEX_HDR_NAME, name,
+					G_OBEX_HDR_DESTNAME, dest,
+					G_OBEX_HDR_INVALID);
+
+	return g_obex_send_req(obex, req, -1, func, user_data, err);
+}
diff --git a/gobex/gobex.h b/gobex/gobex.h
index a8424f3..e210e79 100644
--- a/gobex/gobex.h
+++ b/gobex/gobex.h
@@ -82,6 +82,14 @@ guint g_obex_mkdir(GObex *obex, const char *path, GObexResponseFunc func,
 guint g_obex_delete(GObex *obex, const char *name, GObexResponseFunc func,
 					gpointer user_data, GError **err);
 
+guint g_obex_copy(GObex *obex, const char *name, const char *dest,
+			GObexResponseFunc func, gpointer user_data,
+			GError **err);
+
+guint g_obex_move(GObex *obex, const char *name, const char *dest,
+			GObexResponseFunc func, gpointer user_data,
+			GError **err);
+
 /* Transfer related high-level functions */
 
 guint g_obex_put_req(GObex *obex, GObexDataProducer data_func,