diff libpurple/ft.h @ 15823:32c366eeeb99

sed -ie 's/gaim/purple/g'
author Sean Egan <seanegan@gmail.com>
date Mon, 19 Mar 2007 07:01:17 +0000
parents 35fa1d1c4ef2
children 516f14bef90e
line wrap: on
line diff
--- a/libpurple/ft.h	Mon Mar 19 06:11:46 2007 +0000
+++ b/libpurple/ft.h	Mon Mar 19 07:01:17 2007 +0000
@@ -2,9 +2,9 @@
  * @file ft.h File Transfer API
  * @ingroup core
  *
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
@@ -24,13 +24,13 @@
  *
  * @see @ref xfer-signals
  */
-#ifndef _GAIM_FT_H_
-#define _GAIM_FT_H_
+#ifndef _PURPLE_FT_H_
+#define _PURPLE_FT_H_
 
 /**************************************************************************/
 /** Data Structures                                                       */
 /**************************************************************************/
-typedef struct _GaimXfer GaimXfer;
+typedef struct _PurpleXfer PurpleXfer;
 
 #include <glib.h>
 #include <stdio.h>
@@ -42,52 +42,52 @@
  */
 typedef enum
 {
-	GAIM_XFER_UNKNOWN = 0,  /**< Unknown file transfer type. */
-	GAIM_XFER_SEND,         /**< File sending.               */
-	GAIM_XFER_RECEIVE       /**< File receiving.             */
+	PURPLE_XFER_UNKNOWN = 0,  /**< Unknown file transfer type. */
+	PURPLE_XFER_SEND,         /**< File sending.               */
+	PURPLE_XFER_RECEIVE       /**< File receiving.             */
 
-} GaimXferType;
+} PurpleXferType;
 
 /**
  * The different states of the xfer.
  */
 typedef enum
 {
-	GAIM_XFER_STATUS_UNKNOWN = 0,   /**< Unknown, the xfer may be null. */
-	GAIM_XFER_STATUS_NOT_STARTED,   /**< It hasn't started yet. */
-	GAIM_XFER_STATUS_ACCEPTED,      /**< Receive accepted, but destination file not selected yet */
-	GAIM_XFER_STATUS_STARTED,       /**< gaim_xfer_start has been called. */
-	GAIM_XFER_STATUS_DONE,          /**< The xfer completed successfully. */
-	GAIM_XFER_STATUS_CANCEL_LOCAL,  /**< The xfer was canceled by us. */
-	GAIM_XFER_STATUS_CANCEL_REMOTE  /**< The xfer was canceled by the other end, or we couldn't connect. */
-} GaimXferStatusType;
+	PURPLE_XFER_STATUS_UNKNOWN = 0,   /**< Unknown, the xfer may be null. */
+	PURPLE_XFER_STATUS_NOT_STARTED,   /**< It hasn't started yet. */
+	PURPLE_XFER_STATUS_ACCEPTED,      /**< Receive accepted, but destination file not selected yet */
+	PURPLE_XFER_STATUS_STARTED,       /**< purple_xfer_start has been called. */
+	PURPLE_XFER_STATUS_DONE,          /**< The xfer completed successfully. */
+	PURPLE_XFER_STATUS_CANCEL_LOCAL,  /**< The xfer was canceled by us. */
+	PURPLE_XFER_STATUS_CANCEL_REMOTE  /**< The xfer was canceled by the other end, or we couldn't connect. */
+} PurpleXferStatusType;
 
 /**
  * File transfer UI operations.
  *
  * Any UI representing a file transfer must assign a filled-out
- * GaimXferUiOps structure to the gaim_xfer.
+ * PurpleXferUiOps structure to the purple_xfer.
  */
 typedef struct
 {
-	void (*new_xfer)(GaimXfer *xfer);
-	void (*destroy)(GaimXfer *xfer);
-	void (*add_xfer)(GaimXfer *xfer);
-	void (*update_progress)(GaimXfer *xfer, double percent);
-	void (*cancel_local)(GaimXfer *xfer);
-	void (*cancel_remote)(GaimXfer *xfer);
+	void (*new_xfer)(PurpleXfer *xfer);
+	void (*destroy)(PurpleXfer *xfer);
+	void (*add_xfer)(PurpleXfer *xfer);
+	void (*update_progress)(PurpleXfer *xfer, double percent);
+	void (*cancel_local)(PurpleXfer *xfer);
+	void (*cancel_remote)(PurpleXfer *xfer);
 
-} GaimXferUiOps;
+} PurpleXferUiOps;
 
 /**
  * A core representation of a file transfer.
  */
