Wrap columnar tables in "clang-format off/on"

These tables have aligned comments, so we don't want clang-format to
mess with them.
This commit is contained in:
Nick Mathewson
2020-01-10 15:13:30 -05:00
parent 06a6130666
commit 99a5aecbc7
10 changed files with 32 additions and 0 deletions
+2
View File
@@ -14,6 +14,7 @@
#ifndef TOR_AUTHCERT_MEMBERS_H
#define TOR_AUTHCERT_MEMBERS_H
// clang-format off
#define AUTHCERT_MEMBERS \
T1("dir-key-certificate-version", K_DIR_KEY_CERTIFICATE_VERSION, \
GE(1), NO_OBJ ), \
@@ -25,5 +26,6 @@
T1("dir-key-certification", K_DIR_KEY_CERTIFICATION,\
NO_ARGS, NEED_OBJ),\
T01("dir-address", K_DIR_ADDRESS, GE(1), NO_OBJ)
// clang-format on
#endif /* !defined(TOR_AUTHCERT_MEMBERS_H) */
+2
View File
@@ -21,11 +21,13 @@
#include "feature/dirparse/authcert_members.h"
/** List of tokens recognized in V3 authority certificates. */
// clang-format off
static token_rule_t dir_key_certificate_table[] = {
AUTHCERT_MEMBERS,
T1("fingerprint", K_FINGERPRINT, CONCAT_ARGS, NO_OBJ ),
END_OF_TABLE
};
// clang-format on
/** Parse a key certificate from <b>s</b>; point <b>end-of-string</b> to
* the first character after the certificate. */
+2
View File
@@ -28,6 +28,7 @@
#include "feature/nodelist/microdesc_st.h"
/** List of tokens recognized in microdescriptors */
// clang-format off
static token_rule_t microdesc_token_table[] = {
T1_START("onion-key", K_ONION_KEY, NO_ARGS, NEED_KEY_1024),
T01("ntor-onion-key", K_ONION_KEY_NTOR, GE(1), NO_OBJ ),
@@ -39,6 +40,7 @@ static token_rule_t microdesc_token_table[] = {
A01("@last-listed", A_LAST_LISTED, CONCAT_ARGS, NO_OBJ ),
END_OF_TABLE
};
// clang-format on
/** Assuming that s starts with a microdesc, return the start of the
* *NEXT* one. Return NULL on "not found." */
+8
View File
@@ -43,6 +43,7 @@
/** List of tokens recognized in the body part of v3 networkstatus
* documents. */
// clang-format off
static token_rule_t rtrstatus_token_table[] = {
T01("p", K_P, CONCAT_ARGS, NO_OBJ ),
T1( "r", K_R, GE(7), NO_OBJ ),
@@ -56,8 +57,10 @@ static token_rule_t rtrstatus_token_table[] = {
T0N("opt", K_OPT, CONCAT_ARGS, OBJ_OK ),
END_OF_TABLE
};
// clang-format on
/** List of tokens recognized in V3 networkstatus votes. */
// clang-format off
static token_rule_t networkstatus_token_table[] = {
T1_START("network-status-version", K_NETWORK_STATUS_VERSION,
GE(1), NO_OBJ ),
@@ -98,8 +101,10 @@ static token_rule_t networkstatus_token_table[] = {
END_OF_TABLE
};
// clang-format on
/** List of tokens recognized in V3 networkstatus consensuses. */
// clang-format off
static token_rule_t networkstatus_consensus_token_table[] = {
T1_START("network-status-version", K_NETWORK_STATUS_VERSION,
GE(1), NO_OBJ ),
@@ -136,14 +141,17 @@ static token_rule_t networkstatus_consensus_token_table[] = {
END_OF_TABLE
};
// clang-format on
/** List of tokens recognized in the footer of v1 directory footers. */
// clang-format off
static token_rule_t networkstatus_vote_footer_token_table[] = {
T01("directory-footer", K_DIRECTORY_FOOTER, NO_ARGS, NO_OBJ ),
T01("bandwidth-weights", K_BW_WEIGHTS, ARGS, NO_OBJ ),
T( "directory-signature", K_DIRECTORY_SIGNATURE, GE(2), NEED_OBJ ),
END_OF_TABLE
};
// clang-format on
/** Try to find the start and end of the signed portion of a networkstatus
* document in <b>s</b>. On success, set <b>start_out</b> to the first
+4
View File
@@ -81,6 +81,7 @@
/****************************************************************************/
/** List of tokens recognized in router descriptors */
// clang-format off
const token_rule_t routerdesc_token_table[] = {
T0N("reject", K_REJECT, ARGS, NO_OBJ ),
T0N("accept", K_ACCEPT, ARGS, NO_OBJ ),
@@ -123,8 +124,10 @@ const token_rule_t routerdesc_token_table[] = {
END_OF_TABLE
};
// clang-format on
/** List of tokens recognized in extra-info documents. */
// clang-format off
static token_rule_t extrainfo_token_table[] = {
T1_END( "router-signature", K_ROUTER_SIGNATURE, NO_ARGS, NEED_OBJ ),
T1( "published", K_PUBLISHED, CONCAT_ARGS, NO_OBJ ),
@@ -162,6 +165,7 @@ static token_rule_t extrainfo_token_table[] = {
END_OF_TABLE
};
// clang-format on
#undef T