X-Git-Url: http://git.annexia.org/?p=virt-top.git;a=blobdiff_plain;f=src%2Futils.ml;h=4332ff7466c6ad6bd1eee347274e846c27333e3a;hp=5fcc905beba940f0605e91072faddfb00a474024;hb=c513d05fd4e85953701b1023bef71af62613cf79;hpb=4f3794d5718249238a74b614a6b486465bc4315d diff --git a/src/utils.ml b/src/utils.ml index 5fcc905..4332ff7 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -32,6 +32,12 @@ let (/^) = Int64.div (* failwithf is a printf-like version of failwith. *) let failwithf fs = ksprintf failwith fs +let rec range a b = + if a <= b then + a :: range (a+1) b + else + [] + (* Input a whole file as a list of lines. *) let input_all_lines chan = let lines = ref [] in