-struct _GaimXfer
+struct _PurpleXfer
 {
 	guint ref;                    /**< The reference count.                */
-	GaimXferType type;            /**< The type of transfer.               */
+	PurpleXferType type;            /**< The type of transfer.               */
 
-	GaimAccount *account;         /**< The account.                        */
+	PurpleAccount *account;         /**< The account.                        */
 
 	char *who;                    /**< The person on the other end of the
 	                                   transfer.                           */
@@ -114,24 +114,24 @@
 	size_t current_buffer_size;   /**< This gradually increases for fast
 	                                   network connections. */
 
-	GaimXferStatusType status;    /**< File Transfer's status.             */
+	PurpleXferStatusType status;    /**< File Transfer's status.             */
 
 	/* I/O operations. */
 	struct
 	{
-		void (*init)(GaimXfer *xfer);
-		void (*request_denied)(GaimXfer *xfer);
-		void (*start)(GaimXfer *xfer);
-		void (*end)(GaimXfer *xfer);
-		void (*cancel_send)(GaimXfer *xfer);
-		void (*cancel_recv)(GaimXfer *xfer);
-		gssize (*read)(guchar **buffer, GaimXfer *xfer);
-		gssize (*write)(const guchar *buffer, size_t size, GaimXfer *xfer);
-		void (*ack)(GaimXfer *xfer, const guchar *buffer, size_t size);
+		void (*init)(PurpleXfer *xfer);
+		void (*request_denied)(PurpleXfer *xfer);
+		void (*start)(PurpleXfer *xfer);
+		void (*end)(PurpleXfer *xfer);
+		void (*cancel_send)(PurpleXfer *xfer);
+		void (*cancel_recv)(PurpleXfer *xfer);
+		gssize (*read)(guchar **buffer, PurpleXfer *xfer);
+		gssize (*write)(const guchar *buffer, size_t size, PurpleXfer *xfer);
+		void (*ack)(PurpleXfer *xfer, const guchar *buffer, size_t size);
 
 	} ops;
 
-	GaimXferUiOps *ui_ops;            /**< UI-specific operations. */
+	PurpleXferUiOps *ui_ops;            /**< UI-specific operations. */
 	void *ui_data;                    /**< UI-specific data.       */
 
 	void *data;                       /**< prpl-specific data.     */
@@ -151,7 +151,7 @@
  * This is called by prpls.
  * The handle starts with a ref count of 1, and this reference
  * is owned by the core. The prpl normally does not need to
- * gaim_xfer_ref or unref.
+ * purple_xfer_ref or unref.
  *
  * @param account The account sending or receiving the file.
  * @param type    The type of file transfer.
@@ -159,34 +159,34 @@
  *
  * @return A file transfer handle.
  */
-GaimXfer *gaim_xfer_new(GaimAccount *account,
-								GaimXferType type, const char *who);
+PurpleXfer *purple_xfer_new(PurpleAccount *account,
+								PurpleXferType type, const char *who);
 
 /**
  * Returns all xfers
  *
  * @return all current xfers with refs
  */
-GList *gaim_xfers_get_all(void);
+GList *purple_xfers_get_all(void);
 
 /**
- * Increases the reference count on a GaimXfer.
- * Please call gaim_xfer_unref later.
+ * Increases the reference count on a PurpleXfer.
+ * Please call purple_xfer_unref later.
  *
  * @param xfer A file transfer handle.
  */
-void gaim_xfer_ref(GaimXfer *xfer);
+void purple_xfer_ref(PurpleXfer *xfer);
 
 /**
- * Decreases the reference count on a GaimXfer.
- * If the reference reaches 0, gaim_xfer_destroy (an internal function)
+ * Decreases the reference count on a PurpleXfer.
+ * If the reference reaches 0, purple_xfer_destroy (an internal function)
  * will destroy the xfer. It calls the ui destroy cb first.
  * Since the core keeps a ref on the xfer, only an erroneous call to
  * this function will destroy the xfer while still in use.
  *
  * @param xfer A file transfer handle.
  */
-void gaim_xfer_unref(GaimXfer *xfer);
+void purple_xfer_unref(PurpleXfer *xfer);
 
 /**
  * Requests confirmation for a file transfer from the user. If receiving
@@ -197,7 +197,7 @@
  *
  * @param xfer The file transfer to request confirmation on.
  */
-void gaim_xfer_request(GaimXfer *xfer);
+void purple_xfer_request(PurpleXfer *xfer);
 
 /**
  * Called if the user accepts the file transfer request.
@@ -205,14 +205,14 @@
  * @param xfer     The file transfer.
  * @param filename The filename.
  */
-void gaim_xfer_request_accepted(GaimXfer *xfer, const char *filename);
+void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename);
 
 /**
  * Called if the user rejects the file transfer request.
  *
  * @param xfer The file transfer.
  */
