[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] add docstrings to libsvn_ra_neon's 207 XML parser

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 20 Aug 2010 18:35:43 +0300

I arrived at these docstrings by reverse-engineering the implementation
and some guesses. Could someone confirm my understanding?

[[[
* subversion/libsvn_ra_neon/util.c
  (multistatus_elements, multistatus_nesting_table, validate_element):
    Add docstrings.
]]]

[[[
Index: subversion/libsvn_ra_neon/util.c
===================================================================
--- subversion/libsvn_ra_neon/util.c (revision 987515)
+++ subversion/libsvn_ra_neon/util.c (working copy)
@@ -82,6 +82,7 @@
  * for our custom error parser - could use the ne_basic.h interfaces.
  */
 
+/* List of XML elements expected in 207 Multi-Status responses. */
 static const svn_ra_neon__xml_elm_t multistatus_elements[] =
   { { "DAV:", "multistatus", ELEM_multistatus, 0 },
     { "DAV:", "response", ELEM_response, 0 },
@@ -99,6 +100,14 @@
   };
 
 
+/* Sparse matrix listing the permitted child elements of each element.
+
+ The permitted direct children of the element named in the first column are
+ the elements named in the remainder of the row.
+
+ There may be any number of rows, and any number of columns in each row; any
+ non-positive value (such as SVN_RA_NEON__XML_INVALID) serves as a sentinel.
+ */
 static const int multistatus_nesting_table[][5] =
   { { ELEM_root, ELEM_multistatus, SVN_RA_NEON__XML_INVALID },
     { ELEM_multistatus, ELEM_response, ELEM_responsedescription,
@@ -115,6 +124,9 @@
   };
 
 
+/* PARENT and CHILD are enum values of ELEM_* type.
+ Return a positive integer if CHILD is a valid direct child of PARENT,
+ and a negative integer otherwise. */
 static int
 validate_element(int parent, int child)
 {
]]]
Received on 2010-08-20 17:38:42 CEST

This is an archived mail posted to the Subversion Dev mailing list.