parse-options ( resolv.conf string -- resolv.conf )


Vocabulary
resolv-conf.private

Inputs
resolv.confan object
stringan object


Outputs
resolv.confan object


Definition


: parse-options ( resolv.conf string -- resolv.conf )
[ dup options>> ] dip trim-blanks split-words [
{
{ [ dup "debug" = ] [ drop t >>debug? ] }
{ [ "ndots" ?head ] [ parse-integer >>ndots ] }
{ [ "timeout" ?head ] [ parse-integer >>timeout ] }
{
[ "attempts" ?head ]
[ parse-integer >>attempts ]
}
{ [ dup "rotate" = ] [ drop t >>rotate? ] }
{
[ dup "no-check-names" = ]
[ drop t >>no-check-names? ]
}
{ [ dup "inet6" = ] [ drop t >>inet6? ] }
{ [ dup "ip6-bytestring" = ] [ drop ] }
{ [ dup "ip6-dotint" = ] [ drop ] }
{ [ dup "no-ip6-dotint" = ] [ drop ] }
{ [ dup "edns0" = ] [ drop t >>edns0? ] }
{ [ dup "single-request" = ] [ drop ] }
{ [ dup "single-request-reopen" = ] [ drop ] }
{ [ dup "no-tld-query" = ] [ drop ] }
{ [ dup "use-vc" = ] [ drop ] }
{ [ dup "no-reload" = ] [ drop ] }
{ [ dup "trust-ad" = ] [ drop ] }
[ unsupported-resolv.conf-option ]
} cond drop
] with each ;