[PATCH 12 of 14 RFC c-hglib:level0] hg_head: return the next header, for the next cmd server action

Iulian Stana julian.stana at gmail.com
Tue Sep 3 15:30:51 CDT 2013


# HG changeset patch
# User Iulian Stana <julian.stana at gmail.com>
# Date 1378237028 -10800
#      Tue Sep 03 22:37:08 2013 +0300
# Node ID d3cc7fddee1bdaef3a6e6b098688afb9140d35b8
# Parent  9fadfe4d06beabcf95a1f3a20a070431db795704
hg_head: return the next header, for the next cmd server action

diff --git a/client.c b/client.c
--- a/client.c
+++ b/client.c
@@ -355,3 +355,11 @@
 
 	return handle->current_header.channel;
 }
+
+/*
+ * The header for the next chunk of data.
+ * */
+hg_header hg_head(hg_handle *handle)
+{
+	return handle->next_header;
+}
diff --git a/client.h b/client.h
--- a/client.h
+++ b/client.h
@@ -168,4 +168,17 @@
  * */
 char hg_current_channel(hg_handle *handle);
 
+/**
+ * \brief Return the next header. For the next command server action.
+ *
+ * Sometimes, the user needs the entire header. This is a way to do that.
+ * \param handle The handle of the connection, wherewith I want to communicate
+ * \retval hg_header  the header stucture for the given handle.
+ * \retval NULL to indicate an error, with errno set appropriately.
+ *
+ * errno can be:
+ *      - EINVAL   - Invalid argument (handle it's set to a null pointer)
+ * */
+hg_header hg_head(hg_handle *handle);
+
 #endif


More information about the Mercurial-devel mailing list