git » nmdb » commit 0ea4501

Implement nmdb_add_sctp_server() in D bindings.

author Alberto Bertogli
2007-09-01 19:22:15 UTC
committer Alberto Bertogli
2007-09-01 19:22:15 UTC
parent e5cf22b47b349fb700c5caf7be1b350c1b524cf4

Implement nmdb_add_sctp_server() in D bindings.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

bindings/d/nmdb.d +8 -0
bindings/d/nmdb_ll.d +1 -0

diff --git a/bindings/d/nmdb.d b/bindings/d/nmdb.d
index 4c7d85f..e38b130 100644
--- a/bindings/d/nmdb.d
+++ b/bindings/d/nmdb.d
@@ -67,6 +67,14 @@ class DB
 		}
 	}
 
+	void add_sctp_server(char[] addr, int port = -1)
+	{
+		int r = nmdb_add_sctp_server(db, cast(ubyte *) addr.ptr, port);
+		if (r == 0) {
+			throw new Exception("Can't add server");
+		}
+	}
+
 	private char[] do_get(char[] key, int mode)
 	{
 		ptrdiff_t size;
diff --git a/bindings/d/nmdb_ll.d b/bindings/d/nmdb_ll.d
index 6fc3852..da1fcc9 100644
--- a/bindings/d/nmdb_ll.d
+++ b/bindings/d/nmdb_ll.d
@@ -40,6 +40,7 @@ extern (C) nmdb_t *nmdb_init();
 extern (C) int nmdb_add_tipc_server(nmdb_t *db, int port);
 extern (C) int nmdb_add_tcp_server(nmdb_t *db, ubyte *addr, int port);
 extern (C) int nmdb_add_udp_server(nmdb_t *db, ubyte *addr, int port);
+extern (C) int nmdb_add_sctp_server(nmdb_t *db, ubyte *addr, int port);
 extern (C) int nmdb_free(nmdb_t *db);
 
 extern (C) ptrdiff_t nmdb_get(nmdb_t *db, ubyte *key, size_t ksize,