diff options
Diffstat (limited to 'tools/ocaml/libs')
-rw-r--r-- | tools/ocaml/libs/xb/op.ml | 6 | ||||
-rw-r--r-- | tools/ocaml/libs/xb/xb.mli | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml index 1ce72da348..0ee866676f 100644 --- a/tools/ocaml/libs/xb/op.ml +++ b/tools/ocaml/libs/xb/op.ml @@ -19,8 +19,7 @@ type operation = Debug | Directory | Read | Getperms | Transaction_end | Introduce | Release | Getdomainpath | Write | Mkdir | Rm | Setperms | Watchevent | Error | Isintroduced | - Resume | Set_target - | Restrict + Resume | Set_target | Restrict | Invalid let operation_c_mapping = [| Debug; Directory; Read; Getperms; @@ -41,7 +40,7 @@ let array_search el a = let of_cval i = if i >= 0 && i < size then operation_c_mapping.(i) - else raise Not_found + else Invalid let to_cval op = array_search op operation_c_mapping @@ -69,3 +68,4 @@ let to_string ty = | Resume -> "RESUME" | Set_target -> "SET_TARGET" | Restrict -> "RESTRICT" + | Invalid -> "INVALID" diff --git a/tools/ocaml/libs/xb/xb.mli b/tools/ocaml/libs/xb/xb.mli index 1dde52db1e..58234aefed 100644 --- a/tools/ocaml/libs/xb/xb.mli +++ b/tools/ocaml/libs/xb/xb.mli @@ -23,6 +23,7 @@ module Op : | Resume | Set_target | Restrict + | Invalid (* Not a valid wire operation *) val operation_c_mapping : operation array val size : int val array_search : 'a -> 'a array -> int |