summaryrefslogtreecommitdiff
path: root/src/util.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-03-14 11:50:53 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-03-14 11:50:53 -0500
commit317635a6fbe01698fdf71ddef952b7bbb2076d64 (patch)
tree6e32a7a8edd3a1586c997096cefa20fff81ed31c /src/util.ml
parentfd8bdc522481e2562c714601fc85298ce13b3de1 (diff)
downloadvyos1x-config-317635a6fbe01698fdf71ddef952b7bbb2076d64.tar.gz
vyos1x-config-317635a6fbe01698fdf71ddef952b7bbb2076d64.zip
T5088: add lexical_numeric_compare function
Diffstat (limited to 'src/util.ml')
-rw-r--r--src/util.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.ml b/src/util.ml
index 10e7a25..bb30645 100644
--- a/src/util.ml
+++ b/src/util.ml
@@ -1,5 +1,7 @@
exception Syntax_error of ((int * int) option * string)
+external lex_numeric_compare: string -> string -> int = "caml_lex_numeric_compare"
+
external length : string -> int = "%string_length"
external unsafe_get : string -> int -> char = "%string_unsafe_get"
@@ -29,3 +31,6 @@ let default default_value opt =
match opt with
| None -> default_value
| Some value -> value
+
+let lexical_numeric_compare s t =
+ lex_numeric_compare s t