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

login
register
mail settings
Submitter Iulian Stana
Date Sept. 3, 2013, 8:30 p.m.
Message ID <d3cc7fddee1bdaef3a6e.1378240251@doppler>
Download mbox | patch
Permalink /patch/2316/
State Deferred, archived
Headers show

Comments

Iulian Stana - Sept. 3, 2013, 8:30 p.m.
# HG changeset patch
# User Iulian Stana <julian.stana@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

Patch

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