From 004f57e19a42ddf5b14f355835302b8042a16afb Mon Sep 17 00:00:00 2001 From: Yaroslav Nikonorov Date: Wed, 18 Nov 2020 15:30:34 +0200 Subject: [PATCH] GUACAMOLE-1174: Add prototype and docstrings for guac_kubernetes_append_endpoint_param function. --- src/protocols/kubernetes/url.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/protocols/kubernetes/url.h b/src/protocols/kubernetes/url.h index 4d5e92e0..96e50982 100644 --- a/src/protocols/kubernetes/url.h +++ b/src/protocols/kubernetes/url.h @@ -49,6 +49,31 @@ int guac_kubernetes_escape_url_component(char* output, int length, const char* str); +/** + * Append the parameter to the endpoint path. + * Value within the path will be URL-escaped as necessary. + * + * @param buffer + * The buffer which should receive the parameter. It could contain the endpoint path. + * The parameter will be written to the end of the buffer. + * + * @param length + * The number of bytes available in the given buffer. + * + * @param param_name + * The name of the parameter. + * + * @param param_value + * The value of the parameter. + * + * @return + * Zero if the parameter was successfully attached to the buffer, + * non-zero if insufficient space exists within the buffer or + * buffer not null terminated. + */ +int guac_kubernetes_append_endpoint_param(char* buffer, int length, + const char* param_name, const char* param_value); + /** * Generates the full path to the Kubernetes API endpoint which handles * attaching to running containers within specific pods. Values within the path