[Vortex] const patch, are these ok?

Sam Roberts sroberts at uniserve.com
Sat Dec 2 18:04:57 CET 2006


Index: src/vortex_connection.c
===================================================================
--- src/vortex_connection.c	(revision 2405)
+++ src/vortex_connection.c	(working copy)
@@ -1133,7 +1133,7 @@
  * must use \ref vortex_connection_is_ok to check if you are already
  * connected.
  */
-VortexConnection * vortex_connection_new (gchar * host, gchar * port, 
+VortexConnection * vortex_connection_new (const gchar * host, const gchar * port, 
 					  VortexConnectionNew on_connected,
 					  gpointer user_data)
 {
@@ -2144,7 +2144,7 @@
  * 
  * @return the host the given connection is connected to or NULL if something fail.
  */
-gchar            * vortex_connection_get_host             (VortexConnection * connection)
+const gchar      * vortex_connection_get_host             (VortexConnection * connection)
 {
 	g_return_val_if_fail (connection, NULL);
 
@@ -2179,7 +2179,7 @@
  * 
  * @return the port or NULL if something fails.
  */
-gchar            * vortex_connection_get_port             (VortexConnection * connection)
+const gchar      * vortex_connection_get_port             (VortexConnection * connection)
 {
 	g_return_val_if_fail (connection, NULL);
 
Index: src/vortex_connection.h
===================================================================
--- src/vortex_connection.h	(revision 2405)
+++ src/vortex_connection.h	(working copy)
@@ -41,7 +41,7 @@
 #include <vortex.h>
 
 
-VortexConnection  * vortex_connection_new                    (gchar * host, gchar * port,
+VortexConnection  * vortex_connection_new                    (const gchar * host, const gchar * port,
 							      VortexConnectionNew on_connected, 
 							      gpointer user_data);
 
@@ -111,9 +111,9 @@
 void                vortex_connection_remove_channel         (VortexConnection * connection, 
 							      VortexChannel * channel);
 
-gchar             * vortex_connection_get_host               (VortexConnection * connection);
+const gchar       * vortex_connection_get_host               (VortexConnection * connection);
 
-gchar             * vortex_connection_get_port               (VortexConnection * connection);
+const gchar       * vortex_connection_get_port               (VortexConnection * connection);
 
 gint                vortex_connection_get_id                 (VortexConnection * connection);
 
Index: src/vortex_handlers.h
===================================================================
--- src/vortex_handlers.h	(revision 2405)
+++ src/vortex_handlers.h	(working copy)
@@ -173,7 +173,8 @@
  * @param connection  Connection where the channel creation request was received.
  * @param serverName  Value for this optional start message attribute. This is used 
  * @param profile_content Optional profile content received inside the channel start message.
- * @param profile_content_reply Optional profile content reply to be used for channel start reply.
+ * @param profile_content_reply Optional profile content reply to be used for channel start reply,
+ * it will be freed by the library after the reply is sent.
  * @param encoding Encoding used for the profile content. 
  * @param user_data User defined data to be passed in to the handler when it is executed.
  * 
Index: src/vortex_channel.c
===================================================================
--- src/vortex_channel.c	(revision 2405)
+++ src/vortex_channel.c	(working copy)
@@ -1645,7 +1645,7 @@
  * @return TRUE if channel was sent or FALSE if not.
  */
 gboolean    __vortex_channel_send_msg_common (VortexChannel   * channel,
-					      gchar           * message,
+					      const gchar     * message,
 					      gint              message_size,
 					      gint            * msg_no,
 					      WaitReplyData   * wait_reply)
@@ -1771,7 +1771,7 @@
  * @return TRUE if message could be sent, FALSE if fail
  */
 gboolean        vortex_channel_send_msg   (VortexChannel * channel,
-					   gchar         * message,
+					   const gchar   * message,
 					   gint            message_size,
 					   gint          * msg_no)
 {
@@ -1856,7 +1856,7 @@
  * @return the same as \ref vortex_channel_send_msg
  */
 gboolean           vortex_channel_send_msg_and_wait               (VortexChannel   * channel,
-								   gchar           * message,
+								   const gchar     * message,
 								   gint              message_size,
 								   gint            * msg_no,
 								   WaitReplyData   * wait_reply)
Index: src/vortex_channel.h
===================================================================
--- src/vortex_channel.h	(revision 2405)
+++ src/vortex_channel.h	(working copy)
@@ -196,7 +196,7 @@
 								   gpointer key);
 
 gboolean           vortex_channel_send_msg                        (VortexChannel * channel,
-								   gchar         * message,
+								   const gchar   * message,
 								   gint            message_size,
 								   gint          * msg_no);
 
@@ -206,7 +206,7 @@
 								   ...);
 
 gboolean           vortex_channel_send_msg_and_wait               (VortexChannel   * channel,
-								   gchar           * message,
+								   const gchar     * message,
 								   gint              message_size,
 								   gint            * msg_no,
 								   WaitReplyData   * wait_reply);



More information about the Vortex mailing list