X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=generator-lib%2Fwrappi_utils.ml;h=958c55e748756316efbb38c9a78f00d7e97b432e;hb=0571e7d0a290a9c3e0f3880363d0f2dbe93fc616;hp=89cc662a638d09afc4d5ccf28ce66f71d1d611e5;hpb=ff4a39eec0c3d92b7fda62341e0734e07d5d2987;p=wrappi.git diff --git a/generator-lib/wrappi_utils.ml b/generator-lib/wrappi_utils.ml index 89cc662..958c55e 100644 --- a/generator-lib/wrappi_utils.ml +++ b/generator-lib/wrappi_utils.ml @@ -20,6 +20,13 @@ open Printf let failwithf fs = ksprintf failwith fs +let isspace c = + c = ' ' + (* || c = '\f' *) || c = '\n' || c = '\r' || c = '\t' (* || c = '\v' *) + +let isalnum c = + (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') + let files_equal n1 n2 = let cmd = sprintf "cmp -s %s %s" (Filename.quote n1) (Filename.quote n2) in match Sys.command cmd with @@ -33,3 +40,5 @@ let count_chars c str = if c = String.unsafe_get str i then incr count done; !count + +module StringMap = Map.Make (String)