pidgin: 31a51d35: Add some get/set functions to help hiddi..
masca at cpw.pidgin.im
masca at cpw.pidgin.im
Thu Sep 1 02:22:46 EDT 2011
----------------------------------------------------------------------
Revision: 31a51d35c84f5fe2acf47e30343e0de6fc65feac
Parent: 2205bef33f587905cb2d77ea0220c7bd261d2970
Author: masca at cpw.pidgin.im
Date: 09/01/11 02:00:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/31a51d35c84f5fe2acf47e30343e0de6fc65feac
Changelog:
Add some get/set functions to help hidding _PrupleXfer.
Changes against parent 2205bef33f587905cb2d77ea0220c7bd261d2970
patched libpurple/ft.c
patched libpurple/ft.h
-------------- next part --------------
============================================================
--- libpurple/ft.c 921123e08a65cec2f215c35975db53c65e0684f8
+++ libpurple/ft.c e2fa9c4656388eda3fe90179dbb4bd15746973fe
@@ -220,7 +220,7 @@ purple_xfer_unref(PurpleXfer *xfer)
purple_xfer_destroy(xfer);
}
-static void
+void
purple_xfer_set_status(PurpleXfer *xfer, PurpleXferStatusType status)
{
g_return_if_fail(xfer != NULL);
@@ -720,6 +720,20 @@ purple_xfer_request_denied(PurpleXfer *x
purple_xfer_unref(xfer);
}
+int purple_xfer_get_fd(PurpleXfer *xfer)
+{
+ g_return_val_if_fail(xfer != NULL, 0);
+
+ return xfer->fd;
+}
+
+int purple_xfer_get_watcher(PurpleXfer *xfer)
+{
+ g_return_val_if_fail(xfer != NULL, 0);
+
+ return xfer->watcher;
+}
+
PurpleXferType
purple_xfer_get_type(const PurpleXfer *xfer)
{
@@ -864,6 +878,20 @@ purple_xfer_get_end_time(const PurpleXfe
return xfer->end_time;
}
+void purple_xfer_set_fd(PurpleXfer *xfer, int fd)
+{
+ g_return_if_fail(xfer != NULL);
+
+ xfer->fd = fd;
+}
+
+void purple_xfer_set_watcher(PurpleXfer *xfer, int watcher)
+{
+ g_return_if_fail(xfer != NULL);
+
+ xfer->watcher = watcher;
+}
+
void
purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed)
{
@@ -947,6 +975,14 @@ void
}
void
+purple_xfer_set_local_port(PurpleXfer *xfer, unsigned int local_port)
+{
+ g_return_if_fail(xfer != NULL);
+
+ xfer->local_port = local_port;
+}
+
+void
purple_xfer_set_bytes_sent(PurpleXfer *xfer, size_t bytes_sent)
{
g_return_if_fail(xfer != NULL);
============================================================
--- libpurple/ft.h 3ce0352dae09cfed6f84321789dc7041555b8cbc
+++ libpurple/ft.h 9acd827114eb58a374606a45a8cd182219925cc9
@@ -266,6 +266,24 @@ void purple_xfer_request_denied(PurpleXf
void purple_xfer_request_denied(PurpleXfer *xfer);
/**
+ * Returns the socket file descriptor.
+ *
+ * @param xfer The file transfer.
+ *
+ * @return The socket file descriptor.
+ */
+int purple_xfer_get_fd(PurpleXfer *xfer);
+
+/**
+ * Returns the Watcher for the transfer.
+ *
+ * @param xfer The file transfer.
+ *
+ * @return The watcher.
+ */
+int purple_xfer_get_watcher(PurpleXfer *xfer);
+
+/**
* Returns the type of file transfer.
*
* @param xfer The file transfer.
@@ -426,6 +444,22 @@ time_t purple_xfer_get_end_time(const Pu
time_t purple_xfer_get_end_time(const PurpleXfer *xfer);
/**
+ * Sets the socket file descriptor.
+ *
+ * @param xfer The file transfer.
+ * @param fd The file descriptor.
+ */
+void purple_xfer_set_fd(PurpleXfer *xfer, int fd);
+
+/**
+ * Sets the watcher for the file transfer.
+ *
+ * @param xfer The file transfer.
+ * @param watcher The watcher.
+ */
+void purple_xfer_set_watcher(PurpleXfer *xfer, int watcher);
+
+/**
* Sets the completed state for the file transfer.
*
* @param xfer The file transfer.
@@ -434,6 +468,14 @@ void purple_xfer_set_completed(PurpleXfe
void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed);
/**
+ * Sets the current status for the file transfer.
+ *
+ * @param xfer The file transfer.
+ * @param status The current status.
+ */
+void purple_xfer_set_status(PurpleXfer *xfer, PurpleXferStatusType status);
+
+/**
* Sets the filename for the file transfer.
*
* @param xfer The file transfer.
@@ -466,6 +508,14 @@ void purple_xfer_set_size(PurpleXfer *xf
void purple_xfer_set_size(PurpleXfer *xfer, size_t size);
/**
+ * Sets the local port of the file transfer.
+ *
+ * @param xfer The file transfer.
+ * @param local_port The local port.
+ */
+void purple_xfer_set_local_port(PurpleXfer *xfer, unsigned int local_port);
+
+/**
* Sets the current working position in the active file transfer. This
* can be used to jump backward in the file if the protocol detects
* that some bit of data needs to be resent or has been sent twice.
More information about the Commits
mailing list