package obus

  1. Overview
  2. Docs
Pure Ocaml implementation of the D-Bus protocol

Install

Dune Dependency

Authors

Maintainers

Sources

obus-1.2.5.tar.gz
md5=81eb1034c6ef4421a2368a9b352199de
sha512=4b540497188a7d78f4f14f94c6b7fdff47dd06436a34e650ff378dd77bb3e2acb7afd45cd72daf4ddba06e732e9944d560c2882dc37862f1b1f1bb6df37e6205

doc/obus.internals/OBus_string/index.html

Module OBus_stringSource

Restriction on strings used with D-Bus

There are a lot of restrictions for strings used in D-Bus. OBus only verifies strings when a message is sent or received

Sourcetype error = {
  1. typ : string;
    (*

    Type of string ("string", "bus name", "error name", "path", ...)

    *)
  2. str : string;
    (*

    The string which fail to validate

    *)
  3. ofs : int;
    (*

    is the position in bytes where the validation failed

    *)
  4. msg : string;
    (*

    explains why the string failed to validate

    *)
}
Sourceval error_message : error -> string

error_message error returns a human-readable error message

Error projections
Sourceval typ : error -> string
Sourceval str : error -> string
Sourceval ofs : error -> int
Sourceval msg : error -> string
Validators
Sourcetype validator = string -> error option

Tests if a string is correct.

  • if it is, returns None
  • if not, returns Some(ofs, msg)
Sourceexception Invalid_string of error
Sourceval assert_validate : validator -> string -> unit

Raises Invalid_string if the given string failed to validate

Common strings
Sourcetype t = string

Type for common strings, restrictions are:

  • a string must be encoded in valid UTF-8
  • a string must not contains the null byte
Sourceval validate : validator

Validation function for common strings

OCaml

Innovation. Community. Security.