git » nmdb » commit 83d4fc1

Implement add_server() in D bindings.

author Alberto Bertogli
2007-04-04 14:24:32 UTC
committer Alberto Bertogli
2007-04-04 14:24:32 UTC
parent 97a51639bdeb46ef78b83655eefc4792750f0ce9

Implement add_server() in D bindings.

d/nmdb.d +7 -0

diff --git a/d/nmdb.d b/d/nmdb.d
index b734f7d..00ff1a3 100644
--- a/d/nmdb.d
+++ b/d/nmdb.d
@@ -38,6 +38,13 @@ class DB
 		nmdb_free(db);
 	}
 
+	void add_server(int port)
+	{
+		int r = nmdb_add_server(db, port);
+		if (r == 0) {
+			throw new Exception("Can't add server");
+		}
+	}
 
 	private char[] do_get(char[] key, int mode)
 	{