Using PCRE to check regexps passed to Apache
[clinton/domtool2.git] / pcre / smlnj / libpcre-h.sml
diff --git a/pcre/smlnj/libpcre-h.sml b/pcre/smlnj/libpcre-h.sml
new file mode 100644 (file)
index 0000000..356df39
--- /dev/null
@@ -0,0 +1,13 @@
+structure LibpcreH = struct
+    local
+        val lh = DynLinkage.open_lib
+             { name = "/usr/local/lib/pcre_sml.so", global = true, lazy = true }
+           handle DynLinkage.DynLinkError s => raise Fail s
+    in
+        fun libh s = let
+            val sh = DynLinkage.lib_symbol (lh, s)
+        in
+            fn () => DynLinkage.addr sh
+        end
+    end
+end