from Amd code to to libamu, so sun2amd could use it.
* amd/Makefile.am (sbin_PROGRAMS): build sun2amd binary and man
page.
(EXTRA_sun2amd_OBJECTS): sun2amd needs to link with all info_*.c files
* amd/sun2amd.8: placeholder for man page.
* amd/sun2amd.c: placeholder for C version of translator from Sun
syntax maps to Amd maps.
* */*.[0-9]: include file name in nroff source comment.
2005-08-06 Erez Zadok <ezk@cs.sunysb.edu>
+ * libamu/util.c, amd/autil.c (strsplit): moved strsplit() function
+ from Amd code to to libamu, so sun2amd could use it.
+
+ * amd/Makefile.am (sbin_PROGRAMS): build sun2amd binary and man
+ page.
+ (EXTRA_sun2amd_OBJECTS): sun2amd needs to link with all info_*.c files
+
+ * amd/sun2amd.8: placeholder for man page.
+
+ * amd/sun2amd.c: placeholder for C version of translator from Sun
+ syntax maps to Amd maps.
+
+ * */*.[0-9]: include file name in nroff source comment.
+
* ALL: use '0' properly when assigning or passing it to functions.
If in the context pointer, use NULL. If in the context of a
single char (say within a string), the use '\0'. This is just to
in the distro (IMHO), and should be cleaned upon "make clean".
(amd_SOURCES): include new sun_map_parse.y and sun_map_tok.l files.
-
* ylwrap: new file needed because we have two parsers now.
* amd/sun_map_{parse.y,tok.l}: cleanup and formatting.
# Level: Makefile for amd/ directory
# Author: Erez Zadok
-sbin_PROGRAMS = amd
+sbin_PROGRAMS = amd sun2amd
# man pages
-man_MANS = amd.8
+man_MANS = amd.8 sun2amd.8
# test scripts
TESTS = test1.sh
\
get_args.c
+sun2amd_SOURCES = \
+ sun_map_parse.y \
+ sun_map_tok.l \
+ \
+ sun2amd.c \
+ sun_map.c
+
+EXTRA_sun2amd_SOURCES = \
+ info_file.c \
+ info_exec.c \
+ info_hesiod.c \
+ info_ldap.c \
+ info_ndbm.c \
+ info_nis.c \
+ info_nisplus.c \
+ info_passwd.c \
+ info_sun.c \
+ info_union.c
+
# AMD_FS_OBJS: a list of ops_*.o objects added, depending on which
# filesystem types this system supports.
# AMD_INFO_OBJS: a list of info_*.o objects added, depending on which map
# types this system supports.
EXTRA_amd_OBJECTS = @AMD_FS_OBJS@ @AMD_INFO_OBJS@
-LDADD = $(EXTRA_amd_OBJECTS) get_args.o ../libamu/libamu.la
+amd_LDADD = $(EXTRA_amd_OBJECTS) get_args.o ../libamu/libamu.la
+
+EXTRA_sun2amd_OBJECTS = @AMD_INFO_OBJS@
+sun2amd_LDADD = $(EXTRA_sun2amd_OBJECTS) ../libamu/libamu.la
# must manually add f/lex library to LIBS, and not to LDADD.
LIBS = @LIBS@ @LEXLIB@ @WRAPLIB@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amd.8,v 1.14 2005/01/03 20:56:45 ezk Exp $
+.\" File: am-utils/amd/amd.8
.\"
.TH AMD 8 "3 November 1989"
.SH NAME
}
-/*
- * Split s using ch as delimiter and qc as quote character
- */
-char **
-strsplit(char *s, int ch, int qc)
-{
- char **ivec;
- int ic = 0;
- int done = 0;
-
- ivec = (char **) xmalloc((ic + 1) * sizeof(char *));
-
- while (!done) {
- char *v;
-
- /*
- * skip to split char
- */
- while (*s && (ch == ' ' ? (isascii(*s) && isspace((int)*s)) : *s == ch))
- *s++ = '\0';
-
- /*
- * End of string?
- */
- if (!*s)
- break;
-
- /*
- * remember start of string
- */
- v = s;
-
- /*
- * skip to split char
- */
- while (*s && !(ch == ' ' ? (isascii(*s) && isspace((int)*s)) : *s == ch)) {
- if (*s++ == qc) {
- /*
- * Skip past string.
- */
- s++;
- while (*s && *s != qc)
- s++;
- if (*s == qc)
- s++;
- }
- }
-
- if (!*s)
- done = 1;
- *s++ = '\0';
-
- /*
- * save string in new ivec slot
- */
- ivec[ic++] = v;
- ivec = (char **) xrealloc((voidp) ivec, (ic + 1) * sizeof(char *));
- if (amuDebug(D_STR))
- plog(XLOG_DEBUG, "strsplit saved \"%s\"", v);
- }
-
- if (amuDebug(D_STR))
- plog(XLOG_DEBUG, "strsplit saved a total of %d strings", ic);
-
- ivec[ic] = NULL;
-
- return ivec;
-}
-
-
/*
* Strip off the trailing part of a domain
* to produce a short-form domain relative
--- /dev/null
+.\"
+.\" Copyright (c) 1997-2005 Erez Zadok
+.\" Copyright (c) 1990 Jan-Simon Pendry
+.\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Jan-Simon Pendry at Imperial College, London.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgment:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.\" File: am-utils/amd/sun2amd.8
+.\"
+.TH SUN2AMD 8L "8 August 2005"
+.SH NAME
+sun2amd \- converts Sun automount maps to Amd maps
--- /dev/null
+/*
+ * Copyright (c) 1997-2005 Erez Zadok
+ * Copyright (c) 1989 Jan-Simon Pendry
+ * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Jan-Simon Pendry at Imperial College, London.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgment:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *
+ * File: am-utils/amd/sun2amd.c
+ *
+ */
+
+/*
+ * Translate Sun-syntax maps to Amd maps
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+#include <am_defs.h>
+#include <amd.h>
+
+/* XXX: empty placeholder. Fill in */
+
+
+/* dummies to make the program compile and link */
+struct amu_global_options gopt; /* may not be needed for sun2amd */
+
+
+int
+main()
+{
+ exit(1);
+}
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amq.8,v 1.15 2005/01/03 20:56:45 ezk Exp $
+.\" File: am-utils/amq/amq.8
.\"
.TH AMQ 8 "25 April 1989"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: pawd.1,v 1.9 2005/01/03 20:56:45 ezk Exp $
+.\" File: am-utils/amq/pawd.1
.\"
.TH PAWD 1 "6 Jan 1998"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: fixmount.8,v 1.12 2005/01/03 20:56:46 ezk Exp $
+.\" File: am-utils/fixmount/fixmount.8
.\"
.TH FIXMOUNT 8 "26 Feb 1993"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)fsinfo.8 8.1 (Berkeley) 6/28/93
-.\" $Id: fsinfo.8,v 1.13 2005/01/03 20:56:46 ezk Exp $
+.\"
+.\" File: am-utils/fsinfo/fsinfo.8
.\"
.TH FSINFO 8 "June 28, 1993"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: hlfsd.8,v 1.11 2005/01/03 20:56:46 ezk Exp $
+.\"
+.\" File: am-utils/hlfsd/hlfsd.8
.\"
.\" HLFSD was written at Columbia University Computer Science Department, by
.\" Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@smarts.com>
}
+/*
+ * Split s using ch as delimiter and qc as quote character
+ */
+char **
+strsplit(char *s, int ch, int qc)
+{
+ char **ivec;
+ int ic = 0;
+ int done = 0;
+
+ ivec = (char **) xmalloc((ic + 1) * sizeof(char *));
+
+ while (!done) {
+ char *v;
+
+ /*
+ * skip to split char
+ */
+ while (*s && (ch == ' ' ? (isascii(*s) && isspace((int)*s)) : *s == ch))
+ *s++ = '\0';
+
+ /*
+ * End of string?
+ */
+ if (!*s)
+ break;
+
+ /*
+ * remember start of string
+ */
+ v = s;
+
+ /*
+ * skip to split char
+ */
+ while (*s && !(ch == ' ' ? (isascii(*s) && isspace((int)*s)) : *s == ch)) {
+ if (*s++ == qc) {
+ /*
+ * Skip past string.
+ */
+ s++;
+ while (*s && *s != qc)
+ s++;
+ if (*s == qc)
+ s++;
+ }
+ }
+
+ if (!*s)
+ done = 1;
+ *s++ = '\0';
+
+ /*
+ * save string in new ivec slot
+ */
+ ivec[ic++] = v;
+ ivec = (char **) xrealloc((voidp) ivec, (ic + 1) * sizeof(char *));
+ if (amuDebug(D_STR))
+ plog(XLOG_DEBUG, "strsplit saved \"%s\"", v);
+ }
+
+ if (amuDebug(D_STR))
+ plog(XLOG_DEBUG, "strsplit saved a total of %d strings", ic);
+
+ ivec[ic] = NULL;
+
+ return ivec;
+}
+
+
/*
* Make all the directories in the path.
*/
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)mk-amd-map.8 8.1 (Berkeley) 6/28/93
-.\" $Id: mk-amd-map.8,v 1.9 2005/01/03 20:56:46 ezk Exp $
+.\"
+.\" File: am-utils/mk-amd-map/mk-amd-map.8
.\"
.TH MK-AMD-MAP 8 "June 28, 1993"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amd.conf.5,v 1.40 2005/08/06 18:58:45 ezk Exp $
+.\" File: am-utils/scripts/amd.conf.5
.\"
.TH AMD.CONF 5 "7 August 1997"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: automount2amd.8,v 1.8 2005/01/03 20:56:46 ezk Exp $
+.\" File: am-utils/scripts/automount2amd.8
.\"
.TH AUTOMOUNT2AMD 8L "24 May 1993"
.SH NAME
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" %W% (Berkeley) %G%
.\"
-.\" $Id: wire-test.8,v 1.10 2005/01/03 20:56:46 ezk Exp $
+.\" File: am-utils/wire-test/wire-test.8
.\"
.TH WIRE-TEST 8 "26 Feb 1993"
.SH NAME