From 69b297c33a6e0fc65af94036e44343c3e8a5768b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Mon, 9 Jun 1997 20:37:59 +0200
Subject: [PATCH] It seems this file was lost.

Rev: src/modules/Yp/module.pmod.in:1.1
---
 .gitattributes                |  1 +
 src/modules/Yp/module.pmod.in | 68 +++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 src/modules/Yp/module.pmod.in

diff --git a/.gitattributes b/.gitattributes
index aff9894b05..f3c1fa71d0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -110,6 +110,7 @@ testfont binary
 /src/modules/Regexp/acconfig.h foreign_ident
 /src/modules/Ssleay/ssleay.c foreign_ident
 /src/modules/Yp/acconfig.h foreign_ident
+/src/modules/Yp/module.pmod.in foreign_ident
 /src/modules/_Crypto/StdCrypt.pike foreign_ident
 /src/modules/_Crypto/cbc.c foreign_ident
 /src/modules/_Crypto/crypto.c foreign_ident
diff --git a/src/modules/Yp/module.pmod.in b/src/modules/Yp/module.pmod.in
new file mode 100644
index 0000000000..ee26099199
--- /dev/null
+++ b/src/modules/Yp/module.pmod.in
@@ -0,0 +1,68 @@
+/*
+ * $Id: module.pmod.in,v 1.1 1997/06/09 18:37:59 grubba Exp $
+ *
+ * YP (NIS) Functionality for Pike
+ *
+ * Per Hedbor & Henrik Grubbström 1996-1997
+ */
+
+class YpDomain {
+  inherit @module@;
+};
+
+class YpMap {
+  object(YpDomain) domain;
+  string ypmap;
+
+  void create(string map,string|void d)
+  {
+    if (d) {
+      domain = YpDomain(d);
+    } else {
+      domain = YpDomain();
+    }
+    ypmap = map;
+    // Force an error if the map does not exist.
+    domain->match(ypmap, "foo");
+  }
+  string match(string key)
+  {
+    return(domain->match(ypmap, key));
+  }
+  string `[](string key)
+  {
+    return(match(key));
+  }
+  mapping all()
+  {
+    return(domain->all(ypmap));
+  }
+  mapping cast_to_mapping()
+  {
+    return(domain->all(ypmap));
+  }
+  void map(function(string,string:void)|array(function(string,string:void)) fn)
+  {
+    return(domain->map(ypmap, fn));
+  }
+  string server()
+  {
+    return(domain->server());
+  }
+  int order()
+  {
+    return(domain->order(ypmap));
+  }
+  int sizeof()
+  {
+    return(sizeof(domain->all(ypmap)));
+  }
+  array(string) indices()
+  {
+    return(indices(domain->all(ypmap)));
+  }
+  array(string) values()
+  {
+    return(values(domain->all(ypmap));
+  }
+};
-- 
GitLab