linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH obexd 08/13 v2] client: introduce obc_session_delete
Date: Tue,  7 Feb 2012 16:25:47 +0200	[thread overview]
Message-ID: <1328624752-26061-8-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1328624752-26061-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 client/session.c |   29 +++++++++++++++++++++++++++++
 client/session.h |    3 +++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/client/session.c b/client/session.c
index b0148cf..a3bba7e 100644
--- a/client/session.c
+++ b/client/session.c
@@ -1362,3 +1362,32 @@ guint obc_session_move(struct obc_session *session, const char *filename,
 	session->p = p;
 	return p->id;
 }
+
+guint obc_session_delete(struct obc_session *session, const char *file,
+				session_callback_t func, void *user_data,
+				GError **err)
+{
+	struct pending_request *p;
+
+	if (session->obex == NULL) {
+		g_set_error(err, OBEX_IO_ERROR, -ENOTCONN,
+							strerror(-ENOTCONN));
+		return 0;
+	}
+
+	if (session->p != NULL) {
+		g_set_error(err, OBEX_IO_ERROR, -EBUSY, strerror(-EBUSY));
+		return 0;
+	}
+
+	p = pending_request_new(session, NULL, NULL, func, user_data);
+
+	p->req_id = g_obex_delete(session->obex, file, async_cb, p, err);
+	if (*err != NULL) {
+		pending_request_free(p);
+		return 0;
+	}
+
+	session->p = p;
+	return p->id;
+}
diff --git a/client/session.h b/client/session.h
index 64548e9..ac5c27a 100644
--- a/client/session.h
+++ b/client/session.h
@@ -86,3 +86,6 @@ guint obc_session_copy(struct obc_session *session, const char *filename,
 guint obc_session_move(struct obc_session *session, const char *filename,
 				const char *destname, session_callback_t func,
 				void *user_data, GError **err);
+guint obc_session_delete(struct obc_session *session, const char *file,
+				session_callback_t func, void *user_data,
+				GError **err);
-- 
1.7.7.6


  parent reply	other threads:[~2012-02-07 14:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 14:25 [PATCH obexd 01/13 v2] client: fix not checking session_request return Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 02/13 v2] client: remove unused field from obc_session Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 03/13 v2] client: fix not queuing requests properly Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 04/13 v2] client: introduce obc_session_setpath Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 05/13 v2] client: introduce obc_session_mkdir Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 06/13 v2] client: introduce obc_session_copy Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 07/13 v2] client: introduce obc_session_move Luiz Augusto von Dentz
2012-02-07 14:25 ` Luiz Augusto von Dentz [this message]
2012-02-07 14:25 ` [PATCH obexd 09/13 v2] client: introduce obc_session_cancel Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 10/13 v2] client: remove use of gobex in pbap module Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 11/13 v2] client: remove use of gobex in map module Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 12/13 v2] client: remove use of gobex in ftp module Luiz Augusto von Dentz
2012-02-07 14:25 ` [PATCH obexd 13/13 v2] client: remove gobex dependency of session Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328624752-26061-8-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).