-void gaim_xfer_request_denied(GaimXfer *xfer);
+void purple_xfer_request_denied(PurpleXfer *xfer);
 
 /**
  * Returns the type of file transfer.
@@ -221,7 +221,7 @@
  *
  * @return The type of the file transfer.
  */
-GaimXferType gaim_xfer_get_type(const GaimXfer *xfer);
+PurpleXferType purple_xfer_get_type(const PurpleXfer *xfer);
 
 /**
  * Returns the account the file transfer is using.
@@ -230,7 +230,7 @@
  *
  * @return The account.
  */
-GaimAccount *gaim_xfer_get_account(const GaimXfer *xfer);
+PurpleAccount *purple_xfer_get_account(const PurpleXfer *xfer);
 
 /**
  * Returns the status of the xfer.
@@ -239,7 +239,7 @@
  *
  * @return The status.
  */
-GaimXferStatusType gaim_xfer_get_status(const GaimXfer *xfer);
+PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer);
 
 /**
  * Returns true if the file transfer was canceled.
@@ -248,7 +248,7 @@
  *
  * @return Whether or not the transfer was canceled.
  */
-gboolean gaim_xfer_is_canceled(const GaimXfer *xfer);
+gboolean purple_xfer_is_canceled(const PurpleXfer *xfer);
 
 /**
  * Returns the completed state for a file transfer.
@@ -257,7 +257,7 @@
  *
  * @return The completed state.
  */
-gboolean gaim_xfer_is_completed(const GaimXfer *xfer);
+gboolean purple_xfer_is_completed(const PurpleXfer *xfer);
 
 /**
  * Returns the name of the file being sent or received.
@@ -266,7 +266,7 @@
  *
  * @return The filename.
  */
-const char *gaim_xfer_get_filename(const GaimXfer *xfer);
+const char *purple_xfer_get_filename(const PurpleXfer *xfer);
 
 /**
  * Returns the file's destination filename,
@@ -275,7 +275,7 @@
  *
  * @return The destination filename.
  */
-const char *gaim_xfer_get_local_filename(const GaimXfer *xfer);
+const char *purple_xfer_get_local_filename(const PurpleXfer *xfer);
 
 /**
  * Returns the number of bytes sent (or received) so far.
@@ -284,7 +284,7 @@
  *
  * @return The number of bytes sent.
  */
