GUACAMOLE-629: Add support for sending "argv" instructions from server to client.
diff --git a/src/libguac/guacamole/protocol.h b/src/libguac/guacamole/protocol.h
index 0b462b4..fb8fbef 100644
--- a/src/libguac/guacamole/protocol.h
+++ b/src/libguac/guacamole/protocol.h
@@ -933,6 +933,31 @@
/* TEXT INSTRUCTIONS */
/**
+ * Sends an argv instruction over the given guac_socket connection.
+ *
+ * If an error occurs sending the instruction, a non-zero value is
+ * returned, and guac_error is set appropriately.
+ *
+ * @param socket
+ * The guac_socket connection to use to send the connection parameter
+ * value.
+ *
+ * @param stream
+ * The stream to use to send the connection parameter value.
+ *
+ * @param mimetype
+ * The mimetype of the connection parameter value being sent.
+ *
+ * @param name
+ * The name of the connection parameter whose current value is being sent.
+ *
+ * @return
+ * Zero on success, non-zero on error.
+ */
+int guac_protocol_send_argv(guac_socket* socket, guac_stream* stream,
+ const char* mimetype, const char* name);
+
+/**
* Sends a clipboard instruction over the given guac_socket connection.
*
* If an error occurs sending the instruction, a non-zero value is
diff --git a/src/libguac/protocol.c b/src/libguac/protocol.c
index 46a9858..53b534d 100644
--- a/src/libguac/protocol.c
+++ b/src/libguac/protocol.c
@@ -125,6 +125,26 @@
}
+int guac_protocol_send_argv(guac_socket* socket, guac_stream* stream,
+ const char* mimetype, const char* name) {
+
+ int ret_val;
+
+ guac_socket_instruction_begin(socket);
+ ret_val =
+ guac_socket_write_string(socket, "4.argv,")
+ || __guac_socket_write_length_int(socket, stream->index)
+ || guac_socket_write_string(socket, ",")
+ || __guac_socket_write_length_string(socket, mimetype)
+ || guac_socket_write_string(socket, ",")
+ || __guac_socket_write_length_string(socket, name)
+ || guac_socket_write_string(socket, ";");
+
+ guac_socket_instruction_end(socket);
+ return ret_val;
+
+}
+
int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer,
int x, int y, int radius, double startAngle, double endAngle,
int negative) {