From 7fb0439a637105a8fdf9ed7c900fa4234d5a67a2 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Thu, 4 Mar 2010 14:24:23 -0300 Subject: [PATCH] obexd: nobody outside the core should know about struct server --- obexd/src/bluetooth.c | 1 + obexd/src/dbus.h | 4 ---- obexd/src/main.c | 1 + obexd/src/manager.c | 2 +- obexd/src/obex-priv.h | 22 ++++++++++++++++++++++ obexd/src/obex.c | 2 +- obexd/src/obex.h | 17 ----------------- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/obexd/src/bluetooth.c b/obexd/src/bluetooth.c index 48b50fd62..d3f72ba81 100644 --- a/obexd/src/bluetooth.c +++ b/obexd/src/bluetooth.c @@ -39,6 +39,7 @@ #include "logging.h" #include "bluetooth.h" #include "obex.h" +#include "obex-priv.h" #include "dbus.h" #include "btio.h" #include "service.h" diff --git a/obexd/src/dbus.h b/obexd/src/dbus.h index e322d4f91..ccafc1e38 100644 --- a/obexd/src/dbus.h +++ b/obexd/src/dbus.h @@ -25,10 +25,6 @@ #define OPENOBEX_SERVICE "org.openobex" -void register_record(struct server *server); -gint request_service_authorization(struct server *server, GIOChannel *io, - const char *address); - void manager_register_session(struct obex_session *os); void manager_unregister_session(struct obex_session *os); void manager_register_transfer(struct obex_session *os); diff --git a/obexd/src/main.c b/obexd/src/main.c index 31aefdd54..7dec9358a 100644 --- a/obexd/src/main.c +++ b/obexd/src/main.c @@ -49,6 +49,7 @@ #include "bluetooth.h" #include "obexd.h" #include "obex.h" +#include "obex-priv.h" #include "service.h" #define DEFAULT_ROOT_PATH "/tmp" diff --git a/obexd/src/manager.c b/obexd/src/manager.c index f2687e5d0..8fef605d9 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -40,11 +40,11 @@ #include "bluetooth.h" #include "obexd.h" #include "obex.h" +#include "obex-priv.h" #include "dbus.h" #include "logging.h" #include "btio.h" #include "service.h" -#include "obex-priv.h" #define OPENOBEX_MANAGER_PATH "/" #define OPENOBEX_MANAGER_INTERFACE OPENOBEX_SERVICE ".Manager" diff --git a/obexd/src/obex-priv.h b/obexd/src/obex-priv.h index dce3d4cad..7bc4dbdba 100644 --- a/obexd/src/obex-priv.h +++ b/obexd/src/obex-priv.h @@ -22,6 +22,21 @@ * */ +struct server { + gboolean auto_accept; + gchar *folder; + gboolean symlinks; + gchar *capability; + guint32 handle; + gchar *devnode; + gboolean secure; + GIOChannel *io; + guint watch; + guint16 tx_mtu; + guint16 rx_mtu; + GSList *drivers; +}; + struct obex_session { GIOChannel *io; guint32 cid; @@ -45,3 +60,10 @@ struct obex_session { struct obex_mime_type_driver *driver; gboolean finished; }; + +gint obex_session_start(GIOChannel *io, struct server *server); +void server_free(struct server *server); + +void register_record(struct server *server); +gint request_service_authorization(struct server *server, GIOChannel *io, + const char *address); diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 1994851f1..3092fc6a4 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -44,11 +44,11 @@ #include "logging.h" #include "obex.h" +#include "obex-priv.h" #include "dbus.h" #include "mimetype.h" #include "service.h" #include "btio.h" -#include "obex-priv.h" /* Default MTU's */ #define DEFAULT_RX_MTU 32767 diff --git a/obexd/src/obex.h b/obexd/src/obex.h index 8d5cd91a4..ad8a2fccb 100644 --- a/obexd/src/obex.h +++ b/obexd/src/obex.h @@ -38,26 +38,10 @@ #define TARGET_SIZE 16 -struct server { - gboolean auto_accept; - gchar *folder; - gboolean symlinks; - gchar *capability; - guint32 handle; - gchar *devnode; - gboolean secure; - GIOChannel *io; - guint watch; - guint16 tx_mtu; - guint16 rx_mtu; - GSList *drivers; -}; - struct obex_session; void obex_connect_cb(GIOChannel *io, GError *err, gpointer user_data); -gint obex_session_start(GIOChannel *io, struct server *server); int obex_stream_start(struct obex_session *os, const gchar *filename); gint obex_prepare_put(struct obex_session *os); const char *obex_get_name(struct obex_session *os); @@ -74,7 +58,6 @@ gboolean obex_get_auto_accept(struct obex_session *os); int obex_remove(struct obex_session *os, const char *path); char *obex_get_id(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); -- 2.47.3