-size_t gaim_xfer_get_bytes_sent(const GaimXfer *xfer);
+size_t purple_xfer_get_bytes_sent(const PurpleXfer *xfer);
 
 /**
  * Returns the number of bytes remaining to send or receive.
@@ -293,7 +293,7 @@
  *
  * @return The number of bytes remaining.
  */
-size_t gaim_xfer_get_bytes_remaining(const GaimXfer *xfer);
+size_t purple_xfer_get_bytes_remaining(const PurpleXfer *xfer);
 
 /**
  * Returns the size of the file being sent or received.
@@ -302,7 +302,7 @@
  *
  * @return The total size of the file.
  */
-size_t gaim_xfer_get_size(const GaimXfer *xfer);
+size_t purple_xfer_get_size(const PurpleXfer *xfer);
 
 /**
  * Returns the current percentage of progress of the transfer.
@@ -313,7 +313,7 @@
  *
  * @return The percentage complete.
  */
-double gaim_xfer_get_progress(const GaimXfer *xfer);
+double purple_xfer_get_progress(const PurpleXfer *xfer);
 
 /**
  * Returns the local port number in the file transfer.
@@ -322,7 +322,7 @@
  *
  * @return The port number on this end.
  */
-unsigned int gaim_xfer_get_local_port(const GaimXfer *xfer);
+unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer);
 
 /**
  * Returns the remote IP address in the file transfer.
@@ -331,7 +331,7 @@
  *
  * @return The IP address on the other end.
  */
-const char *gaim_xfer_get_remote_ip(const GaimXfer *xfer);
+const char *purple_xfer_get_remote_ip(const PurpleXfer *xfer);
 
 /**
  * Returns the remote port number in the file transfer.
@@ -340,7 +340,7 @@
  *
  * @return The port number on the other end.
  */
-unsigned int gaim_xfer_get_remote_port(const GaimXfer *xfer);
+unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer);
 
 /**
  * Sets the completed state for the file transfer.
@@ -348,7 +348,7 @@
  * @param xfer      The file transfer.
  * @param completed The completed state.
  */
-void gaim_xfer_set_completed(GaimXfer *xfer, gboolean completed);
+void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed);
 
 /**
  * Sets the filename for the file transfer.
@@ -356,7 +356,7 @@
  * @param xfer     The file transfer.
  * @param message The message.
  */
-void gaim_xfer_set_message(GaimXfer *xfer, const char *message);
+void purple_xfer_set_message(PurpleXfer *xfer, const char *message);
 
 /**
  * Sets the filename for the file transfer.
@@ -364,7 +364,7 @@
  * @param xfer     The file transfer.
  * @param filename The filename.
  */
-void gaim_xfer_set_filename(GaimXfer *xfer, const char *filename);
+void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename);
 
 /**
  * Sets the local filename for the file transfer.
@@ -372,7 +372,7 @@
  * @param xfer     The file transfer.
  * @param filename The filename
  */
-void gaim_xfer_set_local_filename(GaimXfer *xfer, const char *filename);
+void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename);
 
 /**
  * Sets the size of the file in a file transfer.
@@ -380,7 +380,7 @@
  * @param xfer The file transfer.
  * @param size The size of the file.
  */
-void gaim_xfer_set_size(GaimXfer *xfer, size_t size);
+void purple_xfer_set_size(PurpleXfer *xfer, size_t size);
 
 /**
  * Sets the current working position in the active file transfer.  This
@@ -395,7 +395,7 @@
  *                   send.  If we're receiving a file, this is the
  *                   next byte that we expect to receive.
  */
-void gaim_xfer_set_bytes_sent(GaimXfer *xfer, size_t bytes_sent);
+void purple_xfer_set_bytes_sent(PurpleXfer *xfer, size_t bytes_sent);
 
 /**
  * Returns the UI operations structure for a file transfer.
@@ -404,7 +404,7 @@
  *
  * @return The UI operations structure.
  */
