mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
dib: Move 'isdigit' utility function to common code.
No change, just simple refactoring.
This commit is contained in:
@@ -76,9 +76,6 @@ let digit_prefix_compare a b =
|
||||
let split_prefix str =
|
||||
let len = String.length str in
|
||||
let digits =
|
||||
let isdigit = function
|
||||
| '0'..'9' -> true
|
||||
| _ -> false in
|
||||
try string_index_fn (fun x -> not (isdigit x)) str
|
||||
with Not_found -> len in
|
||||
match digits with
|
||||
|
||||
@@ -58,6 +58,10 @@ let le32_of_int i =
|
||||
String.unsafe_set s 3 (Char.unsafe_chr (Int64.to_int c3));
|
||||
s
|
||||
|
||||
let isdigit = function
|
||||
| '0'..'9' -> true
|
||||
| _ -> false
|
||||
|
||||
type wrap_break_t = WrapEOS | WrapSpace | WrapNL
|
||||
|
||||
let rec wrap ?(chan = stdout) ?(indent = 0) str =
|
||||
|
||||
@@ -32,6 +32,8 @@ val div_roundup64 : int64 -> int64 -> int64
|
||||
val int_of_le32 : string -> int64
|
||||
val le32_of_int : int64 -> string
|
||||
|
||||
val isdigit : char -> bool
|
||||
|
||||
val wrap : ?chan:out_channel -> ?indent:int -> string -> unit
|
||||
(** Wrap text. *)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user