1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00
freebsd/gnu/usr.bin/mkisofs/exclude.c
Jordan K. Hubbard 6f50ceba0f Original virgin sources for version 1.2 of mkisofs, by Eric Youngdale of
Yggdrasil Computing Inc.  This is a useful concession to us CDROM mastering
weenies out here.
Obtained from: Yggdrasil Computing, Inc.
1995-02-12 08:00:42 +00:00

55 lines
1.0 KiB
C

/*
* 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de:
* added 'exclude' option (-x) to specify pathnames NOT to be included in
* CD image.
*/
#include <stdio.h>
#ifndef VMS
#ifdef HASMALLOC_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] = 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 */
}