-GaimXferUiOps *gaim_xfer_get_ui_ops(const GaimXfer *xfer);
+PurpleXferUiOps *purple_xfer_get_ui_ops(const PurpleXfer *xfer);
 
 /**
  * Sets the read function for the file transfer.
@@ -412,8 +412,8 @@
  * @param xfer The file transfer.
  * @param fnc  The read function.
  */
-void gaim_xfer_set_read_fnc(GaimXfer *xfer,
-		gssize (*fnc)(guchar **, GaimXfer *));
+void purple_xfer_set_read_fnc(PurpleXfer *xfer,
+		gssize (*fnc)(guchar **, PurpleXfer *));
 
 /**
  * Sets the write function for the file transfer.
@@ -421,8 +421,8 @@
  * @param xfer The file transfer.
  * @param fnc  The write function.
  */
-void gaim_xfer_set_write_fnc(GaimXfer *xfer,
-		gssize (*fnc)(const guchar *, size_t, GaimXfer *));
+void purple_xfer_set_write_fnc(PurpleXfer *xfer,
+		gssize (*fnc)(const guchar *, size_t, PurpleXfer *));
 
 /**
  * Sets the acknowledge function for the file transfer.
@@ -430,8 +430,8 @@
  * @param xfer The file transfer.
  * @param fnc  The acknowledge function.
  */
-void gaim_xfer_set_ack_fnc(GaimXfer *xfer,
-		void (*fnc)(GaimXfer *, const guchar *, size_t));
+void purple_xfer_set_ack_fnc(PurpleXfer *xfer,
+		void (*fnc)(PurpleXfer *, const guchar *, size_t));
 
 /**
  * Sets the function to be called if the request is denied.
@@ -439,19 +439,19 @@
  * @param xfer The file transfer.
  * @param fnc The request denied prpl callback.
  */
-void gaim_xfer_set_request_denied_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
+void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
 
 /**
  * Sets the transfer initialization function for the file transfer.
  *
- * This function is required, and must call gaim_xfer_start() with
+ * This function is required, and must call purple_xfer_start() with
  * the necessary parameters. This will be called if the file transfer
  * is accepted by the user.
  *
  * @param xfer The file transfer.
  * @param fnc  The transfer initialization function.
  */
-void gaim_xfer_set_init_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
+void purple_xfer_set_init_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
 
 /**
  * Sets the start transfer function for the file transfer.
@@ -459,7 +459,7 @@
  * @param xfer The file transfer.
  * @param fnc  The start transfer function.
  */
-void gaim_xfer_set_start_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
+void purple_xfer_set_start_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
 
 /**
  * Sets the end transfer function for the file transfer.
@@ -467,7 +467,7 @@
  * @param xfer The file transfer.
  * @param fnc  The end transfer function.
  */
-void gaim_xfer_set_end_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
+void purple_xfer_set_end_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
 
 /**
  * Sets the cancel send function for the file transfer.
@@ -475,7 +475,7 @@
  * @param xfer The file transfer.
  * @param fnc  The cancel send function.
  */
-void gaim_xfer_set_cancel_send_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
+void purple_xfer_set_cancel_send_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
 
 /**
  * Sets the cancel receive function for the file transfer.
@@ -483,7 +483,7 @@
  * @param xfer The file transfer.
  * @param fnc  The cancel receive function.
  */
-void gaim_xfer_set_cancel_recv_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
+void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *));
 
 /**
  * Reads in data from a file transfer stream.
@@ -493,7 +493,7 @@
  *
  * @return The number of bytes read, or -1.
  */
-gssize gaim_xfer_read(GaimXfer *xfer, guchar **buffer);
+gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer);
 
 /**
  * Writes data to a file transfer stream.
@@ -504,7 +504,7 @@
  *
  * @return The number of bytes written, or -1.
  */
-gssize gaim_xfer_write(GaimXfer *xfer, const guchar *buffer, gsize size);
+gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size);
 
 /**
  * Starts a file transfer.
@@ -518,7 +518,7 @@
  * @param ip   The IP address to connect to.
  * @param port The port to connect to.
  */
