Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# $OpenBSD$ | ||
|
||
COMMENT= OCaml library to generate binary protocols | ||
CATEGORIES= net | ||
|
||
V= 2.0.3 | ||
DISTNAME= bin-prot-${V} | ||
MASTER_SITES= http://www.janestreet.com/ocaml/ | ||
|
||
MAINTAINER= Anil Madhavapeddy <avsm@openbsd.org> | ||
HOMEPAGE= http://ocaml.janestreet.com/?q=node/13 | ||
|
||
# LGPL+linking exception | ||
PERMIT_PACKAGE_FTP= Yes | ||
PERMIT_PACKAGE_CDROM= Yes | ||
PERMIT_DISTFILES_FTP= Yes | ||
PERMIT_DISTFILES_CDROM= Yes | ||
|
||
MODULES= lang/ocaml | ||
NO_REGRESS= Yes | ||
CONFIGURE_STYLE=simple | ||
USE_GMAKE= Yes | ||
NO_REGRESS= Yes | ||
|
||
BUILD_DEPENDS+= ${RUN_DEPENDS} | ||
RUN_DEPENDS+= sysutils/findlib devel/type-conv | ||
|
||
pre-install: | ||
${INSTALL_DATA_DIR} ${PREFIX}/lib/ocaml/site-lib/bin-prot | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MD5 (bin-prot-2.0.3.tar.gz) = lQq0vcp/W3Vw5NYhbv8jXQ== | ||
RMD160 (bin-prot-2.0.3.tar.gz) = /gIiGyDyuxdqKl5vKTyQZHD5Rc4= | ||
SHA1 (bin-prot-2.0.3.tar.gz) = V0Rza165NnYzxfwSTVMfbZ1m7l4= | ||
SHA256 (bin-prot-2.0.3.tar.gz) = 4wp/JerUAS93GSAbN869HQ/xqDnbW4THL/ofF1Mf7PU= | ||
SIZE (bin-prot-2.0.3.tar.gz) = 109427 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
$OpenBSD$ | ||
--- lib/common_stubs.h.orig Thu Sep 1 18:40:11 2011 | ||
+++ lib/common_stubs.h Wed Oct 26 22:34:21 2011 | ||
@@ -31,7 +31,6 @@ | ||
#include <sys/types.h> | ||
|
||
#include <string.h> | ||
-#include <arpa/inet.h> | ||
|
||
#include <caml/config.h> | ||
#include <caml/memory.h> | ||
@@ -47,6 +46,14 @@ | ||
#include "int64_emul.h" | ||
#endif | ||
|
||
+#if defined(__OpenBSD__) | ||
+#define le16toh(x) htole16(x) | ||
+#define le32toh(x) htole32(x) | ||
+#define le64toh(x) htole64(x) | ||
+#define be16toh(x) htobe16(x) | ||
+#define be32toh(x) htobe32(x) | ||
+#define be64toh(x) htobe64(x) | ||
+#endif /* defined(__OpenBSD__) */ | ||
|
||
|
||
/* Endianness- and alignment-independent integer marshalling functions */ | ||
@@ -63,13 +70,13 @@ | ||
#include <byteswap.h> | ||
#endif /* __linux__ */ | ||
|
||
-#if defined(__FreeBSD__) || defined(__NetBSD__) | ||
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) | ||
#include <sys/endian.h> | ||
#define __BYTE_ORDER_BYTE_ORDER | ||
#define bswap_16 bswap16 | ||
#define bswap_32 bswap32 | ||
#define bswap_64 bswap64 | ||
-#endif /* defined(__FreeBSD__) || defined(__NetBSD__) */ | ||
+#endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ | ||
|
||
|
||
#if _BYTE_ORDER == _LITTLE_ENDIAN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
This library contains functionality for reading and writing | ||
OCaml-values in a type-safe binary protocol. It is extremely | ||
efficient, typically supporting type-safe marshalling and unmarshalling | ||
of even highly structured values at speeds sufficient to saturate | ||
a gigabit connection. The protocol is also heavily optimized for | ||
size, making it ideal for long-term storage of large amounts of | ||
data. | ||
|
||
The library is highly dependable and safe to use: a rigorous test | ||
suite has to date guaranteed that this library has never exhibited | ||
a bug in production systems in several years of use. "Bin_prot" has | ||
been successfully employed in mission-critical financial applications, | ||
storing many terabytes of structured data derived from thousands | ||
of type definitions, and typically processing millions of messages | ||
a day in realtime for low-latency applications that must not crash. | ||
|
||
Since version two this library should work with all CPU architectures | ||
currently supported by OCaml, no matter the word size (32 or 64 | ||
bit), endianness (2), or alignment requirements. It provides users | ||
with a convenient and safe way of performing I/O on any extensionally | ||
defined OCaml type (see later sections for details). Functions, | ||
objects, first-class modules, as well as values whose type is bound | ||
through a polymorphic record field are hence not supported. This | ||
is hardly ever a limitation in practice. | ||
|
||
As of now, there is no support for cyclic or shared values. Cyclic | ||
values will lead to non-termination whereas shared values, besides | ||
requiring more space when encoded, may lead to a substantial increase | ||
in memory footprint when they are read back. It would not be trivial | ||
to support these kinds of values in a type-safe way without noticably | ||
sacrificing performance. If these kinds of values are needed, the | ||
user may want to use the as of today still unsafe marshalling | ||
functions provided by OCaml. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@comment $OpenBSD$ | ||
lib/ocaml/site-lib/bin_prot/bin_prot.a | ||
lib/ocaml/site-lib/bin_prot/bin_prot.cmxa | ||
lib/ocaml/site-lib/bin_prot/pa_bin_prot.a | ||
lib/ocaml/site-lib/bin_prot/pa_bin_prot.cmxa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@comment $OpenBSD$ | ||
lib/ocaml/site-lib/bin_prot/dllbin_prot.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@comment $OpenBSD$ | ||
%%SHARED%% | ||
lib/ocaml/site-lib/bin-prot/ | ||
lib/ocaml/site-lib/bin_prot/ | ||
lib/ocaml/site-lib/bin_prot/META | ||
lib/ocaml/site-lib/bin_prot/bin_prot.cma | ||
lib/ocaml/site-lib/bin_prot/bin_prot.cmi | ||
lib/ocaml/site-lib/bin_prot/libbin_prot.a | ||
lib/ocaml/site-lib/bin_prot/pa_bin_prot.cma | ||
lib/ocaml/site-lib/bin_prot/pa_bin_prot.cmi | ||
lib/ocaml/site-lib/bin_prot/pa_bin_prot.mli |