Enable syntax highlighting of code blocks (mostly ABNF)
Change-Id: Iaaf02dc02cc232518421fa3591004d2bb5939440
diff --git a/name.rst b/name.rst
index a7f0fca..96a1c23 100644
--- a/name.rst
+++ b/name.rst
@@ -141,13 +141,15 @@
If one name is a proper prefix of the other, then it comes first.
.. note::
- The canonical order can be enforced by directly comparing the wire encoding of the ``Name`` field's TLV-VALUE (i.e., excluding TLV-TYPE and TLV-LEGNTH of the whole Name TLV)::
+ The canonical order can be enforced by directly comparing the wire encoding of the ``Name`` field's TLV-VALUE (i.e., excluding TLV-TYPE and TLV-LENGTH of the Name element itself):
- int
- canonicalOrder(Name lhs, Name rhs) {
- int result = memcmp(lhs.value(), rhs.value(), min(lhs.value_size(), rhs.value_size()));
- if (result == 0) {
- result = lhs.value_size() - rhs.value_size();
- }
- return result;
- }
+ .. code-block:: c
+
+ int canonicalOrder(Name lhs, Name rhs)
+ {
+ int result = memcmp(lhs.value(), rhs.value(), min(lhs.value_size(), rhs.value_size()));
+ if (result == 0) {
+ result = lhs.value_size() - rhs.value_size();
+ }
+ return result;
+ }