]> gitweb.factorcode.org Git - factor.git/blob - basis/ip-parser/ip-parser-docs.factor
Reformat
[factor.git] / basis / ip-parser / ip-parser-docs.factor
1 USING: byte-arrays help.markup help.syntax strings ;
2 IN: ip-parser
3
4 HELP: parse-ipv4
5 { $values { "str" string } { "byte-array" byte-array } }
6 { $description "Parses an IP string that may not have all four address components specified, following these rules:" $nl
7     { $table
8         { { $snippet "A" } { $snippet "0.0.0.A" } }
9         { { $snippet "A.D" } { $snippet "A.0.0.D" } }
10         { { $snippet "A.B.D" } { $snippet "A.B.0.D" } }
11         { { $snippet "A.B.C.D" } { $snippet "A.B.C.D" } }
12     }
13     $nl
14     "In addition, this supports components specified as decimal, octal, hexadecimal, and mixed representations, as well as components specified larger than 255 by carry propagation."
15 } ;
16
17 HELP: normalize-ipv4
18 { $values { "str" string } { "newstr" string } }
19 { $description "Normalizes an IP string that may not have all four address components specified, using the rules implemented by " { $link parse-ipv4 } "."
20 } ;