Skip to content

Commit

Permalink
mark add_len / set_len as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Apr 9, 2019
1 parent db9be7d commit ba7de91
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/cstruct.mli
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,8 @@ val blit_to_bytes: t -> int -> bytes -> int -> int -> unit
a valid substring of [dst]. *)

val blit_to_string: t -> int -> bytes -> int -> int -> unit
(** [blit_to_string] is a deprecated alias of {!blit_to_bytes}.
@deprecated This is a deprecated alias of {!blit_to_bytes}. *)
[@@ocaml.deprecated "Use blit_to_bytes instead, blit_to_string will be removed in cstruct 5.0.0"]
(** [blit_to_string] is a deprecated alias of {!blit_to_bytes}. *)

val memset: t -> int -> unit
(** [memset t x] sets all the bytes of [t] to [x land 0xff]. *)
Expand All @@ -333,11 +332,13 @@ val len: t -> int
buffer, as the [sub] or [set_len] functions can construct a smaller view. *)

val set_len : t -> int -> t
[@@ocaml.deprecated "This function will be removed in cstruct 5.0.0. If you need this function, discuss other ways in the issue tracker https://github.com/mirage/ocaml-cstruct."]
(** [set_len t len] sets the length of the cstruct [t] to a new absolute
value, and returns a fresh cstruct with these settings.
@raise Invalid_argument if [len] exceeds the size of the buffer. *)

val add_len : t -> int -> t
[@@ocaml.deprecated "This function will be removed in cstruct 5.0.0. If you need this function, discuss other ways in the issue tracker https://github.com/mirage/ocaml-cstruct."]
(** [add_len t l] will add [l] bytes to the length of the buffer, and return
a fresh cstruct with these settings.
@raise Invalid_argument if [len] exceeds the size of the buffer. *)
Expand Down Expand Up @@ -371,7 +372,7 @@ val hexdump_to_buffer: Buffer.t -> t -> unit

val hexdump_pp: Format.formatter -> t -> unit
(** [hexdump_pp f c] pretty-prints a hexdump of [c] to [f]. *)

val debug: t -> string
(** [debug t] will print out the internal details of a cstruct such
as its base offset and the length, and raise an assertion failure
Expand Down

0 comments on commit ba7de91

Please sign in to comment.