Skip to content

Commit 12694ca

Browse files
committed
commit vendored code
1 parent 315db5a commit 12694ca

37 files changed

+3114
-10
lines changed

castor.opam

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ bug-reports: "https://github.com/jfeser/castor/issues"
99
depends: [
1010
"dune" {>= "3.1" & >= "1.10"}
1111
"menhir" {build}
12+
"dune-site"
1213
"core" {>= "v0.12"}
14+
"core_unix"
15+
"combinat"
16+
"ocamlgraph"
17+
"iter"
18+
"cmph"
1319
"postgresql" {>= "4.4"}
1420
"bos" {>= "0.2"}
1521
"logs" {>= "0.6"}
16-
"llvm"
17-
"cmph"
18-
"genhash"
1922
"hashcons" {>= "1.3"}
2023
"lwt" {>= "4.2.1"}
2124
"lwt_ppx" {>= "1.2.2"}

castor_test.opam

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ depends: [
1212
"postgresql" {>= "4.4"}
1313
"bos" {>= "0.2"}
1414
"logs" {>= "0.6"}
15-
"cmph"
16-
"genhash"
15+
"sexp_diff"
1716
"hashcons" {>= "1.3"}
1817
"lwt" {>= "4.2.1"}
1918
"lwt_ppx" {>= "1.2.2"}

cmph.opam

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This file is generated by dune, edit dune-project instead
2+
opam-version: "2.0"
3+
synopsis: "OCaml wrapper for the C Minimal Perfect Hashing library"
4+
description: """
5+
ocaml-cmph is a wrapper library for the C Minimal Perfect Hashing (CMPH)
6+
library. CMPH contains algorithms for generating perfect hashes. ocaml-cmph
7+
exposes a high level interface to these hash generators.
8+
"""
9+
maintainer: ["Jack Feser <[email protected]>"]
10+
authors: ["Jack Feser <[email protected]>"]
11+
license: "MIT"
12+
homepage: "https://github.com/jfeser/castor"
13+
bug-reports: "https://github.com/jfeser/castor/issues"
14+
depends: [
15+
"dune" {>= "3.1" & build & >= "1.10"}
16+
"ounit" {with_test & >= "2.0"}
17+
"ctypes" {>= "0.14"}
18+
"ctypes-foreign" {>= "0.4"}
19+
"core" {>= "v0.12"}
20+
"ppx_sexp_conv" {>= "v0.12"}
21+
"odoc" {with-doc}
22+
]
23+
build: [
24+
["dune" "subst"] {dev}
25+
[
26+
"dune"
27+
"build"
28+
"-p"
29+
name
30+
"-j"
31+
jobs
32+
"--promote-install-files=false"
33+
"@install"
34+
"@runtest" {with-test}
35+
"@doc" {with-doc}
36+
]
37+
["dune" "install" "-p" name "--create-install-files" name]
38+
]
39+
dev-repo: "git+https://github.com/jfeser/castor.git"

cmph/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_build
2+
*.merlin
3+
*.install

cmph/.ocamlformat

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
margin = 85
2+
break-cases=fit

cmph/CHANGES.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## 0.2 (2019-07-23)
2+
3+
Implement a custom io adapter, which should make communicating with CMPH much
4+
more reliable.
5+
6+
## 0.1.2 (2019-02-12)
7+
8+
Update to dune 1.7 and clean up dependencies.
9+
10+
## 0.1.1 (2018-12-11)
11+
12+
Fix bug where C memory was released prematurely.
13+
14+
## 0.1.0 (2018-10-26)
15+
16+
Initial release.
17+

cmph/LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2017 John Feser
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cmph/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# ocaml-cmph
2+
Ocaml bindings for C Minimal Perfect Hashing Library ([CMPH](http://cmph.sourceforge.net/))
3+
4+
[Online documentation](https://jfeser.github.io/ocaml-cmph/cmph/index.html)
5+
6+
# Usage
7+
8+
```ocaml
9+
open Printf
10+
open Cmph
11+
12+
let () =
13+
let keys = [
14+
"aaaaaaaaaa"; "bbbbbbbbbb"; "cccccccccc"; "dddddddddd"; "eeeeeeeeee";
15+
"ffffffffff"; "gggggggggg"; "hhhhhhhhhh"; "iiiiiiiiii"; "jjjjjjjjjj"
16+
] in
17+
let keyset = KeySet.of_list keys in
18+
let config = Config.create keyset in
19+
let hash = Hash.create config in
20+
List.iter (fun k -> eprintf "key:%s -- hash:%d\n" k (Hash.hash hash k)) keys
21+
```
22+
23+
Outputs:
24+
```
25+
key:aaaaaaaaaa -- hash:0
26+
key:bbbbbbbbbb -- hash:1
27+
key:cccccccccc -- hash:2
28+
key:dddddddddd -- hash:3
29+
key:eeeeeeeeee -- hash:4
30+
key:ffffffffff -- hash:5
31+
key:gggggggggg -- hash:6
32+
key:hhhhhhhhhh -- hash:7
33+
key:iiiiiiiiii -- hash:8
34+
key:jjjjjjjjjj -- hash:9
35+
```

cmph/cmph.opam

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file is generated by dune, edit dune-project instead
2+
opam-version: "2.0"
3+
build: [
4+
["dune" "subst"] {pinned}
5+
["dune" "build" "-p" name "-j" jobs]
6+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
7+
["dune" "build" "-p" name "@doc"] {with-doc}
8+
]
9+
maintainer: ["Jack Feser <[email protected]>"]
10+
authors: ["Jack Feser <[email protected]>"]
11+
bug-reports: "https://github.com/jfeser/ocaml-cmph/issues"
12+
homepage: "https://github.com/jfeser/ocaml-cmph"
13+
doc: "https://jfeser.github.io/ocaml-cmph/"
14+
license: "MIT"
15+
dev-repo: "git+https://github.com/jfeser/ocaml-cmph.git"
16+
synopsis: "OCaml wrapper for the C Minimal Perfect Hashing library"
17+
description: """
18+
ocaml-cmph is a wrapper library for the C Minimal Perfect Hashing (CMPH)
19+
library. CMPH contains algorithms for generating perfect hashes. ocaml-cmph
20+
exposes a high level interface to these hash generators.
21+
"""
22+
depends: [
23+
"dune" {build & >= "1.10"}
24+
"ounit" {with_test & >= "2.0"}
25+
"ctypes" {>= "0.14"}
26+
"ctypes-foreign" {>= "0.4"}
27+
"core" {>= "v0.12"}
28+
"ppx_sexp_conv" {>= "v0.12"}
29+
]

0 commit comments

Comments
 (0)