summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.sbin')
-rw-r--r--gnu/usr.sbin/mkhybrid/mkhybrid/Makefile4
-rw-r--r--gnu/usr.sbin/mkhybrid/src/Makefile7
-rw-r--r--gnu/usr.sbin/mkhybrid/src/Makefile.in7
-rw-r--r--gnu/usr.sbin/mkhybrid/src/apple.c80
-rw-r--r--gnu/usr.sbin/mkhybrid/src/apple.h7
-rw-r--r--gnu/usr.sbin/mkhybrid/src/apple_proto.h35
-rw-r--r--gnu/usr.sbin/mkhybrid/src/desktop.c13
-rw-r--r--gnu/usr.sbin/mkhybrid/src/eltorito.c1
-rw-r--r--gnu/usr.sbin/mkhybrid/src/exclude.c56
-rw-r--r--gnu/usr.sbin/mkhybrid/src/exclude.h10
-rw-r--r--gnu/usr.sbin/mkhybrid/src/files.c1
-rw-r--r--gnu/usr.sbin/mkhybrid/src/fnmatch.c230
-rw-r--r--gnu/usr.sbin/mkhybrid/src/fnmatch.h80
-rw-r--r--gnu/usr.sbin/mkhybrid/src/hash.c1
-rw-r--r--gnu/usr.sbin/mkhybrid/src/joliet.c3
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libfile/apprentice.c5
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libfile/file.h3
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libfile/lfile.c6
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libfile/proto.h25
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libfile/softmagic.c5
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libhfs_iso/block.c2
-rw-r--r--gnu/usr.sbin/mkhybrid/src/mac_label.c1
-rw-r--r--gnu/usr.sbin/mkhybrid/src/mac_label.h12
-rw-r--r--gnu/usr.sbin/mkhybrid/src/mac_label_proto.h40
-rw-r--r--gnu/usr.sbin/mkhybrid/src/match.c11
-rw-r--r--gnu/usr.sbin/mkhybrid/src/match.h3
-rw-r--r--gnu/usr.sbin/mkhybrid/src/mkisofs.c5
-rw-r--r--gnu/usr.sbin/mkhybrid/src/multi.c2
-rw-r--r--gnu/usr.sbin/mkhybrid/src/name.c2
-rw-r--r--gnu/usr.sbin/mkhybrid/src/rock.c2
-rw-r--r--gnu/usr.sbin/mkhybrid/src/tree.c7
-rw-r--r--gnu/usr.sbin/mkhybrid/src/vms.c2
-rw-r--r--gnu/usr.sbin/mkhybrid/src/volume.c4
-rw-r--r--gnu/usr.sbin/mkhybrid/src/volume.h23
-rw-r--r--gnu/usr.sbin/mkhybrid/src/write.c27
-rw-r--r--gnu/usr.sbin/mkhybrid/src/write.h28
36 files changed, 229 insertions, 521 deletions
diff --git a/gnu/usr.sbin/mkhybrid/mkhybrid/Makefile b/gnu/usr.sbin/mkhybrid/mkhybrid/Makefile
index db406afa364..7c9438fb85b 100644
--- a/gnu/usr.sbin/mkhybrid/mkhybrid/Makefile
+++ b/gnu/usr.sbin/mkhybrid/mkhybrid/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2006/04/22 14:14:53 jmc Exp $
+# $OpenBSD: Makefile,v 1.4 2008/03/08 15:36:12 espie Exp $
# NOTE: The mkhybrid distrib also makes an "mkisofs" which is the same binary
# linked. When we know mkhybrid makes distrib CDs ok we should modify this
@@ -12,7 +12,7 @@ BINDIR= /usr/sbin
SRCS= data.c block.c low.c lfile.c btree.c node.c record.c lvolume.c \
hfs.c file.c apprentice.c softmagic.c mkisofs.c tree.c write.c \
- hash.c rock.c multi.c joliet.c match.c name.c fnmatch.c eltorito.c \
+ hash.c rock.c multi.c joliet.c match.c name.c eltorito.c \
getopt.c getopt1.c apple.c volume.c desktop.c mac_label.c
CFLAGS+=-DSYSTEM_ID_DEFAULT=\"OpenBSD\" -DAPPLE_HYB -DVANILLA_AUTOCONF \
diff --git a/gnu/usr.sbin/mkhybrid/src/Makefile b/gnu/usr.sbin/mkhybrid/src/Makefile
index f0cc563211b..7672992e642 100644
--- a/gnu/usr.sbin/mkhybrid/src/Makefile
+++ b/gnu/usr.sbin/mkhybrid/src/Makefile
@@ -1,6 +1,6 @@
# Generated automatically from Makefile.in by configure.
#
-# $Id: Makefile,v 1.2 2002/12/13 03:12:26 millert Exp $
+# $Id: Makefile,v 1.3 2008/03/08 15:36:12 espie Exp $
#
## Makefile for mkhybrid - based on mkisofs v1.12
# James Pearson 16/3/1999
@@ -45,7 +45,7 @@ manext = 8
CFLAGS=$(COPTS) $(DEFINES) -I. -Iinclude -I$(libhfsdir) -DVANILLA_AUTOCONF
LDFLAGS= -L$(libhfsdir) -L$(libfiledir)
OBJS=mkisofs.o tree.o write.o hash.o rock.o multi.o \
- joliet.o match.o name.o fnmatch.o eltorito.o \
+ joliet.o match.o name.o eltorito.o \
apple.o volume.o desktop.o mac_label.o
World: mkhybrid
@@ -94,9 +94,6 @@ joliet.o: joliet.c mkisofs.h iso9660.h config.h Makefile
match.o: match.c match.h config.h Makefile
$(CC) -c $(CFLAGS) $(srcdir)/match.c
-fnmatch.o: fnmatch.c fnmatch.h config.h Makefile
- $(CC) -c $(CFLAGS) $(srcdir)/fnmatch.c
-
multi.o: multi.c iso9660.h mkisofs.h config.h Makefile
$(CC) -c $(CFLAGS) $(srcdir)/multi.c
diff --git a/gnu/usr.sbin/mkhybrid/src/Makefile.in b/gnu/usr.sbin/mkhybrid/src/Makefile.in
index ddabb3b84a2..b4af94c1670 100644
--- a/gnu/usr.sbin/mkhybrid/src/Makefile.in
+++ b/gnu/usr.sbin/mkhybrid/src/Makefile.in
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.in,v 1.2 2002/12/13 03:12:26 millert Exp $
+# $Id: Makefile.in,v 1.3 2008/03/08 15:36:12 espie Exp $
#
## Makefile for mkhybrid - based on mkisofs v1.12
# James Pearson 16/3/1999
@@ -45,7 +45,7 @@ manext = 8
CFLAGS=$(COPTS) $(DEFINES) -I. -Iinclude -I$(libhfsdir) -DVANILLA_AUTOCONF
LDFLAGS=@LDFLAGS@ -L$(libhfsdir) -L$(libfiledir)
OBJS=mkisofs.o tree.o write.o hash.o rock.o multi.o \
- joliet.o match.o name.o fnmatch.o eltorito.o \
+ joliet.o match.o name.o eltorito.o \
apple.o volume.o desktop.o mac_label.o
World: mkhybrid
@@ -94,9 +94,6 @@ joliet.o: joliet.c mkisofs.h iso9660.h config.h Makefile
match.o: match.c match.h config.h Makefile
$(CC) -c $(CFLAGS) $(srcdir)/match.c
-fnmatch.o: fnmatch.c fnmatch.h config.h Makefile
- $(CC) -c $(CFLAGS) $(srcdir)/fnmatch.c
-
multi.o: multi.c iso9660.h mkisofs.h config.h Makefile
$(CC) -c $(CFLAGS) $(srcdir)/multi.c
diff --git a/gnu/usr.sbin/mkhybrid/src/apple.c b/gnu/usr.sbin/mkhybrid/src/apple.c
index 80f9412337d..ee332767b0c 100644
--- a/gnu/usr.sbin/mkhybrid/src/apple.c
+++ b/gnu/usr.sbin/mkhybrid/src/apple.c
@@ -17,14 +17,17 @@
#ifdef APPLE_HYB
+#include <ctype.h>
#include <errno.h>
#include <unistd.h>
+#include <err.h>
#include <fcntl.h>
#include <config.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <apple.h>
+#include "apple_proto.h"
#include <mkisofs.h>
/* tidy up mkisofs definition ... */
@@ -44,6 +47,7 @@ static int get_fe_info(char *, char *, dir_ent *, int);
static int get_sgi_dir(char *, char *, dir_ent *, int);
static int get_sgi_info(char *, char *, dir_ent *, int);
+void map_ext(char *, char **, char **, unsigned short *, char *);
static afpmap **map; /* list of mappings */
static afpmap *defmap; /* the default mapping */
static int last_ent; /* previous mapped entry */
@@ -303,7 +307,6 @@ get_cap_info(char *hname, char *dname, dir_ent *s_entry, int ret)
{
FileInfo info; /* finderinfo struct */
int num = -1; /* bytes read */
- char *name;
char *c;
char *t;
hfsdirent *hfs_ent = s_entry->hfs_ent;
@@ -440,7 +443,7 @@ get_es_info(char *hname, char *dname, dir_ent *s_entry, int ret)
/* this should exist ... */
if ((s_entry1 = s_entry->assoc) == NULL)
- perr("TYPE_ESH error - shouldn't happen!");
+ errx(1, "TYPE_ESH error - shouldn't happen!");
/* fill in the HFS info stuff */
strncpy(hfs_ent->type, t, CT_SIZE);
@@ -504,7 +507,9 @@ get_mb_info(char *hname, char *dname, dir_ent *s_entry, int ret)
hfsdirent *hfs_ent;
dir_ent *s_entry1;
int i;
+#ifdef TEST_CODE
unsigned short crc_file, crc_calc;
+#endif
info = (mb_info *)p_buf;
@@ -555,7 +560,7 @@ get_mb_info(char *hname, char *dname, dir_ent *s_entry, int ret)
/* this should exist ... */
if((s_entry1 = s_entry->assoc) == NULL)
- perr("TYPE_MBIN error - shouldn't happen!");
+ errx(1, "TYPE_MBIN error - shouldn't happen!");
hfs_ent = s_entry->hfs_ent;
@@ -636,7 +641,7 @@ get_dbl_info(char *hname, char *dname, dir_ent *s_entry, int ret)
/* get the rsrc file info - should exist ... */
if ((s_entry1 = s_entry->assoc) == NULL)
- perr("TYPE_DBL error - shouldn't happen!");
+ errx(1, "TYPE_DBL error - shouldn't happen!");
/* open and read the info/rsrc file (it's the same file) */
if ((fp = fopen(hname,"rb")) != NULL)
@@ -745,7 +750,6 @@ get_sgl_info(char *hname, char *dname, dir_ent *s_entry, int ret)
char *c;
char *t;
int nentries;
- FILE *fp;
hfsdirent *hfs_ent;
dir_ent *s_entry1;
char name[64];
@@ -780,7 +784,7 @@ get_sgl_info(char *hname, char *dname, dir_ent *s_entry, int ret)
/* get the rsrc file info - should exist ... */
if ((s_entry1 = s_entry->assoc) == NULL)
- perr("TYPE_SGL error - shouldn't happen!");
+ errx(1, "TYPE_SGL error - shouldn't happen!");
hfs_ent = s_entry->hfs_ent;
@@ -1383,23 +1387,23 @@ get_hfs_rname(char *wname, char *dname, char *rname)
else {
/* if we are probing, then have a look at the contents to
find type */
- if (p_fd < 0)
+ if (p_fd < 0) {
/* open file, if not already open */
if((p_fd = open(wname, O_RDONLY | O_BINARY)) < 0) {
/* can't open it, then give up */
return (TYPE_NONE);
- }
- else {
+ } else {
if((p_num = read(p_fd, p_buf, sizeof(p_buf))) <= 0) {
/* can't read, or zero length - give up */
close(p_fd);
return(TYPE_NONE);
+ }
+ /* get file pointer and close file */
+ p_fp = fdopen(p_fd, "rb");
+ close(p_fd);
+ if(p_fp == NULL)
+ return(TYPE_NONE);
}
- /* get file pointer and close file */
- p_fp = fdopen(p_fd, "rb");
- close(p_fd);
- if(p_fp == NULL)
- return(TYPE_NONE);
}
/* call routine to do the work - use the given dname as
this is the name we may use on the CD */
@@ -1511,6 +1515,7 @@ hfs_exclude(char *d_name)
** print_hfs_info: print info about the HFS files.
**
*/
+void
print_hfs_info(dir_ent *s_entry)
{
fprintf(stderr,"Name: %s\n",s_entry->whole_name);
@@ -1529,11 +1534,13 @@ print_hfs_info(dir_ent *s_entry)
void
hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
unsigned int hfs_select)
-/* char *name; /* afpfile name */
-/* u_short *fdflags; /* default finder flags */
-/* int probe; /* probe flag */
-/* int nomacfiles; /* don't look for mac files */
-/* u_int hfs_select /* select certain mac files */
+#if 0
+ char *name; /* afpfile name */
+ u_short *fdflags; /* default finder flags */
+ int probe; /* probe flag */
+ int nomacfiles; /* don't look for mac files */
+ u_int hfs_select /* select certain mac files */
+#endif
{
FILE *fp; /* File pointer */
int count = NUMMAP; /* max number of entries */
@@ -1576,14 +1583,14 @@ hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
/* initialise magic file */
if(magic_file && init_magic(magic_file) != 0)
- perr("unable to open magic file");
+ errx(1, "unable to open magic file");
/* set defaults */
map_num = last_ent = 0;
/* allocate memory for the default entry */
if((defmap = (afpmap *)malloc(sizeof(afpmap))) == NULL)
- perr("not enough memory");
+ errx(1, "not enough memory");
/* set default values */
defmap->extn = DEFMATCH;
@@ -1617,10 +1624,10 @@ hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
}
if((fp = fopen(name,"r")) == NULL)
- perr("unable to open mapping file: %s", name);
+ err(1, "unable to open mapping file: %s", name);
if((map = (afpmap **)malloc(NUMMAP * sizeof(afpmap *))) == NULL)
- perr("not enough memory");
+ errx(1, "not enough memory");
/* read afpfile line by line */
while(fgets(buf, MAXPATHLEN, fp) != NULL) {
@@ -1635,12 +1642,12 @@ hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
count += NUMMAP;
map = (afpmap **)realloc(map, count * sizeof(afpmap *));
if (map == NULL)
- perr("not enough memory");
+ errx(1, "not enough memory");
}
/* allocate memory for this entry */
if((amap = (afpmap *)malloc(sizeof(afpmap))) == NULL)
- perr("not enough memory");
+ errx(1, "not enough memory");
t = amap->type;
c = amap->creator;
@@ -1655,7 +1662,7 @@ hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
/* copy the extension found */
if ((amap->extn = (char *)strdup(tmp)) == NULL)
- perr("not enough memory");
+ errx(1, "not enough memory");
/* set end-of-string */
*(t+4) = *(c+4) = '\0';
@@ -1687,7 +1694,7 @@ hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
if (map_num != count) {
map = (afpmap **)realloc(map, map_num * sizeof(afpmap *));
if (map == NULL)
- perr("not enough memory");
+ errx(1, "not enough memory");
}
}
@@ -1695,12 +1702,15 @@ hfs_init(char *name, unsigned short fdflags, int probe, int nomacfiles,
/*
** map_ext: map a files extension with the list to get type/creator
*/
+void
map_ext(char *name, char **type, char **creator, unsigned short *fdflags,
char *whole_name)
-/* char *name; /* filename */
-/* char **type; /* set type */
-/* char **creator; /* set creator */
-/* u_short *fdflags; /* set finder flags */
+#if 0
+ char *name; /* filename */
+ char **type; /* set type */
+ char **creator; /* set creator */
+ u_short *fdflags; /* set finder flags */
+#endif
{
int i; /* loop counter */
int len; /* filename length */
@@ -1801,11 +1811,3 @@ clean_hfs()
#else
#include <stdio.h>
#endif /* APPLE_HYB */
-
-perr(char *a)
-{
- if (a)
- fprintf(stderr,"mkhybrid: %s\n",a);
- perror("mkhybrid");
- exit(1);
-}
diff --git a/gnu/usr.sbin/mkhybrid/src/apple.h b/gnu/usr.sbin/mkhybrid/src/apple.h
index 56aed612c06..73de3d5dfd0 100644
--- a/gnu/usr.sbin/mkhybrid/src/apple.h
+++ b/gnu/usr.sbin/mkhybrid/src/apple.h
@@ -50,17 +50,12 @@ typedef struct {
unsigned short fdflags; /* finder flags */
} afpmap;
-extern void hfs_init(char *, unsigned short, int, int, unsigned int);
-extern void clean_hfs(void);
-
/* from "data.h" - libhfs routines */
unsigned long d_toutime(unsigned long);
long d_getl(unsigned char *);
short d_getw(unsigned char *);
-/* for libfile routines */
-int init_magic(char *);
-char * get_magic_match(const char *);
+#include "libfile/proto.h"
/****** TYPE_CAP ******/
diff --git a/gnu/usr.sbin/mkhybrid/src/apple_proto.h b/gnu/usr.sbin/mkhybrid/src/apple_proto.h
new file mode 100644
index 00000000000..c1089148493
--- /dev/null
+++ b/gnu/usr.sbin/mkhybrid/src/apple_proto.h
@@ -0,0 +1,35 @@
+/* apple_proto.h */
+/* $OpenBSD: apple_proto.h,v 1.1 2008/03/08 15:36:12 espie Exp $ */
+/*
+ * Copyright (c) 2008 Marc Espie <espie@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef APPLE_PROTO_H
+#define APPLE_PROTO_H
+
+struct directory_entry;
+struct hfs_info;
+
+extern void hfs_init(char *, unsigned short, int, int, unsigned int);
+extern void clean_hfs(void);
+extern int hfs_exclude(char *);
+extern int get_hfs_rname(char *, char *, char *);
+extern int get_hfs_dir(char *, char *, struct directory_entry *);
+extern int get_hfs_info(char *, char *, struct directory_entry *);
+extern void print_hfs_info(struct directory_entry *);
+extern void delete_rsrc_ent(struct directory_entry *);
+extern void del_hfs_info(struct hfs_info *);
+
+#endif
diff --git a/gnu/usr.sbin/mkhybrid/src/desktop.c b/gnu/usr.sbin/mkhybrid/src/desktop.c
index 50c9bd1c5fc..f67e9641edb 100644
--- a/gnu/usr.sbin/mkhybrid/src/desktop.c
+++ b/gnu/usr.sbin/mkhybrid/src/desktop.c
@@ -23,6 +23,7 @@
#ifdef APPLE_HYB
#include <string.h>
+#include <err.h>
#include "hfs.h"
#define DB "Desktop DB"
@@ -40,7 +41,7 @@ extern hce_mem *hce; /* libhfs/mkisofs extras */
int
make_desktop(hfsvol *vol, int end)
-/* hfsvol *vol; /* Mac volume */
+/* hfsvol *vol; Mac volume */
{
hfsfile *hfp; /* Mac file */
hfsdirent ent; /* Mac finderinfo */
@@ -95,28 +96,28 @@ make_desktop(hfsvol *vol, int end)
/* open file */
if((hfp = hfs_open(vol, DB)) == 0)
- perr(hfs_error);
+ err(1, hfs_error);
/* "write" file */
write_fork(hfp, clps);
/* set DB file attributes */
if (hfs_fsetattr(hfp, &ent) < 0)
- perr(hfs_error);
+ err(1, hfs_error);
/* find the real start of the file */
end += hce->hfs_ce_size;
/* close DB file */
if (hfs_close(hfp, end, 0) < 0)
- perr(hfs_error);
+ err(1, hfs_error);
}
else
{
/* if it already exists, then make sure it has the correct
type/creator and flags */
if(hfs_setattr(vol, DB, &ent) < 0)
- perr(hfs_error);
+ err(1, hfs_error);
}
/* setup "Desktop DF" file as an empty file */
@@ -128,7 +129,7 @@ make_desktop(hfsvol *vol, int end)
/* set DB file attributes */
if (hfs_setattr(vol, DF, &ent) < 0)
- perr(hfs_error);
+ err(1, hfs_error);
return 0;
}
#endif /* APPLE_HYB */
diff --git a/gnu/usr.sbin/mkhybrid/src/eltorito.c b/gnu/usr.sbin/mkhybrid/src/eltorito.c
index de1beb7c26b..501d3d65089 100644
--- a/gnu/usr.sbin/mkhybrid/src/eltorito.c
+++ b/gnu/usr.sbin/mkhybrid/src/eltorito.c
@@ -21,7 +21,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: eltorito.c,v 1.2 2004/06/22 22:58:06 tom Exp $";
#include <stdio.h>
#include <sys/types.h>
diff --git a/gnu/usr.sbin/mkhybrid/src/exclude.c b/gnu/usr.sbin/mkhybrid/src/exclude.c
deleted file mode 100644
index 6043046513a..00000000000
--- a/gnu/usr.sbin/mkhybrid/src/exclude.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de:
- * added 'exclude' option (-x) to specify pathnames NOT to be included in
- * CD image.
- */
-
-static char rcsid[] ="$Id: exclude.c,v 1.1 2000/10/10 20:40:14 beck Exp $";
-
-#include <stdio.h>
-#ifndef VMS
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#else
-#include <stdlib.h>
-#endif
-#endif
-#include <string.h>
-
-/* this allows for 1000 entries to be excluded ... */
-#define MAXEXCL 1000
-static char * excl[MAXEXCL];
-
-void exclude(fn)
-char * fn;
-{
- register int i;
-
- for (i=0; excl[i] && i<MAXEXCL; i++);
- if (i == MAXEXCL) {
- fprintf(stderr,"Can't exclude '%s' - too many entries in table\n",fn);
- return;
- }
-
-
- excl[i] = (char *) malloc(strlen(fn)+1);
- if (! excl[i]) {
- fprintf(stderr,"Can't allocate memory for excluded filename\n");
- return;
- }
-
- strcpy(excl[i],fn);
-}
-
-int is_excluded(fn)
-char * fn;
-{
- /* very dumb search method ... */
- register int i;
-
- for (i=0; excl[i] && i<MAXEXCL; i++) {
- if (strcmp(excl[i],fn) == 0) {
- return 1; /* found -> excluded filenmae */
- }
- }
- return 0; /* not found -> not excluded */
-}
diff --git a/gnu/usr.sbin/mkhybrid/src/exclude.h b/gnu/usr.sbin/mkhybrid/src/exclude.h
deleted file mode 100644
index 53f3b358b8a..00000000000
--- a/gnu/usr.sbin/mkhybrid/src/exclude.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de:
- * added 'exclude' option (-x) to specify pathnames NOT to be included in
- * CD image.
- *
- * $Id: exclude.h,v 1.1 2000/10/10 20:40:14 beck Exp $
- */
-
-void exclude __PR((char * fn));
-int is_excluded __PR((char * fn));
diff --git a/gnu/usr.sbin/mkhybrid/src/files.c b/gnu/usr.sbin/mkhybrid/src/files.c
index 8cf27a73603..b7ff38284a0 100644
--- a/gnu/usr.sbin/mkhybrid/src/files.c
+++ b/gnu/usr.sbin/mkhybrid/src/files.c
@@ -21,7 +21,6 @@
/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */
-static char rcsid[] ="$Id: files.c,v 1.1 2000/10/10 20:40:14 beck Exp $";
#include "config.h"
#include <errno.h>
diff --git a/gnu/usr.sbin/mkhybrid/src/fnmatch.c b/gnu/usr.sbin/mkhybrid/src/fnmatch.c
deleted file mode 100644
index b2c19fc7d46..00000000000
--- a/gnu/usr.sbin/mkhybrid/src/fnmatch.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-This program 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, or (at your option) any
-later version.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-static char rcsid[] ="$Id: fnmatch.c,v 1.1 2000/10/10 20:40:14 beck Exp $";
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <fnmatch.h>
-
-#ifndef __STDC__
-#define const
-#endif
-
-#ifndef FNM_FILE_NAME
-#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
-#endif
-
-#ifndef FNM_LEADING_DIR
-#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
-#endif
-
-#ifndef FNM_CASEFOLD
-#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
-#endif
-
-
-#include <ctype.h>
-
-#if defined (STDC_HEADERS) || !defined (isascii)
-#define ISASCII(c) 1
-#else
-#define ISASCII(c) isascii(c)
-#endif
-
-#define ISUPPER(c) (ISASCII (c) && isupper (c))
-
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
-
-
-#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
-extern int errno;
-#endif
-
-/* Match STRING against the filename pattern PATTERN, returning zero if
- it matches, nonzero if not. */
-int
-fnmatch (pattern, string, flags)
- const char *pattern;
- const char *string;
- int flags;
-{
- register const char *p = pattern, *n = string;
- register char c;
-
-/* Note that this evalutes C many times. */
-#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
-
- while ((c = *p++) != '\0')
- {
- c = FOLD ((unsigned char)c);
-
- switch (c)
- {
- case '?':
- if (*n == '\0')
- return FNM_NOMATCH;
- else if ((flags & FNM_FILE_NAME) && *n == '/')
- return FNM_NOMATCH;
- else if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
- return FNM_NOMATCH;
- break;
-
- case '\\':
- if (!(flags & FNM_NOESCAPE))
- {
- c = *p++;
- c = FOLD ((unsigned char )c);
- }
- if (FOLD ((unsigned char )*n) != c)
- return FNM_NOMATCH;
- break;
-
- case '*':
- if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
- return FNM_NOMATCH;
-
- for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
- if (((flags & FNM_FILE_NAME) && *n == '/') ||
- (c == '?' && *n == '\0'))
- return FNM_NOMATCH;
-
- if (c == '\0')
- return 0;
-
- {
- char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
- c1 = FOLD ((unsigned char )c1);
- for (--p; *n != '\0'; ++n)
- if ((c == '[' || FOLD ((unsigned char )*n) == c1) &&
- fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
- return 0;
- return FNM_NOMATCH;
- }
-
- case '[':
- {
- /* Nonzero if the sense of the character class is inverted. */
- register int not;
-
- if (*n == '\0')
- return FNM_NOMATCH;
-
- if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
- return FNM_NOMATCH;
-
- not = (*p == '!' || *p == '^');
- if (not)
- ++p;
-
- c = *p++;
- for (;;)
- {
- register char cstart = c, cend = c;
-
- if (!(flags & FNM_NOESCAPE) && c == '\\')
- cstart = cend = *p++;
-
- cstart = cend = FOLD ((unsigned char)cstart);
-
- if (c == '\0')
- /* [ (unterminated) loses. */
- return FNM_NOMATCH;
-
- c = *p++;
- c = FOLD ((unsigned char)c);
-
- if ((flags & FNM_FILE_NAME) && c == '/')
- /* [/] can never match. */
- return FNM_NOMATCH;
-
- if (c == '-' && *p != ']')
- {
- cend = *p++;
- if (!(flags & FNM_NOESCAPE) && cend == '\\')
- cend = *p++;
- if (cend == '\0')
- return FNM_NOMATCH;
- cend = FOLD ((unsigned char)cend);
-
- c = *p++;
- }
-
- if (FOLD ((unsigned char)*n) >= cstart && FOLD ((unsigned char)*n) <= cend)
- goto matched;
-
- if (c == ']')
- break;
- }
- if (!not)
- return FNM_NOMATCH;
- break;
-
- matched:;
- /* Skip the rest of the [...] that already matched. */
- while (c != ']')
- {
- if (c == '\0')
- /* [... (unterminated) loses. */
- return FNM_NOMATCH;
-
- c = *p++;
- if (!(flags & FNM_NOESCAPE) && c == '\\')
- /* XXX 1003.2d11 is unclear if this is right. */
- ++p;
- }
- if (not)
- return FNM_NOMATCH;
- }
- break;
-
- default:
- if (c != FOLD ((unsigned char)*n))
- return FNM_NOMATCH;
- }
-
- ++n;
- }
-
- if (*n == '\0')
- return 0;
-
- if ((flags & FNM_LEADING_DIR) && *n == '/')
- /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
- return 0;
-
- return FNM_NOMATCH;
-}
-
-#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/gnu/usr.sbin/mkhybrid/src/fnmatch.h b/gnu/usr.sbin/mkhybrid/src/fnmatch.h
deleted file mode 100644
index 519cfb89eed..00000000000
--- a/gnu/usr.sbin/mkhybrid/src/fnmatch.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-This program 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, or (at your option) any
-later version.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * $Id: fnmatch.h,v 1.1 2000/10/10 20:40:14 beck Exp $
- */
-
-#ifndef _FNMATCH_H
-
-#define _FNMATCH_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
-#undef __P
-#define __P(protos) protos
-#else /* Not C++ or ANSI C. */
-#undef __P
-#define __P(protos) ()
-/* We can get away without defining `const' here only because in this file
- it is used only inside the prototype for `fnmatch', which is elided in
- non-ANSI C where `const' is problematical. */
-#endif /* C++ or ANSI C. */
-
-
-/* We #undef these before defining them because some losing systems
- (HP-UX A.08.07 for example) define these in <unistd.h>. */
-#undef FNM_PATHNAME
-#undef FNM_NOESCAPE
-#undef FNM_PERIOD
-
-/* Bits set in the FLAGS argument to `fnmatch'. */
-#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
-#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
-#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
-
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
-#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
-#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
-#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
-#endif
-
-#ifndef FNM_FILE_NAME
- /*
- * Apparently GNU libc doesn't define this thing.
- */
-#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
-#endif
-
-/* Value returned by `fnmatch' if STRING does not match PATTERN. */
-#define FNM_NOMATCH 1
-
-/* Match STRING against the filename pattern PATTERN,
- returning zero if it matches, FNM_NOMATCH if not. */
-extern int fnmatch __P ((const char *__pattern, const char *__string,
- int __flags));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* fnmatch.h */
diff --git a/gnu/usr.sbin/mkhybrid/src/hash.c b/gnu/usr.sbin/mkhybrid/src/hash.c
index 7bdfc6069b4..0f61a2ec7af 100644
--- a/gnu/usr.sbin/mkhybrid/src/hash.c
+++ b/gnu/usr.sbin/mkhybrid/src/hash.c
@@ -19,7 +19,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: hash.c,v 1.1 2000/10/10 20:40:15 beck Exp $";
#include <stdlib.h>
#include "config.h"
diff --git a/gnu/usr.sbin/mkhybrid/src/joliet.c b/gnu/usr.sbin/mkhybrid/src/joliet.c
index 873526bfa02..780405d94b0 100644
--- a/gnu/usr.sbin/mkhybrid/src/joliet.c
+++ b/gnu/usr.sbin/mkhybrid/src/joliet.c
@@ -17,8 +17,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: joliet.c,v 1.1 2000/10/10 20:40:16 beck Exp $";
-
/* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 12/3/99 */
/*
@@ -75,6 +73,7 @@ static char rcsid[] ="$Id: joliet.c,v 1.1 2000/10/10 20:40:16 beck Exp $";
#include "mkisofs.h"
#include "iso9660.h"
+
#include <stdlib.h>
#include <time.h>
diff --git a/gnu/usr.sbin/mkhybrid/src/libfile/apprentice.c b/gnu/usr.sbin/mkhybrid/src/libfile/apprentice.c
index fd98f50e65d..84c58d15131 100644
--- a/gnu/usr.sbin/mkhybrid/src/libfile/apprentice.c
+++ b/gnu/usr.sbin/mkhybrid/src/libfile/apprentice.c
@@ -40,11 +40,6 @@
#include <errno.h>
#include "file.h"
-#ifndef lint
-static char *moduleid =
- "@(#)$Id: apprentice.c,v 1.2 2007/11/28 18:20:39 chl Exp $";
-#endif /* lint */
-
#define EATAB {while (isascii((unsigned char) *l) && \
isspace((unsigned char) *l)) ++l;}
#define LOWCASE(l) (isupper((unsigned char) (l)) ? \
diff --git a/gnu/usr.sbin/mkhybrid/src/libfile/file.h b/gnu/usr.sbin/mkhybrid/src/libfile/file.h
index 37ade99ebfe..a76529e9002 100644
--- a/gnu/usr.sbin/mkhybrid/src/libfile/file.h
+++ b/gnu/usr.sbin/mkhybrid/src/libfile/file.h
@@ -1,6 +1,6 @@
/*
* file.h - definitions for file(1) program
- * @(#)$Id: file.h,v 1.1 2000/10/10 20:40:36 beck Exp $
+ * @(#)$Id: file.h,v 1.2 2008/03/08 15:36:12 espie Exp $
*
* Copyright (c) Ian F. Darwin, 1987.
* Written by Ian F. Darwin.
@@ -88,7 +88,6 @@ struct magic {
# endif
#endif
-extern int init_magic __P((char *));
extern int ascmagic __P((unsigned char *, int));
extern void error __P((const char *, ...));
extern void ckfputs __P((const char *, FILE *));
diff --git a/gnu/usr.sbin/mkhybrid/src/libfile/lfile.c b/gnu/usr.sbin/mkhybrid/src/libfile/lfile.c
index 1d2a7f71725..040e1066e62 100644
--- a/gnu/usr.sbin/mkhybrid/src/libfile/lfile.c
+++ b/gnu/usr.sbin/mkhybrid/src/libfile/lfile.c
@@ -55,11 +55,6 @@
*
* 4. This notice may not be removed or altered.
*/
-#ifndef lint
-static char *moduleid =
- "@(#)$Id: lfile.c,v 1.1 2000/10/10 20:40:36 beck Exp $";
-#endif /* lint */
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -82,6 +77,7 @@ static char *moduleid =
#include "patchlevel.h"
#include "file.h"
+#include "proto.h"
int /* Global command-line options */
#ifdef DEBUG
diff --git a/gnu/usr.sbin/mkhybrid/src/libfile/proto.h b/gnu/usr.sbin/mkhybrid/src/libfile/proto.h
new file mode 100644
index 00000000000..6a8d817d73a
--- /dev/null
+++ b/gnu/usr.sbin/mkhybrid/src/libfile/proto.h
@@ -0,0 +1,25 @@
+/* proto.h */
+/* $OpenBSD: proto.h,v 1.1 2008/03/08 15:36:12 espie Exp $ */
+/*
+ * Copyright (c) 2008 Marc Espie <espie@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef LIBFILE_PROTO_H
+#define LIBFILE_PROTO_H
+
+extern int init_magic(char *);
+extern char *get_magic_match(const char *);
+extern void clean_magic(void);
+
+#endif
diff --git a/gnu/usr.sbin/mkhybrid/src/libfile/softmagic.c b/gnu/usr.sbin/mkhybrid/src/libfile/softmagic.c
index c87571c29ec..5b35cbf5058 100644
--- a/gnu/usr.sbin/mkhybrid/src/libfile/softmagic.c
+++ b/gnu/usr.sbin/mkhybrid/src/libfile/softmagic.c
@@ -41,11 +41,6 @@
#include "file.h"
-#ifndef lint
-static char *moduleid =
- "@(#)$Id: softmagic.c,v 1.2 2008/02/27 09:59:52 espie Exp $";
-#endif /* lint */
-
/* static int match __P((unsigned char *, int)); */
static char *match __P((unsigned char *, int));
static int mget __P((union VALUETYPE *,
diff --git a/gnu/usr.sbin/mkhybrid/src/libhfs_iso/block.c b/gnu/usr.sbin/mkhybrid/src/libhfs_iso/block.c
index 2fce872e45c..9553e60cd51 100644
--- a/gnu/usr.sbin/mkhybrid/src/libhfs_iso/block.c
+++ b/gnu/usr.sbin/mkhybrid/src/libhfs_iso/block.c
@@ -41,7 +41,6 @@ int b_readlb(hfsvol *vol, unsigned long num, block *bp)
#ifdef APPLE_HYB
block *b;
hce_mem *hce;
- int off;
#ifdef DEBUG
fprintf(stderr,"b_readlb: start block = %d\n", vol->vstart + num);
@@ -103,7 +102,6 @@ int b_writelb(hfsvol *vol, unsigned long num, block *bp)
#ifdef APPLE_HYB
block *b;
hce_mem *hce;
- int off;
#ifdef DEBUG
fprintf(stderr,"b_writelb: start block = %d\n", vol->vstart + num);
diff --git a/gnu/usr.sbin/mkhybrid/src/mac_label.c b/gnu/usr.sbin/mkhybrid/src/mac_label.c
index c92d54e0831..0cffafb5285 100644
--- a/gnu/usr.sbin/mkhybrid/src/mac_label.c
+++ b/gnu/usr.sbin/mkhybrid/src/mac_label.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <mkisofs.h>
+#include "mac_label_proto.h"
#include <mac_label.h>
int
diff --git a/gnu/usr.sbin/mkhybrid/src/mac_label.h b/gnu/usr.sbin/mkhybrid/src/mac_label.h
index bea70d4455e..7815d9571cc 100644
--- a/gnu/usr.sbin/mkhybrid/src/mac_label.h
+++ b/gnu/usr.sbin/mkhybrid/src/mac_label.h
@@ -105,18 +105,6 @@ typedef struct {
#define HFS_BB_SIGWORD 0x4c4b
/* borrowed from write.c - we just need parts of this */
-struct deferred_write {
- struct deferred_write * next;
- char * table;
- unsigned int extent;
- unsigned int size;
- char * name;
- struct directory_entry *s_entry;
- unsigned int pad;
- unsigned int off;
-};
-
-typedef struct deferred_write defer;
#ifdef __cplusplus
}
diff --git a/gnu/usr.sbin/mkhybrid/src/mac_label_proto.h b/gnu/usr.sbin/mkhybrid/src/mac_label_proto.h
new file mode 100644
index 00000000000..1e5fec5d96f
--- /dev/null
+++ b/gnu/usr.sbin/mkhybrid/src/mac_label_proto.h
@@ -0,0 +1,40 @@
+/* mac_label_proto.h */
+/* $OpenBSD: mac_label_proto.h,v 1.1 2008/03/08 15:36:12 espie Exp $ */
+/*
+ * Copyright (c) 2008 Marc Espie <espie@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef MAC_LABEL_PROTO_H
+#define MAC_LABEL_PROTO_H
+
+struct deferred_write {
+ struct deferred_write * next;
+ char * table;
+ unsigned int extent;
+ unsigned int size;
+ char * name;
+#ifdef APPLE_HYB
+ struct directory_entry *s_entry;
+ unsigned int pad;
+ unsigned int off;
+#endif
+};
+
+typedef struct deferred_write defer;
+
+extern int gen_mac_label(defer *);
+extern int autostart(void);
+
+#endif
diff --git a/gnu/usr.sbin/mkhybrid/src/match.c b/gnu/usr.sbin/mkhybrid/src/match.c
index e9bb2f0f591..b5904c691c2 100644
--- a/gnu/usr.sbin/mkhybrid/src/match.c
+++ b/gnu/usr.sbin/mkhybrid/src/match.c
@@ -12,11 +12,10 @@
*/
#endif /* APPLE_HYB */
-static char rcsid[] ="$Id: match.c,v 1.2 2002/11/03 20:27:03 pvalchev Exp $";
-
#include "config.h"
#include <prototyp.h>
#include <stdio.h>
+#include <fnmatch.h>
#ifndef VMS
#ifdef HAVE_MALLOC_H
#include <malloc.h>
@@ -65,7 +64,7 @@ char * fn;
register int i;
for (i=0; mat[i] && i<MAXMATCH; i++) {
- if (fnmatch(mat[i], fn, FNM_FILE_NAME) != FNM_NOMATCH) {
+ if (fnmatch(mat[i], fn, FNM_PATHNAME) != FNM_NOMATCH) {
return 1; /* found -> excluded filenmae */
}
}
@@ -108,7 +107,7 @@ char * fn;
register int i;
for (i=0; i_mat[i] && i<MAXMATCH; i++) {
- if (fnmatch(i_mat[i], fn, FNM_FILE_NAME) != FNM_NOMATCH) {
+ if (fnmatch(i_mat[i], fn, FNM_PATHNAME) != FNM_NOMATCH) {
return 1; /* found -> excluded filenmae */
}
}
@@ -158,7 +157,7 @@ char * fn;
register int i;
for (i=0; j_mat[i] && i<MAXMATCH; i++) {
- if (fnmatch(j_mat[i], fn, FNM_FILE_NAME) != FNM_NOMATCH) {
+ if (fnmatch(j_mat[i], fn, FNM_PATHNAME) != FNM_NOMATCH) {
return 1; /* found -> excluded filenmae */
}
}
@@ -228,7 +227,7 @@ char * fn;
register int i;
for (i=0; hfs_mat[i] && i<MAXMATCH; i++) {
- if (fnmatch(hfs_mat[i], fn, FNM_FILE_NAME) != FNM_NOMATCH) {
+ if (fnmatch(hfs_mat[i], fn, FNM_PATHNAME) != FNM_NOMATCH) {
return 1; /* found -> excluded filenmae */
}
}
diff --git a/gnu/usr.sbin/mkhybrid/src/match.h b/gnu/usr.sbin/mkhybrid/src/match.h
index 696028a9551..22affa0c127 100644
--- a/gnu/usr.sbin/mkhybrid/src/match.h
+++ b/gnu/usr.sbin/mkhybrid/src/match.h
@@ -5,11 +5,10 @@
*/
/*
- * $Id: match.h,v 1.3 2008/02/27 09:59:51 espie Exp $
+ * $Id: match.h,v 1.4 2008/03/08 15:36:12 espie Exp $
*/
#include <inttypes.h>
-#include "fnmatch.h"
int matches __PR((char *fn));
diff --git a/gnu/usr.sbin/mkhybrid/src/mkisofs.c b/gnu/usr.sbin/mkhybrid/src/mkisofs.c
index c9fb11d481c..6de6edf9b5c 100644
--- a/gnu/usr.sbin/mkhybrid/src/mkisofs.c
+++ b/gnu/usr.sbin/mkhybrid/src/mkisofs.c
@@ -20,14 +20,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: mkisofs.c,v 1.4 2008/02/27 09:59:51 espie Exp $";
-
/* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 12/3/99 */
#include <errno.h>
#include "config.h"
#include "mkisofs.h"
#include "match.h"
+#include "apple_proto.h"
#ifdef linux
#include <getopt.h>
@@ -55,8 +54,6 @@ static char rcsid[] ="$Id: mkisofs.c,v 1.4 2008/02/27 09:59:51 espie Exp $";
#endif
#include <fctldefs.h>
-#include "exclude.h"
-
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/time.h>
#include <sys/resource.h>
diff --git a/gnu/usr.sbin/mkhybrid/src/multi.c b/gnu/usr.sbin/mkhybrid/src/multi.c
index 150e024abef..96deaf711b3 100644
--- a/gnu/usr.sbin/mkhybrid/src/multi.c
+++ b/gnu/usr.sbin/mkhybrid/src/multi.c
@@ -19,8 +19,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-static char rcsid[] ="$Id: multi.c,v 1.1 2000/10/10 20:40:20 beck Exp $";
-
#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/gnu/usr.sbin/mkhybrid/src/name.c b/gnu/usr.sbin/mkhybrid/src/name.c
index 45b4e92962d..bcc9511a790 100644
--- a/gnu/usr.sbin/mkhybrid/src/name.c
+++ b/gnu/usr.sbin/mkhybrid/src/name.c
@@ -21,8 +21,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: name.c,v 1.1 2000/10/10 20:40:20 beck Exp $";
-
#include "config.h"
#include "mkisofs.h"
diff --git a/gnu/usr.sbin/mkhybrid/src/rock.c b/gnu/usr.sbin/mkhybrid/src/rock.c
index 6eecfe5bef6..5c6ec781e3b 100644
--- a/gnu/usr.sbin/mkhybrid/src/rock.c
+++ b/gnu/usr.sbin/mkhybrid/src/rock.c
@@ -19,8 +19,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: rock.c,v 1.2 2003/05/08 21:04:17 vincent Exp $";
-
#include <stdlib.h>
#include "config.h"
diff --git a/gnu/usr.sbin/mkhybrid/src/tree.c b/gnu/usr.sbin/mkhybrid/src/tree.c
index f740a622b2f..39882c344a1 100644
--- a/gnu/usr.sbin/mkhybrid/src/tree.c
+++ b/gnu/usr.sbin/mkhybrid/src/tree.c
@@ -20,8 +20,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: tree.c,v 1.3 2008/02/27 09:59:51 espie Exp $";
-
/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */
/* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 16/3/1999 */
@@ -32,6 +30,7 @@ static char rcsid[] ="$Id: tree.c,v 1.3 2008/02/27 09:59:51 espie Exp $";
#include <errno.h>
#include "config.h"
+#include "apple_proto.h"
#ifndef VMS
#if defined(MAJOR_IN_SYSMACROS)
@@ -68,8 +67,6 @@ extern char * strdup(const char *);
#include <sys/stat.h>
-#include "exclude.h"
-
#ifdef DOESNT_WORK
#ifdef NON_UNIXFS
@@ -1277,7 +1274,6 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
and not excluded */
if (S_ISREG(lstatbuf.st_mode) && !have_rsrc && apple_both && !x_hfs) {
char rsrc_path[1024]; /* rsrc fork filename */
-/* int htype; */
/* construct the resource full path */
htype = get_hfs_rname(whole_path, short_name, rsrc_path);
@@ -1290,7 +1286,6 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
lstatus = lstat_filter(rsrc_path, &rlstatbuf);
-/* if(!status && !lstatus && S_ISREG(rlstatbuf.st_mode) && rlstatbuf.st_size > 0) { */
if(!status && !lstatus && S_ISREG(rstatbuf.st_mode) && rstatbuf.st_size > 0) {
/* have a resource file - insert it into the current directory
but flag that we have a resource fork */
diff --git a/gnu/usr.sbin/mkhybrid/src/vms.c b/gnu/usr.sbin/mkhybrid/src/vms.c
index 52e1c6a6ddb..ac60a7f827c 100644
--- a/gnu/usr.sbin/mkhybrid/src/vms.c
+++ b/gnu/usr.sbin/mkhybrid/src/vms.c
@@ -4,8 +4,6 @@
Written by Eric Youngdale (1993).
*/
-static char rcsid[] ="$Id: vms.c,v 1.1 2000/10/10 20:40:21 beck Exp $";
-
#ifdef VMS
#include <rms.h>
#include <descrip.h>
diff --git a/gnu/usr.sbin/mkhybrid/src/volume.c b/gnu/usr.sbin/mkhybrid/src/volume.c
index 8416cd5aa1a..6f445bac08d 100644
--- a/gnu/usr.sbin/mkhybrid/src/volume.c
+++ b/gnu/usr.sbin/mkhybrid/src/volume.c
@@ -15,6 +15,8 @@
#include "config.h"
#include "mkisofs.h"
+#include "volume.h"
+#include "write.h"
#include <errno.h>
static hfsvol *vol_save = 0; /* used to "destroy" an HFS volume */
@@ -80,7 +82,7 @@ XClpSiz(int vlen)
int
get_vol_size(int vblen)
{
- int drXTClpSiz, new_drXTClpSiz, drAlBlkSiz;
+ int drXTClpSiz, drAlBlkSiz;
int new_vblen;
/* try to estimate a "volume size" based on the code
diff --git a/gnu/usr.sbin/mkhybrid/src/volume.h b/gnu/usr.sbin/mkhybrid/src/volume.h
new file mode 100644
index 00000000000..9f0b854dd8f
--- /dev/null
+++ b/gnu/usr.sbin/mkhybrid/src/volume.h
@@ -0,0 +1,23 @@
+/* volume.h */
+/* $OpenBSD: volume.h,v 1.1 2008/03/08 15:36:12 espie Exp $ */
+/*
+ * Copyright (c) 2008 Marc Espie <espie@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef VOLUME_H
+#define VOLUME_H
+
+extern int make_mac_volume(struct directory *, int);
+#endif
diff --git a/gnu/usr.sbin/mkhybrid/src/write.c b/gnu/usr.sbin/mkhybrid/src/write.c
index d132819b34e..49b2ccd9aa6 100644
--- a/gnu/usr.sbin/mkhybrid/src/write.c
+++ b/gnu/usr.sbin/mkhybrid/src/write.c
@@ -19,14 +19,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: write.c,v 1.2 2008/02/27 09:59:51 espie Exp $";
-
/* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 16/3/1999 */
#include <string.h>
#include <stdlib.h>
+#include <err.h>
#include "config.h"
#include "mkisofs.h"
#include "iso9660.h"
+#include "volume.h"
+#include "write.h"
+#include "apple_proto.h"
+#include "mac_label_proto.h"
#include <time.h>
#include <errno.h>
@@ -169,20 +172,6 @@ void FDECL4(xfwrite, void *, buffer, int, count, int, size, FILE *, file)
}
}
-struct deferred_write
-{
- struct deferred_write * next;
- char * table;
- unsigned int extent;
- unsigned int size;
- char * name;
-#ifdef APPLE_HYB
- struct directory_entry *s_entry;
- unsigned int pad;
- unsigned int off;
-#endif /* APPLE_HYB */
-};
-
#ifdef APPLE_HYB
/* use the deferred_write struct to store info about the hfs_boot_file */
static struct deferred_write mac_boot;
@@ -1556,7 +1545,7 @@ static int file_gen()
/* exit with the error */
if (*hce->error)
fprintf(stderr, "%s\n", hce->error);
- perr(hfs_error);
+ err(1, hfs_error);
}
else
{
@@ -1586,14 +1575,14 @@ static int file_gen()
if (gen_mac_label(&mac_boot)) {
if (*hce->error)
fprintf(stderr, "%s\n", hce->error);
- perr(hfs_error);
+ err(1, hfs_error);
}
}
/* set Autostart filename if required */
if (autoname) {
if(autostart())
- perr("Autostart filename must less than 12 characters");
+ errx(1, "Autostart filename must less than 12 characters");
}
/* finished with any HFS type errors */
diff --git a/gnu/usr.sbin/mkhybrid/src/write.h b/gnu/usr.sbin/mkhybrid/src/write.h
new file mode 100644
index 00000000000..3e7a2d64e1f
--- /dev/null
+++ b/gnu/usr.sbin/mkhybrid/src/write.h
@@ -0,0 +1,28 @@
+/* write.h */
+/* $OpenBSD: write.h,v 1.1 2008/03/08 15:36:12 espie Exp $ */
+/*
+ * Copyright (c) 2008 Marc Espie <espie@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef WRITE_H
+#define WRITE_H
+
+struct directory;
+
+extern int get_adj_size(int);
+extern int adj_size(int, int, int);
+extern void adj_size_other(struct directory *);
+
+#endif