Reorganize code and document functions

This commit is contained in:
Guillaume 2026-03-13 23:27:28 +01:00
parent 96b3fc6c52
commit 5752995272
9 changed files with 93 additions and 41 deletions

24
lib/state.mli Normal file
View file

@ -0,0 +1,24 @@
type t
(** Log navigation state.
A [t] represents a loaded log file and a cursor pointing to the currently
active line. *)
val create : string -> t
(** [create file] loads the log file into memory and initializes the cursor at
the first line. *)
val show_line : t -> string
(** [show_line s] returns the line currently pointed to by the cursor. *)
val next : t -> t
(** [next s] moves the cursor to the next line if possible. *)
val prev : t -> t
(** [prev s] moves the cursor to the previous line if possible. *)
val cursor : t -> int
(** Current cursor position. *)
val size : t -> int
(** Number of lines in the log. *)