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_util/index.html

Module OBus_utilSource

This module contain various functions used by both the library and the tools

Sourceval assoc : 'a -> ('a * 'b) list -> 'b option

Same as List.assoc but return an option

Sourceval assq : 'a -> ('a * 'b) list -> 'b option

Same as List.assq but return an option

Sourceval find_map : ('a -> 'b option) -> 'a list -> 'b option

find_map f l Apply f on each element of l until it return Some x and return that result or return None

Sourceval filter_map : ('a -> 'b option) -> 'a list -> 'b list

filter_map f l apply f on each element of l and return the list ef element for which f succeed (i.e. return Some x)

Sourceval part_map : ('a -> 'b option) -> 'a list -> 'b list * 'a list

part_map f l apply f on each element of l and return the list of success and the list of failure

Sourcetype ('a, 'b) either =
  1. | InL of 'a
  2. | InR of 'b
Sourceval split : ('a -> ('b, 'c) either) -> 'a list -> 'b list * 'c list

Split a list

Sourceval map_option : 'a option -> ('a -> 'b) -> 'b option
Sourceval sha_1 : string -> string

Compute the sha1 of a string

Sourceval hex_encode : string -> string
Sourceval hex_decode : string -> string

A hex-encoded string is a string where each character is replaced by two hexadecimal characters which represent his ascii code

Sourceval homedir : string Lwt.t Lazy.t

The home directory

Random number generation

All the following functions try to generate random numbers using /dev/urandom and can fallback to pseudo-random generator

Sourceval fill_random : bytes -> int -> int -> unit

fill_random str ofs len Fill the given string from ofs to ofs+len-1 with random bytes.

Sourceval random_string : int -> string
Sourceval random_int : unit -> int
Sourceval random_int32 : unit -> int32
Sourceval random_int64 : unit -> int64
OCaml

Innovation. Community. Security.