summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-07-20 12:05:44 -0400
committerNick Mathewson <nickm@torproject.org>2015-07-20 12:05:44 -0400
commit7521c3ee91a8c52cc152de6fa8b4c88b44fc3e33 (patch)
tree598911621af58bf3d057fbe4d8efd7468f94202c /src/common/util.c
parent0a329a7a05199d3d0ec21e072f91a2213b8fc7b8 (diff)
downloadtor-7521c3ee91a8c52cc152de6fa8b4c88b44fc3e33.tar.gz
tor-7521c3ee91a8c52cc152de6fa8b4c88b44fc3e33.zip
Document the torrc format as thoroughly as possible
Closes ticket 2325
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/src/common/util.c b/src/common/util.c
index a5b5488b0a..618e6a1b6a 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2829,38 +2829,9 @@ parse_config_line_from_str_verbose(const char *line, char **key_out,
char **value_out,
const char **err_out)
{
- /* I believe the file format here is supposed to be:
- FILE = (EMPTYLINE | LINE)* (EMPTYLASTLINE | LASTLINE)?
-
- EMPTYLASTLINE = SPACE* | COMMENT
- EMPTYLINE = EMPTYLASTLINE NL
- SPACE = ' ' | '\r' | '\t'
- COMMENT = '#' NOT-NL*
- NOT-NL = Any character except '\n'
- NL = '\n'
-
- LASTLINE = SPACE* KEY SPACE* VALUES
- LINE = LASTLINE NL
- KEY = KEYCHAR+
- KEYCHAR = Any character except ' ', '\r', '\n', '\t', '#', "\"
-
- VALUES = QUOTEDVALUE | NORMALVALUE
- QUOTEDVALUE = QUOTE QVCHAR* QUOTE EOLSPACE?
- QUOTE = '"'
- QVCHAR = KEYCHAR | ESC ('n' | 't' | 'r' | '"' | ESC |'\'' | OCTAL | HEX)
- ESC = "\\"
- OCTAL = ODIGIT (ODIGIT ODIGIT?)?
- HEX = ('x' | 'X') HEXDIGIT HEXDIGIT
- ODIGIT = '0' .. '7'
- HEXDIGIT = '0'..'9' | 'a' .. 'f' | 'A' .. 'F'
- EOLSPACE = SPACE* COMMENT?
-
- NORMALVALUE = (VALCHAR | ESC ESC_IGNORE | CONTINUATION)* EOLSPACE?
- VALCHAR = Any character except ESC, '#', and '\n'
- ESC_IGNORE = Any character except '#' or '\n'
- CONTINUATION = ESC NL ( COMMENT NL )*
+ /*
+ See torrc_format.txt for a description of the (silly) format this parses.
*/
-
const char *key, *val, *cp;
int continuation = 0;