Comments
Patch
@@ -1252,6 +1252,26 @@
return get_output_data(handle);
}
+/* The high level help command for hglib API. */
+hg_linestream_buffer *hg_showconfig(hg_handle *handle, int (*callback)
+ (const char *msg, size_t len), char *argument[])
+{
+ hg_linestream_buffer *lbuf = malloc(sizeof(hg_csetstream_buffer));
+ lbuf->handle = handle;
+
+ lbuf->command = cmdbuilder("showconfig", argument, NULL);
+
+ if(hg_rawcommand(handle, lbuf->command) < 0){
+ return NULL;
+ }
+
+ lbuf->callback = callback;
+ lbuf->buffer = NULL;
+ lbuf->buf_size = 0;
+
+ return lbuf;
+}
+
/* The yield next step. Getting the next entry. */
int hg_fetch_entry(hg_stream_buffer *stream, int (*detect_byte)(char *buff,
int buf_size, int data_on_pipe), int func_type)
@@ -1906,6 +1906,42 @@
char *hg_root(hg_handle *handle, int(*callback)(const char *msg, size_t len));
/**
+ * \brief hg_showconfig command for hglib API.
+ *
+ * With no arguments, print names and values of all config items.
+ *
+ * With one argument of the form section.name, print just the value of that
+ * config item.
+ *
+ * With multiple arguments, print names and values of all config items with
+ * matching section names.
+ *
+ * With --debug, the source (filename and line number) is printed for each
+ * config item.
+ *
+ * Options/Argument list option:
+ *
+ * -u, --untrusted show untrusted configuration options
+ * aliases: debugconfigi
+ *
+ * To get showconfig information use the hg_linestream_buffer returned value
+ * with hg_fetch_line_entry() function.
+ *
+ * \param handle The handle of the connection, wherewith I want to communicate
+ * \param callback A function that will handle error data.
+ * A NULL pointer will ignore error data.
+ * \param argument The option list. Will contain all option that you wish.
+ * \retval hg_linestream_buffer A pointer to hg_linestream_buffer structure if
+ * successful
+ * \retval NULL to indicate an error, with errno set appropriately.
+ *
+ * errno can be:
+ * - hg_rawcommand errors
+ * */
+hg_linestream_buffer *hg_showconfig(hg_handle *handle, int (*callback)
+ (const char *msg, size_t len), char *argument[]);
+
+/**
* \brief The yield mechanism that will get the next entry.
*
* This function is used inside of hg_fetch_cset_entry() and hg_fetch_line_entry()