From 5ec3275a2e8bd3fb2f360faeb862da0bca2e68a0 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 26 Feb 2010 14:36:27 -0300 Subject: [PATCH] obexd: Rename some obexd core functions It is not necessary add "session" in the name of these functions since the first argument is the obex session structure. The following functions were renamed: obex_session_get_name, obex_session_get_size and obex_session_get_type. --- obexd/plugins/ftp.c | 8 ++++---- obexd/plugins/opp.c | 6 +++--- obexd/plugins/pbap.c | 6 +++--- obexd/plugins/syncevolution.c | 2 +- obexd/src/obex.c | 6 +++--- obexd/src/obex.h | 20 ++++++++------------ 6 files changed, 22 insertions(+), 26 deletions(-) diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c index 2cacd50c1..82cb70833 100644 --- a/obexd/plugins/ftp.c +++ b/obexd/plugins/ftp.c @@ -227,7 +227,7 @@ fail: static gint ftp_delete(struct OBEX_session *os) { - const char *name = obex_session_get_name(os); + const char *name = obex_get_name(os); const char *folder = obex_get_folder(os); gchar *path; int ret = 0; @@ -265,8 +265,8 @@ static gint ftp_chkput(obex_t *obex, obex_object_t *obj) static obex_rsp_t ftp_put(struct OBEX_session *os) { const char *folder = obex_get_folder(os); - const char *name = obex_session_get_name(os); - ssize_t size = obex_session_get_size(os); + const char *name = obex_get_name(os); + ssize_t size = obex_get_size(os); int ret = 0; if (folder == NULL) @@ -305,7 +305,7 @@ static obex_rsp_t ftp_setpath(struct OBEX_session *os, obex_object_t *obj) return OBEX_RSP_PRECONDITION_FAILED; } - name = obex_session_get_name(os); + name = obex_get_name(os); root_folder = obex_get_root_folder(os); current_folder = obex_get_folder(os); root = g_str_equal(root_folder, current_folder); diff --git a/obexd/plugins/opp.c b/obexd/plugins/opp.c index a57edff8c..2df3d12cd 100644 --- a/obexd/plugins/opp.c +++ b/obexd/plugins/opp.c @@ -152,7 +152,7 @@ skip_auth: static obex_rsp_t opp_put(struct OBEX_session *os) { - const char *name = obex_session_get_name(os); + const char *name = obex_get_name(os); const char *folder = obex_get_folder(os); if (folder == NULL) @@ -168,10 +168,10 @@ static obex_rsp_t opp_get(struct OBEX_session *os) { const char *type; - if (obex_session_get_name(os) == NULL) + if (obex_get_name(os) == NULL) return OBEX_RSP_FORBIDDEN; - type = obex_session_get_type(os); + type = obex_get_type(os); if (type == NULL) return OBEX_RSP_FORBIDDEN; diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index 4efdf23b8..90c427f4c 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -388,8 +388,8 @@ static obex_rsp_t pbap_connect(struct OBEX_session *os) static obex_rsp_t pbap_get(struct OBEX_session *os) { int addbody = TRUE; - const char *type = obex_session_get_type(os); - const char *name = obex_session_get_name(os); + const char *type = obex_get_type(os); + const char *name = obex_get_name(os); int err; if (type == NULL) @@ -471,7 +471,7 @@ static obex_rsp_t pbap_setpath(struct OBEX_session *os, obex_object_t *obj) } current_folder = obex_get_folder(os); - name = obex_session_get_name(os); + name = obex_get_name(os); /* Check "Backup" flag */ if ((nonhdr[0] & 0x01) == 0x01) { diff --git a/obexd/plugins/syncevolution.c b/obexd/plugins/syncevolution.c index bd4d09a97..5f7895242 100644 --- a/obexd/plugins/syncevolution.c +++ b/obexd/plugins/syncevolution.c @@ -350,7 +350,7 @@ static obex_rsp_t synce_put(struct OBEX_session *os) DBusMessage *msg; DBusMessageIter iter, array_iter; DBusPendingCall *call; - const char *type = obex_session_get_type(os); + const char *type = obex_get_type(os); context = find_context(os); if (!context) diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 94898a953..addfc2a90 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -1098,17 +1098,17 @@ struct obex_session *obex_get_session(gpointer object) return NULL; } -const char *obex_session_get_name(struct OBEX_session *os) +const char *obex_get_name(struct OBEX_session *os) { return os->name; } -ssize_t obex_session_get_size(struct OBEX_session *os) +ssize_t obex_get_size(struct OBEX_session *os) { return os->size; } -const char *obex_session_get_type(struct OBEX_session *os) +const char *obex_get_type(struct OBEX_session *os) { return os->type; } diff --git a/obexd/src/obex.h b/obexd/src/obex.h index 527d42d6c..d35234921 100644 --- a/obexd/src/obex.h +++ b/obexd/src/obex.h @@ -89,22 +89,18 @@ void obex_connect_cb(GIOChannel *io, GError *err, gpointer user_data); gint obex_session_start(GIOChannel *io, struct server *server); struct obex_session *obex_get_session(gpointer object); -gint obex_tty_session_stop(void); - int obex_stream_start(struct OBEX_session *os, gchar *filename); gint os_prepare_put(struct obex_session *os); - -void server_free(struct server *server); - -int tty_init(gint service, const gchar *folder, const gchar *capability, - gboolean symlinks, const gchar *devnode); -void tty_closed(void); - -const char *obex_session_get_name(struct OBEX_session *os); -ssize_t obex_session_get_size(struct OBEX_session *os); -const char *obex_session_get_type(struct OBEX_session *os); +const char *obex_get_name(struct OBEX_session *os); +ssize_t obex_get_size(struct OBEX_session *os); +const char *obex_get_type(struct OBEX_session *os); const char *obex_get_folder(struct OBEX_session *os); void obex_set_folder(struct OBEX_session *os, const char *folder); const char *obex_get_root_folder(struct OBEX_session *os); gboolean obex_get_symlinks(struct OBEX_session *os); +void server_free(struct server *server); +int tty_init(gint service, const gchar *folder, const gchar *capability, + gboolean symlinks, const gchar *devnode); +gint obex_tty_session_stop(void); +void tty_closed(void); -- 2.47.3