package dns-client

  1. Overview
  2. Docs
DNS client API

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dns-10.2.2.tbz
sha256=5123d7167f5fb3a5ab70cf0b3ccc965089ec440dc07edeabf8c0568ee737a7f0
sha512=4e5945435f280591c158ab03fec19dc0c807fb713d6ee68873939899c49175f39af1fbcd135517514a3ab088993356a4c303f7dce5e18d403d4630a33bad9076

doc/src/dns-client.resolvconf/dns_resolvconf.ml.html

Source file dns_resolvconf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
let parse buf =
  try
    Resolvconf_state.reset ();
    let buf =
      if String.(get buf (pred (length buf))) = '\n' then buf else buf ^ "\n"
    in
    let lexbuf = Lexing.from_string buf in
    Ok (Resolvconf_parser.resolvconf Resolvconf_lexer.lex lexbuf)
  with
  | Parsing.Parse_error ->
    Error (`Msg (Fmt.str "parse error at line %d" Resolvconf_state.(state.lineno)))
  | exn ->
    Error (`Msg (Fmt.str "error at line %d: %s" Resolvconf_state.(state.lineno)
                   (Printexc.to_string exn)))