More implementation.
[wrappi.git] / generator-lib / wrappi_utils.ml
index 89cc662..958c55e 100644 (file)
@@ -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)