-void gaim_xfer_start(GaimXfer *xfer, int fd, const char *ip,
+void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip,
 					 unsigned int port);
 
 /**
@@ -526,34 +526,34 @@
  *
  * @param xfer The file transfer.
  */
-void gaim_xfer_end(GaimXfer *xfer);
+void purple_xfer_end(PurpleXfer *xfer);
 
 /**
  * Adds a new file transfer to the list of file transfers. Call this only
- * if you are not using gaim_xfer_start.
+ * if you are not using purple_xfer_start.
  *
  * @param xfer The file transfer.
  */
-void gaim_xfer_add(GaimXfer *xfer);
+void purple_xfer_add(PurpleXfer *xfer);
 
 /**
  * Cancels a file transfer on the local end.
  *
  * @param xfer The file transfer.
  */
-void gaim_xfer_cancel_local(GaimXfer *xfer);
+void purple_xfer_cancel_local(PurpleXfer *xfer);
 
 /**
  * Cancels a file transfer from the remote end.
  *
  * @param xfer The file transfer.
  */
-void gaim_xfer_cancel_remote(GaimXfer *xfer);
+void purple_xfer_cancel_remote(PurpleXfer *xfer);
 
 /**
  * Displays a file transfer-related error message.
  *
- * This is a wrapper around gaim_notify_error(), which automatically
+ * This is a wrapper around purple_notify_error(), which automatically
  * specifies a title ("File transfer to <i>user</i> failed" or
  * "File Transfer from <i>user</i> failed").
  *
@@ -562,25 +562,25 @@
  * @param who     The user on the other end of the transfer.
  * @param msg     The message to display.
  */
-void gaim_xfer_error(GaimXferType type, GaimAccount *account, const char *who, const char *msg);
+void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg);
 
 /**
  * Updates file transfer progress.
  *
  * @param xfer      The file transfer.
  */
-void gaim_xfer_update_progress(GaimXfer *xfer);
+void purple_xfer_update_progress(PurpleXfer *xfer);
 
 /**
  * Displays a file transfer-related message in the conversation window
  *
- * This is a wrapper around gaim_conversation_write
+ * This is a wrapper around purple_conversation_write
  *
  * @param xfer The file transfer to which this message relates.
  * @param message The message to display.
  * @param is_error Is this an error message?.
  */
-void gaim_xfer_conversation_write(GaimXfer *xfer, char *message, gboolean is_error);
+void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error);
 
 /*@}*/
 
@@ -594,31 +594,31 @@
  *
  * @return The handle
  */
-void *gaim_xfers_get_handle(void);
+void *purple_xfers_get_handle(void);
 
 /**
  * Initializes the file transfer subsystem
  */
-void gaim_xfers_init(void);
+void purple_xfers_init(void);
 
 /**
  * Uninitializes the file transfer subsystem
  */
-void gaim_xfers_uninit(void);
+void purple_xfers_uninit(void);
 
 /**
- * Sets the UI operations structure to be used in all gaim file transfers.
+ * Sets the UI operations structure to be used in all purple file transfers.
  *
  * @param ops The UI operations structure.
  */
-void gaim_xfers_set_ui_ops(GaimXferUiOps *ops);
+void purple_xfers_set_ui_ops(PurpleXferUiOps *ops);
 
 /**
- * Returns the UI operations structure to be used in all gaim file transfers.
+ * Returns the UI operations structure to be used in all purple file transfers.
  *
  * @return The UI operations structure.
  */
-GaimXferUiOps *gaim_xfers_get_ui_ops(void);
+PurpleXferUiOps *purple_xfers_get_ui_ops(void);
 
 /*@}*/
 
@@ -626,4 +626,4 @@
 }
 #endif
 
-#endif /* _GAIM_FT_H_ */
+#endif /* _PURPLE_FT_H_ */