New interface to YP server. Only bind once, and never unbind.
[become] / src / ypstuff.h
diff --git a/src/ypstuff.h b/src/ypstuff.h
new file mode 100644 (file)
index 0000000..8a246da
--- /dev/null
@@ -0,0 +1,87 @@
+/* -*-c-*-
+ *
+ * $Id: ypstuff.h,v 1.1 1998/04/23 13:29:33 mdw Exp $
+ *
+ * YP support functions
+ *
+ * (c) 1998 EBI
+ */
+
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This file is part of `become'
+ *
+ * `Become' is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * `Become' is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with `become'; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*----- Revision history --------------------------------------------------*
+ *
+ * $Log: ypstuff.h,v $
+ * Revision 1.1  1998/04/23 13:29:33  mdw
+ * New interface to YP server.  Only bind once, and never unbind.
+ * Introduced because Linux libc-5.4.33's YP interface dumps core in
+ * yp_unbind for no particularly good reason.
+ *
+ */
+
+#ifndef YPSTUFF_H
+#define YPSTUFF_H
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+/*----- Required headers --------------------------------------------------*/
+
+#ifndef CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef HAVE_YP
+#  include <rpc/rpc.h>
+#  include <rpcsvc/ypclnt.h>
+#  include <rpcsvc/yp_prot.h>
+#endif
+
+/*----- Global variables --------------------------------------------------*/
+
+#ifdef HAVE_YP
+extern char *yp_domain;
+#endif
+
+/*----- Functions provided ------------------------------------------------*/
+
+/* --- @ypstuff_bind@ --- *
+ *
+ * Arguments:  ---
+ *
+ * Returns:    ---
+ *
+ * Use:                Attempts to bind to a YP server, just once.  If it fails,
+ *             @yp_domain@ will be null; otherwise it's a pointer to the
+ *             default YP domain name.
+ */
+
+#ifdef HAVE_YP
+extern void ypstuff_bind(void);
+#endif
+
+/*----- That's all, folks -------------------------------------------------*/
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif