home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
unix
/
unix_cap.sit
/
UNIX-CAP
next >
Wrap
Text File
|
1989-07-03
|
80KB
|
3,072 lines
CAP is a set of UNIX programs from Columbia University that allow UNIX machines
to act as AppleShare file servers and LaserWriter spoolers. It also provides
a set of libraries for programmer to write their own AppleTalk applications.
CAP requires a Kinetic FastPath running the KIP code from Stanford or the
K-Star code from Kinetics, which both encapsulate the AppleTalk packets in
UDP before putting them on the ethernet.
Here are a bunch of useful patches to the CAP 5.0 software. Here is what the
included README says:
1) In AUFS, #ifdef SIZESERVER lines that allow 4.3BSD systems to show volume
info (previously distributed as sizeserver.shar; needs additional code to
use this).
2) In AUFS, #ifdef NOCASEMATCH lines that fixes the case sensitivity of UNIX
(Mac filesystems are case-insensitive). There is some performance degradation,
especially when the filename to search for has modified case, like the way
HyperCard 1.2.1 changes the case of letters in a stack name.
3) CAP now compilies under GCC. Various changes were made to fix incompatibil-
ities with the preprocessors, as well as to silence various warning messages.
The -DGNUCC flags needs to be given to the compiler.
4) On NeXT machines (with GCC), Configure has been modified so that "next" can
be given as an OS type. It automatically adds -DGNUCC to the C compilier
flags. (I don't know how to detect a NeXT machine in the Configure script,
especially since the entire filesystem may change between 0.8 and 0.9.)
5) Various minor code enhancements, with no change in functionality.
Edward Moy Principal Programmer - Macintosh & Unix
Workstation Support Services Workstation Software Support Group
University of California
Berkeley, CA 94720
edmoy@violet.Berkeley.EDU
ucbvax!violet!edmoy
----------- cut --------------------- cut ------------------ cut ------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# README
# Configure.diff
# abasp.c.diff
# abatp.c.diff
# abkip.c.diff
# afpc.c.diff
# afpcmd.h.diff
# afpdid.c.diff
# afpdir.c.diff
# afpdt.c.diff
# afpos.c.diff
# afposenum.c.diff
# afposfi.c.diff
# afps.h.diff
# afpserver.c.diff
# atalkdbm.c.diff
# atis.c.diff
# papof.c.diff
# CAP patches - archive created: Thu Feb 9 21:21:27 PST 1989
if test -f README
then
echo shar: will not overwrite existing file "'README'"
else
echo 'x - README'
cat << \RAZZLE!DAZZLE > README
The patches included in this distribution contain the following:
1) In AUFS, #ifdef SIZESERVER lines that allow 4.3BSD systems to show volume
info (previously distributed as sizeserver.shar; needs additional code to
use this).
2) In AUFS, #ifdef NOCASEMATCH lines that fixes the case sensitivity of UNIX
(Mac filesystems are case-insensitive). There is some performance degradation,
especially when the filename to search for has modified case, like the way
HyperCard 1.2.1 changes the case of letters in a stack name.
3) CAP now compilies under GCC. Various changes were made to fix incompatibil-
ities with the preprocessors, as well as to silence various warning messages.
The -DGNUCC flags needs to be given to the compiler.
4) On NeXT machines (with GCC), Configure has been modified so that "next" can
be given as an OS type. It automatically adds -DGNUCC to the C compilier
flags. (I don't know how to detect a NeXT machine in the Configure script,
especially since the entire filesystem may change between 0.8 and 0.9.)
5) Various minor code enhancements, with no change in functionality.
Edward Moy Principal Programmer - Macintosh & Unix
Workstation Support Services Workstation Software Support Group
University of California
Berkeley, CA 94720
edmoy@violet.Berkeley.EDU
ucbvax!violet!edmoy
RAZZLE!DAZZLE
fi # End README
if test -f Configure.diff
then
echo shar: will not overwrite existing file "'Configure.diff'"
else
echo 'x - Configure.diff'
cat << \RAZZLE!DAZZLE > Configure.diff
*** Configure.orig Thu Feb 9 21:01:00 1989
--- Configure Thu Feb 9 21:01:50 1989
***************
*** 141,146
"aux") valid=1;;
"pyr") valid=1;;
"sunos") valid=1;;
"?"|*)
if [ "${os}" != "?" ]; then
echo "unknown type ${os}, valid are:"
--- 141,147 -----
"aux") valid=1;;
"pyr") valid=1;;
"sunos") valid=1;;
+ "next") valid=1;;
"?"|*)
if [ "${os}" != "?" ]; then
echo "unknown type ${os}, valid are:"
***************
*** 152,157
echo " aux - A/UX";
echo " pyr - pyramid";
echo " sunos - suns";
;;
esac
done
--- 153,159 -----
echo " aux - A/UX";
echo " pyr - pyramid";
echo " sunos - suns";
+ echo " next - NeXT/MACH";
;;
esac
done
***************
*** 299,304
# "aux" - A/UX
# "pyr" - pyramid (in BSD universe)
# "sunos" - SunOS
# Warning: hpux, pyr are hardcoded in some of the makefiles (sorry)
# MAJOR CONFIGURATION
--- 301,307 -----
# "aux" - A/UX
# "pyr" - pyramid (in BSD universe)
# "sunos" - SunOS
+ # "next" - NeXT/MACH
# Warning: hpux, pyr are hardcoded in some of the makefiles (sorry)
# MAJOR CONFIGURATION
***************
*** 448,453
os,[hpux],[HP-UX (for 9000 series)],
os,[bsd],[Standard BSD],
os,[pyr],[Pyramid in BSD universe],
[Unknown]))
define([cflags],ifdef([selfdefinetypes],[-O -D_TYPES],[-O]))
define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000]))
--- 451,457 -----
os,[hpux],[HP-UX (for 9000 series)],
os,[bsd],[Standard BSD],
os,[pyr],[Pyramid in BSD universe],
+ os,[next],[NeXT/MACH],
[Unknown]))
define([cflags],ifdef([selfdefinetypes],[-O -D_TYPES],[-O]))
define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000]))
***************
*** 453,458
define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000]))
ifelse(os,[pyr],[
define([cflags],concat(cflags,[ -q]))])
# was used for nbp, but found we needed more... leave in case
define([nbpflags],[])
--- 457,464 -----
define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000]))
ifelse(os,[pyr],[
define([cflags],concat(cflags,[ -q]))])
+ ifelse(os,[next],[
+ define([cflags],concat(cflags,[ -DGNUCC]))])
# was used for nbp, but found we needed more... leave in case
define([nbpflags],[])
RAZZLE!DAZZLE
fi # End Configure.diff
if test -f abasp.c.diff
then
echo shar: will not overwrite existing file "'abasp.c.diff'"
else
echo 'x - abasp.c.diff'
cat << \RAZZLE!DAZZLE > abasp.c.diff
*** lib/cap/abasp.c.orig Thu May 19 12:16:31 1988
--- lib/cap/abasp.c Fri Jan 27 14:50:59 1989
***************
*** 25,33
#include "abasp.h"
int aspInit();
! SPGetParms();
! SPInit();
! SPGetNetworkInfo();
private void handle_aspserver();
private void asp_doopensess();
private void sessopenreply();
--- 25,33 -----
#include "abasp.h"
int aspInit();
! int SPGetParms();
! int SPInit();
! int SPGetNetworkInfo();
private void handle_aspserver();
private void asp_doopensess();
private void sessopenreply();
***************
*** 31,41
private void handle_aspserver();
private void asp_doopensess();
private void sessopenreply();
! SPGetSession();
! SPCloseSession();
! SPGetRequest();
! SPCmdReply();
! SPWrtReply();
private int spreply();
SPWrtContinue();
SPNewStatus();
--- 31,41 -----
private void handle_aspserver();
private void asp_doopensess();
private void sessopenreply();
! int SPGetSession();
! int SPCloseSession();
! int SPGetRequest();
! int SPCmdReply();
! int SPWrtReply();
private int spreply();
int SPWrtContinue();
int SPNewStatus();
***************
*** 37,45
SPCmdReply();
SPWrtReply();
private int spreply();
! SPWrtContinue();
! SPNewStatus();
! SPAttention();
SPGetStatus();
SPOpenSession();
--- 37,45 -----
int SPCmdReply();
int SPWrtReply();
private int spreply();
! int SPWrtContinue();
! int SPNewStatus();
! int SPAttention();
int SPGetStatus();
int SPOpenSession();
***************
*** 41,48
SPNewStatus();
SPAttention();
! SPGetStatus();
! SPOpenSession();
private void handle_aspclient();
SPCommand();
SPWrite();
--- 41,48 -----
int SPNewStatus();
int SPAttention();
! int SPGetStatus();
! int SPOpenSession();
private void handle_aspclient();
int SPCommand();
int SPWrite();
***************
*** 44,51
SPGetStatus();
SPOpenSession();
private void handle_aspclient();
! SPCommand();
! SPWrite();
private void asp_do_write();
private void handle_asp_sndreq();
--- 44,51 -----
int SPGetStatus();
int SPOpenSession();
private void handle_aspclient();
! int SPCommand();
! int SPWrite();
private void asp_do_write();
private void handle_asp_sndreq();
RAZZLE!DAZZLE
fi # End abasp.c.diff
if test -f abatp.c.diff
then
echo shar: will not overwrite existing file "'abatp.c.diff'"
else
echo 'x - abatp.c.diff'
cat << \RAZZLE!DAZZLE > abatp.c.diff
*** lib/cap/abatp.c.orig Thu May 19 12:16:35 1988
--- lib/cap/abatp.c Fri Jan 27 14:49:11 1989
***************
*** 83,88
{(caddr_t)&atph, atpSize}, /* atp */
{(caddr_t)atpdata, atpMaxData} /* atp user data */
};
/*
* ATPSndRequest
--- 83,90 -----
{(caddr_t)&atph, atpSize}, /* atp */
{(caddr_t)atpdata, atpMaxData} /* atp user data */
};
+ private delete_tcb_skt();
+ private int ATPWrite();
/*
* ATPSndRequest
RAZZLE!DAZZLE
fi # End abatp.c.diff
if test -f abkip.c.diff
then
echo shar: will not overwrite existing file "'abkip.c.diff'"
else
echo 'x - abkip.c.diff'
cat << \RAZZLE!DAZZLE > abkip.c.diff
*** lib/cap/abkip.c.orig Thu May 19 12:16:50 1988
--- lib/cap/abkip.c Fri Jan 27 14:55:42 1989
***************
*** 278,284
return(ddpSktErr);
for (i=0; i < 128; i++,ipskt++,(*skt)++) {
lsin.sin_port = htons(ipskt);
! if ((err = bind(fd, (caddr_t)&lsin, sizeof(lsin))) == 0)
break;
if (rskt != 0) /* bind failed and wanted exact? */
return(err); /* yes... */
--- 278,284 -----
return(ddpSktErr);
for (i=0; i < 128; i++,ipskt++,(*skt)++) {
lsin.sin_port = htons(ipskt);
! if ((err = bind(fd, (struct sockaddr *)&lsin, sizeof(lsin))) == 0)
break;
if (rskt != 0) /* bind failed and wanted exact? */
return(err); /* yes... */
RAZZLE!DAZZLE
fi # End abkip.c.diff
if test -f afpc.c.diff
then
echo shar: will not overwrite existing file "'afpc.c.diff'"
else
echo 'x - afpc.c.diff'
cat << \RAZZLE!DAZZLE > afpc.c.diff
*** lib/afpc/afpc.c.orig Thu May 19 12:17:22 1988
--- lib/afpc/afpc.c Thu Jan 26 15:36:31 1989
***************
*** 286,292
{
char lbuf[sizeof(FlushPkt)+1];
int len;
! extern PackEntry ProtoFVP[];
len = htonPackX(ProtoCFP, fv, lbuf);
--- 286,292 -----
{
char lbuf[sizeof(FlushPkt)+1];
int len;
! extern PackEntry ProtoCFP[];
len = htonPackX(ProtoCFP, fv, lbuf);
***************
*** 319,325
char lbuf[sizeof(GetAPPLPkt)+1];
char buf[sizeof(GetAPPLReplyPkt)+1];
int rlen, comp, len;
! extern PackEntry ProtoGAP[], ProtoGAPR[];
len = htonPackX(ProtoGAP, gap, lbuf);
SPCommand(srn,lbuf,len,buf,sizeof(GetAPPLReplyPkt),cr,&rlen,-1,&comp);
--- 319,325 -----
char lbuf[sizeof(GetAPPLPkt)+1];
char buf[sizeof(GetAPPLReplyPkt)+1];
int rlen, comp, len;
! extern PackEntry ProtoGAP[], ProtoGAPR[], ProtoFileAttr[];
len = htonPackX(ProtoGAP, gap, lbuf);
SPCommand(srn,lbuf,len,buf,sizeof(GetAPPLReplyPkt),cr,&rlen,-1,&comp);
***************
*** 714,720
word *refnum;
dword *cr;
{
! extern PackEntry ProtoOFkP[];
byte lbuf[sizeof(OpenForkPkt)], buf[sizeof(FileDirParm)+20], *p;
int rlen, comp, len;
word bitmap;
--- 714,720 -----
word *refnum;
dword *cr;
{
! extern PackEntry ProtoOFkP[], ProtoFileAttr[];
byte lbuf[sizeof(OpenForkPkt)], buf[sizeof(FileDirParm)+20], *p;
int rlen, comp, len;
word bitmap;
RAZZLE!DAZZLE
fi # End afpc.c.diff
if test -f afpcmd.h.diff
then
echo shar: will not overwrite existing file "'afpcmd.h.diff'"
else
echo 'x - afpcmd.h.diff'
cat << \RAZZLE!DAZZLE > afpcmd.h.diff
*** netat/afpcmd.h.orig Thu May 19 12:16:16 1988
--- netat/afpcmd.h Fri Jan 27 12:52:44 1989
***************
*** 624,629
/* Pack(pointer, type of data, scalar result field) */
#define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0}
/* Paks(pointer, type of data, array result field) */
#define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0}
/* Both require that a "type of data" field type P_BMAP be set first */
/* pakb(pointer, type of data, scalar result field, bit of bitmap */
--- 624,632 -----
/* Pack(pointer, type of data, scalar result field) */
#define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0}
/* Paks(pointer, type of data, array result field) */
+ #ifdef GNUCC
+ #define PAKS(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0}
+ #else GNUCC
#define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0}
#endif GNUCC
/* Both require that a "type of data" field type P_BMAP be set first */
***************
*** 625,630
#define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0}
/* Paks(pointer, type of data, array result field) */
#define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0}
/* Both require that a "type of data" field type P_BMAP be set first */
/* pakb(pointer, type of data, scalar result field, bit of bitmap */
#define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
--- 628,634 -----
#define PAKS(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0}
#else GNUCC
#define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0}
+ #endif GNUCC
/* Both require that a "type of data" field type P_BMAP be set first */
/* pakb(pointer, type of data, scalar result field, bit of bitmap */
#define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
***************
*** 629,634
/* pakb(pointer, type of data, scalar result field, bit of bitmap */
#define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
/* pksb(pointer, type of data, array result field, bit of bitmap */
#define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b}
/* Pack even - to mark that we should be on even boundary */
--- 633,641 -----
/* pakb(pointer, type of data, scalar result field, bit of bitmap */
#define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
/* pksb(pointer, type of data, array result field, bit of bitmap */
+ #ifdef GNUCC
+ #define PKSB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
+ #else GNUCC
#define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b}
#endif GNUCC
***************
*** 630,635
#define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
/* pksb(pointer, type of data, array result field, bit of bitmap */
#define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b}
/* Pack even - to mark that we should be on even boundary */
#define PACKEVEN() {P_EVEN, 0, 0, 0}
--- 637,643 -----
#define PKSB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b}
#else GNUCC
#define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b}
+ #endif GNUCC
/* Pack even - to mark that we should be on even boundary */
#define PACKEVEN() {P_EVEN, 0, 0, 0}
RAZZLE!DAZZLE
fi # End afpcmd.h.diff
if test -f afpdid.c.diff
then
echo shar: will not overwrite existing file "'afpdid.c.diff'"
else
echo 'x - afpdid.c.diff'
cat << \RAZZLE!DAZZLE > afpdid.c.diff
*** applications/aufs/afpdid.c.orig Thu May 19 12:19:31 1988
--- applications/aufs/afpdid.c Thu Jan 26 18:19:33 1989
***************
*** 85,90
int xd_idsize; /* size of idirs array */
} ExtDir;
/*
* nfind scans and finds whether a particular directory "dir" has a
* subdirectory by the name "nam"
--- 85,93 -----
int xd_idsize; /* size of idirs array */
} ExtDir;
+ private char *ipathstr();
+ private sdword NewEDirid();
+
/*
* nfind scans and finds whether a particular directory "dir" has a
* subdirectory by the name "nam"
***************
*** 112,118
char *name;
{
IDirP dir;
- sdword NewEDirid();
dir = (IDirP) malloc(sizeof(IDir));
dir->name = (char *) malloc((unsigned) strlen(name)+1);
--- 115,120 -----
char *name;
{
IDirP dir;
dir = (IDirP) malloc(sizeof(IDir));
dir->name = (char *) malloc((unsigned) strlen(name)+1);
***************
*** 162,168
IDirP cd;
{
static char paths[MAXPATHLEN];
- char *ipathstr();
if (lastcd == cd) /* same as last request? */
return(paths); /* yes.. just return old paths */
--- 164,169 -----
IDirP cd;
{
static char paths[MAXPATHLEN];
if (lastcd == cd) /* same as last request? */
return(paths); /* yes.. just return old paths */
RAZZLE!DAZZLE
fi # End afpdid.c.diff
if test -f afpdir.c.diff
then
echo shar: will not overwrite existing file "'afpdir.c.diff'"
else
echo 'x - afpdir.c.diff'
cat << \RAZZLE!DAZZLE > afpdir.c.diff
*** applications/aufs/afpdir.c.orig Thu May 19 12:19:33 1988
--- applications/aufs/afpdir.c Thu Jan 26 18:17:19 1989
***************
*** 43,48
#include "afpntoh.h"
#include "afps.h" /* common server header */
/*
* OSErr FPGetDirParms(byte *p,byte *r,int *rl)
*
--- 43,50 -----
#include "afpntoh.h"
#include "afps.h" /* common server header */
+ private int EnumPack();
+
/*
* OSErr FPGetDirParms(byte *p,byte *r,int *rl)
*
RAZZLE!DAZZLE
fi # End afpdir.c.diff
if test -f afpdt.c.diff
then
echo shar: will not overwrite existing file "'afpdt.c.diff'"
else
echo 'x - afpdt.c.diff'
cat << \RAZZLE!DAZZLE > afpdt.c.diff
*** applications/aufs/afpdt.c.orig Thu May 19 12:19:36 1988
--- applications/aufs/afpdt.c Thu Jan 26 18:15:43 1989
***************
*** 81,86
#define REMOVEAPPLIDB 0
#define REMOVEICONIDB 1
/*
* PrintINode(AVLUData *node)
*
--- 81,88 -----
#define REMOVEAPPLIDB 0
#define REMOVEICONIDB 1
+ private ReadIDesk(), ReadADesk();
+
/*
* PrintINode(AVLUData *node)
*
RAZZLE!DAZZLE
fi # End afpdt.c.diff
if test -f afpos.c.diff
then
echo shar: will not overwrite existing file "'afpos.c.diff'"
else
echo 'x - afpos.c.diff'
cat << \RAZZLE!DAZZLE > afpos.c.diff
*** applications/aufs/afpos.c.orig Mon Jun 27 12:26:51 1988
--- applications/aufs/afpos.c Thu Jan 26 18:10:22 1989
***************
*** 112,118
# ifdef Q_GETQUOTA
# define Q_GETDLIM Q_GETQUOTA
# else
! You have turned on quotas and aren't using the bsd or sun quota system
# endif /*Q_GETQUOTA*/
# endif /* Q_GETDLIM */
#endif /* USEQUOTA */
--- 112,118 -----
# ifdef Q_GETQUOTA
# define Q_GETDLIM Q_GETQUOTA
# else
! /* You have turned on quotas and aren't using the bsd or sun quota system */
# endif /*Q_GETQUOTA*/
# endif /* Q_GETDLIM */
#endif /* USEQUOTA */
***************
*** 135,140
#include "afppasswd.h" /* in case we are using privates */
#include "afposncs.h"
#include "afpgc.h"
#ifdef MAXBSIZE
# define IOBSIZE MAXBSIZE /* set to max buf entry size by if there */
--- 135,146 -----
#include "afppasswd.h" /* in case we are using privates */
#include "afposncs.h"
#include "afpgc.h"
+ #ifdef SIZESERVER
+ #include <setjmp.h>
+ #include <signal.h>
+ #include <sys/socket.h>
+ #include "sizeserver.h"
+ #endif SIZESERVER
#ifdef MAXBSIZE
# define IOBSIZE MAXBSIZE /* set to max buf entry size by if there */
***************
*** 282,287
private OSErr ItoEErr();
private int filemode();
private char *syserr();
/*
* Enable OS Dependent functions
--- 288,296 -----
private OSErr ItoEErr();
private int filemode();
private char *syserr();
+ #ifdef SIZESERVER
+ private void getvolsize();
+ #endif SIZESERVER
/*
* Enable OS Dependent functions
***************
*** 545,550
char path[MAXPATHLEN];
OSfname(path,ipdir,file,F_DATA); /* create data fork name */
if (DBOSI)
printf("OSDelete file=%s\n",path);
--- 554,562 -----
char path[MAXPATHLEN];
OSfname(path,ipdir,file,F_DATA); /* create data fork name */
+ #ifdef NOCASEMATCH
+ noCaseMatch(path);
+ #endif NOCASEMATCH
if (DBOSI)
printf("OSDelete file=%s\n",path);
***************
*** 667,672
int typ;
{
char path[MAXPATHLEN];
OSfname(path,pdir,file,typ); /* build unix file name */
return(unix_unlink(path)); /* do the work... */
--- 679,687 -----
int typ;
{
char path[MAXPATHLEN];
+ #ifdef NOCASEMATCH
+ register int i;
+ #endif NOCASEMATCH
OSfname(path,pdir,file,typ); /* build unix file name */
#ifdef NOCASEMATCH
***************
*** 669,674
char path[MAXPATHLEN];
OSfname(path,pdir,file,typ); /* build unix file name */
return(unix_unlink(path)); /* do the work... */
}
--- 684,696 -----
#endif NOCASEMATCH
OSfname(path,pdir,file,typ); /* build unix file name */
+ #ifdef NOCASEMATCH
+ if((i = unix_unlink(path)) != noErr) {
+ noCaseMatch(path);
+ i = unix_unlink(path);
+ }
+ return(i); /* do the work... */
+ #else NOCASEMATCH
return(unix_unlink(path)); /* do the work... */
#endif NOCASEMATCH
}
***************
*** 670,675
OSfname(path,pdir,file,typ); /* build unix file name */
return(unix_unlink(path)); /* do the work... */
}
--- 692,698 -----
return(i); /* do the work... */
#else NOCASEMATCH
return(unix_unlink(path)); /* do the work... */
+ #endif NOCASEMATCH
}
***************
*** 743,748
IDirP fpdir,tpdir; /* from and to parent dirs */
char *from,*to; /* from and to file names */
{
char fpath[MAXPATHLEN];
char tpath[MAXPATHLEN];
struct stat stb;
--- 766,773 -----
IDirP fpdir,tpdir; /* from and to parent dirs */
char *from,*to; /* from and to file names */
{
+ char f_path[MAXPATHLEN];
+ char t_path[MAXPATHLEN];
char fpath[MAXPATHLEN];
char tpath[MAXPATHLEN];
struct stat stb;
***************
*** 748,753
struct stat stb;
int err,cerr;
int mo;
OSfname(fpath,fpdir,from,F_DATA); /* build data file name */
OSfname(tpath,tpdir,to,F_DATA); /* for from and to files */
--- 773,781 -----
struct stat stb;
int err,cerr;
int mo;
+ #ifdef NOCASEMATCH
+ register char *pp;
+ #endif NOCASEMATCH
OSfname(f_path,fpdir,from,F_DATA); /* build data file name */
OSfname(t_path,tpdir,to,F_DATA); /* for from and to files */
***************
*** 749,756
int err,cerr;
int mo;
! OSfname(fpath,fpdir,from,F_DATA); /* build data file name */
! OSfname(tpath,tpdir,to,F_DATA); /* for from and to files */
if (DBOSI)
printf("OSRename from=%s, to=%s\n",fpath,tpath);
--- 777,784 -----
register char *pp;
#endif NOCASEMATCH
! OSfname(f_path,fpdir,from,F_DATA); /* build data file name */
! OSfname(t_path,tpdir,to,F_DATA); /* for from and to files */
if (DBOSI)
printf("OSRename from=%s, to=%s\n",f_path,t_path);
***************
*** 753,759
OSfname(tpath,tpdir,to,F_DATA); /* for from and to files */
if (DBOSI)
! printf("OSRename from=%s, to=%s\n",fpath,tpath);
if ((fpdir->flags & DID_FINDERINFO) && (tpdir->flags & DID_FINDERINFO) == 0)
return(aeCantMove);
--- 781,787 -----
OSfname(t_path,tpdir,to,F_DATA); /* for from and to files */
if (DBOSI)
! printf("OSRename from=%s, to=%s\n",f_path,t_path);
if ((fpdir->flags & DID_FINDERINFO) && (tpdir->flags & DID_FINDERINFO) == 0)
return(aeCantMove);
***************
*** 761,766
return(aeCantMove);
/* must be able to stat destination */
if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
return(err);
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
--- 789,801 -----
return(aeCantMove);
/* must be able to stat destination */
+ #ifdef NOCASEMATCH
+ if ((err = unix_stat(pp = pathstr(tpdir), &stb)) != noErr) {
+ noCaseFind(pp);
+ if ((err = unix_stat(pp, &stb)) != noErr)
+ return(err);
+ }
+ #else NOCASEMATCH
if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
return(err);
#endif NOCASEMATCH
***************
*** 763,768
/* must be able to stat destination */
if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
return(err);
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
if ((err = unix_stat(fpath,&stb)) != noErr)
--- 798,804 -----
#else NOCASEMATCH
if ((err = unix_stat(pathstr(tpdir), &stb)) != noErr)
return(err);
+ #endif NOCASEMATCH
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
#ifdef NOCASEMATCH
***************
*** 765,771
return(err);
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
! if ((err = unix_stat(fpath,&stb)) != noErr)
return(err);
err = unix_rename(fpath,tpath); /* give unix the args */
--- 801,815 -----
#endif NOCASEMATCH
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
! #ifdef NOCASEMATCH
! if ((err = unix_stat(f_path,&stb)) != noErr) {
! noCaseFind(f_path);
! if ((err = unix_stat(f_path,&stb)) != noErr)
! return(err);
! }
! noCaseMatch(t_path);
! #else NOCASEMATCH
! if ((err = unix_stat(f_path,&stb)) != noErr)
return(err);
#endif NOCASEMATCH
***************
*** 767,772
if ((err = unix_stat(fpath,&stb)) != noErr)
return(err);
err = unix_rename(fpath,tpath); /* give unix the args */
if (err != noErr) /* if an error on data files */
--- 811,817 -----
#else NOCASEMATCH
if ((err = unix_stat(f_path,&stb)) != noErr)
return(err);
+ #endif NOCASEMATCH
err = unix_rename(f_path,t_path); /* give unix the args */
if (err != noErr) /* if an error on data files */
***************
*** 768,774
if ((err = unix_stat(fpath,&stb)) != noErr)
return(err);
! err = unix_rename(fpath,tpath); /* give unix the args */
if (err != noErr) /* if an error on data files */
return(err); /* then give up */
--- 813,819 -----
return(err);
#endif NOCASEMATCH
! err = unix_rename(f_path,t_path); /* give unix the args */
if (err != noErr) /* if an error on data files */
return(err); /* then give up */
***************
*** 775,782
if (!S_ISDIR(stb.st_mode)) { /* directories have no rsrc fork */
unix_chmod(tpath, mo); /* file: try to reset protection */
if (fpdir->flags & DID_RESOURCE) {
! OSfname(fpath,fpdir,from,F_RSRC); /* build resource file names */
! OSfname(tpath,tpdir,to,F_RSRC);
err = unix_rename(fpath,tpath); /* give unix a shot at it */
/* allow non-existant resource */
if (err != noErr && err != aeObjectNotFound) { /* error on rename? */
--- 820,829 -----
if (!S_ISDIR(stb.st_mode)) { /* directories have no rsrc fork */
unix_chmod(tpath, mo); /* file: try to reset protection */
if (fpdir->flags & DID_RESOURCE) {
! strcpy(fpath, f_path);
! strcpy(tpath, t_path);
! toResFork(fpath,from); /* build resource file names */
! toResFork(tpath,to);
err = unix_rename(fpath,tpath); /* give unix a shot at it */
/* allow non-existant resource */
if (err != noErr && err != aeObjectNotFound) { /* error on rename? */
***************
*** 783,791
if (DBOSI)
printf("os_rename: failed %s for %s -> %s\n",
afperr(err),fpath,tpath);
! OSfname(fpath,fpdir,from,F_DATA); /* try to rebuild */
! OSfname(tpath,tpdir,to,F_DATA);
! cerr = unix_rename(tpath,fpath); /* rename back to orignal */
if (cerr != noErr && DBOSI)
printf("os_rename: cleanup failed\n");
unix_chmod(tpath, stb.st_mode&0777); /* file:try to reset protection */
--- 830,836 -----
if (DBOSI)
printf("os_rename: failed %s for %s -> %s\n",
afperr(err),fpath,tpath);
! cerr = unix_rename(t_path,f_path); /* rename back to orignal */
if (cerr != noErr && DBOSI)
printf("os_rename: cleanup failed\n");
unix_chmod(t_path, stb.st_mode&0777); /* file:try to reset protection */
***************
*** 788,794
cerr = unix_rename(tpath,fpath); /* rename back to orignal */
if (cerr != noErr && DBOSI)
printf("os_rename: cleanup failed\n");
! unix_chmod(tpath, stb.st_mode&0777); /* file:try to reset protection */
return(err);
}
}
--- 833,839 -----
cerr = unix_rename(t_path,f_path); /* rename back to orignal */
if (cerr != noErr && DBOSI)
printf("os_rename: cleanup failed\n");
! unix_chmod(t_path, stb.st_mode&0777); /* file:try to reset protection */
return(err);
}
}
***************
*** 795,802
}
if (fpdir->flags & DID_FINDERINFO) {
! OSfname(fpath,fpdir,from,F_FNDR); /* build finder info file names */
! OSfname(tpath,tpdir,to,F_FNDR);
err = unix_rename(fpath,tpath); /* give unix a shot at it */
if (err != noErr && DBOSI) {
printf("os_rename: failed %s for %s -> %s\n", afperr(err),fpath,tpath);
--- 840,849 -----
}
if (fpdir->flags & DID_FINDERINFO) {
! strcpy(fpath, f_path);
! strcpy(tpath, t_path);
! toFinderInfo(fpath,from); /* build finder info file names */
! toFinderInfo(tpath,to);
err = unix_rename(fpath,tpath); /* give unix a shot at it */
if (err != noErr && DBOSI) {
printf("os_rename: failed %s for %s -> %s\n", afperr(err),fpath,tpath);
***************
*** 1047,1052
/* want path/name */
OSfname(path, pdir, name, F_DATA); /* get path/name */
switch (typ) {
case F_RSRC:
strcat(path, "/");
--- 1094,1102 -----
/* want path/name */
OSfname(path, pdir, name, F_DATA); /* get path/name */
+ #ifdef NOCASEMATCH
+ noCaseMatch(path);
+ #endif NOCASEMATCH
switch (typ) {
case F_RSRC:
strcat(path, RFDIR);
***************
*** 1049,1056
OSfname(path, pdir, name, F_DATA); /* get path/name */
switch (typ) {
case F_RSRC:
! strcat(path, "/");
! strcat(path, RFDIRFN);
break;
case F_FNDR:
strcat(path, "/");
--- 1099,1105 -----
#endif NOCASEMATCH
switch (typ) {
case F_RSRC:
! strcat(path, RFDIR);
break;
case F_FNDR:
strcat(path, FIDIR);
***************
*** 1053,1060
strcat(path, RFDIRFN);
break;
case F_FNDR:
! strcat(path, "/");
! strcat(path, FIDIRFN);
break;
}
if (DBOSI)
--- 1102,1108 -----
strcat(path, RFDIR);
break;
case F_FNDR:
! strcat(path, FIDIR);
break;
}
if (DBOSI)
***************
*** 1090,1095
if (pdir->flags & DID_FINDERINFO) {
OSfname(path,pdir,name,F_FNDR); /* create finderinfo for folder */
err = unix_create(path,TRUE,mo); /* do delete if exists... */
os_mkdir(pdir,name,mo,F_FNDR); /* create the finderinfo directory */
}
--- 1138,1146 -----
if (pdir->flags & DID_FINDERINFO) {
OSfname(path,pdir,name,F_FNDR); /* create finderinfo for folder */
+ #ifdef NOCASEMATCH
+ noCaseMatch(path);
+ #endif NOCASEMATCH
err = unix_create(path,TRUE,mo); /* do delete if exists... */
os_mkdir(pdir,name,mo,F_FNDR); /* create the finderinfo directory */
}
***************
*** 1130,1135
printf("OSFileDirInfo on %s\n",path);
if (stat(path,&buf) != 0) { /* file exists? */
if (idir) /* was in directory tree? */
Idrdirid(ipdir, idir); /* invalidate the entry then */
return(aeObjectNotFound); /* no... */
--- 1181,1194 -----
printf("OSFileDirInfo on %s\n",path);
if (stat(path,&buf) != 0) { /* file exists? */
+ #ifdef NOCASEMATCH
+ noCaseFind(path); /* case-insensitive */
+ if (stat(path,&buf) != 0) { /* file exists? */
+ if (idir) /* was in directory tree? */
+ Idrdirid(ipdir, idir); /* invalidate the entry then */
+ return(aeObjectNotFound); /* no... */
+ }
+ #else NOCASEMATCH
if (idir) /* was in directory tree? */
Idrdirid(ipdir, idir); /* invalidate the entry then */
return(aeObjectNotFound); /* no... */
***************
*** 1133,1138
if (idir) /* was in directory tree? */
Idrdirid(ipdir, idir); /* invalidate the entry then */
return(aeObjectNotFound); /* no... */
}
/* pick out the earliest date for mac creation time */
--- 1192,1198 -----
if (idir) /* was in directory tree? */
Idrdirid(ipdir, idir); /* invalidate the entry then */
return(aeObjectNotFound); /* no... */
+ #endif NOCASEMATCH
}
/* pick out the earliest date for mac creation time */
***************
*** 1155,1161
return(OSDirInfo(ipdir,fn,fdp,&buf,volid)); /* fill in */
}
fdp->fdp_flg = 0; /* otherwise a file */
! return(OSFileInfo(ipdir,fn,fdp,&buf)); /* fill in */
}
--- 1215,1221 -----
return(OSDirInfo(ipdir,fn,fdp,&buf,volid)); /* fill in */
}
fdp->fdp_flg = 0; /* otherwise a file */
! return(OSFileInfo(ipdir,fn,fdp,&buf,path)); /* fill in */
}
***************
*** 1222,1227
IDirP idirid;
{
char path[MAXPATHLEN];
struct stat stb;
IDirP pdir;
int i;
--- 1282,1288 -----
IDirP idirid;
{
char path[MAXPATHLEN];
+ char p_ath[MAXPATHLEN];
struct stat stb;
IDirP pdir;
int i;
***************
*** 1226,1233
IDirP pdir;
int i;
! OSfname(path,idirid,"",F_DATA);
! if (stat(path, &stb) == 0) {
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_DATA;
#ifndef NOLSTAT
--- 1287,1301 -----
IDirP pdir;
int i;
! OSfname(p_ath,idirid,"",F_DATA);
! i = stat(p_ath, &stb);
! #ifdef NOCASEMATCH
! if(i != 0) {
! noCaseFind(p_ath);
! i = stat(p_ath, &stb);
! }
! #endif NOCASEMATCH
! if (i == 0) {
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_DATA;
#ifndef NOLSTAT
***************
*** 1231,1237
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_DATA;
#ifndef NOLSTAT
! if (lstat(path, &stb) != 0) { /* shouldn't fail! */
idirid->flags = DID_VALID;
return;
}
--- 1299,1305 -----
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_DATA;
#ifndef NOLSTAT
! if (lstat(p_ath, &stb) != 0) { /* shouldn't fail! */
idirid->flags = DID_VALID;
return;
}
***************
*** 1249,1256
idirid->flags |= ((i << DID_SYMLINKS_SHIFT) & DID_SYMLINKS);
}
/* don't follow symbolic links here! */
! OSfname(path,idirid,"",F_FNDR);
! if (lstat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
OSfname(path,idirid,"",F_RSRC);
--- 1317,1325 -----
idirid->flags |= ((i << DID_SYMLINKS_SHIFT) & DID_SYMLINKS);
}
/* don't follow symbolic links here! */
! strcpy(path,p_ath);
! toFinderInfo(path,"");
! if (lstat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
strcpy(path,p_ath);
***************
*** 1253,1260
if (lstat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
! OSfname(path,idirid,"",F_RSRC);
! if (lstat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_RESOURCE;
#else
--- 1322,1330 -----
if (lstat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
! strcpy(path,p_ath);
! toResFork(path,"");
! if (lstat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_RESOURCE;
#else
***************
*** 1259,1266
idirid->flags |= DID_RESOURCE;
#else
/* no symolic links then */
! OSfname(path,idirid,"",F_FNDR);
! if (stat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
OSfname(path,idirid,"",F_RSRC);
--- 1329,1337 -----
idirid->flags |= DID_RESOURCE;
#else
/* no symolic links then */
! strcpy(path,p_ath);
! toFinderInfo(path,"");
! if (stat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
strcpy(path,p_ath);
***************
*** 1263,1270
if (stat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
! OSfname(path,idirid,"",F_RSRC);
! if (stat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_RESOURCE;
#endif
--- 1334,1342 -----
if (stat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_FINDERINFO;
! strcpy(path,p_ath);
! toResFork(path,"");
! if (stat(path, &stb) == 0)
if (S_ISDIR(stb.st_mode))
idirid->flags |= DID_RESOURCE;
#endif
***************
*** 1273,1279
}
export OSErr
! OSFileInfo(ipdir,fn,fdp,buf)
IDirP ipdir;
char *fn;
FileDirParm *fdp;
--- 1345,1351 -----
}
export OSErr
! OSFileInfo(ipdir,fn,fdp,buf,rpath)
IDirP ipdir;
char *fn,*rpath;
FileDirParm *fdp;
***************
*** 1275,1281
export OSErr
OSFileInfo(ipdir,fn,fdp,buf)
IDirP ipdir;
! char *fn;
FileDirParm *fdp;
struct stat *buf;
{
--- 1347,1353 -----
export OSErr
OSFileInfo(ipdir,fn,fdp,buf,rpath)
IDirP ipdir;
! char *fn,*rpath;
FileDirParm *fdp;
struct stat *buf;
{
***************
*** 1280,1286
struct stat *buf;
{
struct stat stb;
- char rpath[MAXPATHLEN];
word bm;
fdp->fdp_fbitmap &= FP_AUFS_VALID; /* truncate to aufs supported */
--- 1352,1357 -----
struct stat *buf;
{
struct stat stb;
word bm;
fdp->fdp_fbitmap &= FP_AUFS_VALID; /* truncate to aufs supported */
***************
*** 1300,1306
fdp->fdp_parms.fp_parms.fp_rflen = 0;
if (bm & FP_RFLEN) {
! OSfname(rpath,ipdir,fn,F_RSRC); /* convert to rsrc name */
if (stat(rpath,&stb) != 0) /* to figure size of resource fork */
return(noErr);
if (DBFIL)
--- 1371,1377 -----
fdp->fdp_parms.fp_parms.fp_rflen = 0;
if (bm & FP_RFLEN) {
! toResFork(rpath,fn); /* convert to rsrc name */
if (stat(rpath,&stb) != 0) /* to figure size of resource fork */
return(noErr);
if (DBFIL)
***************
*** 1322,1327
{
char path[MAXPATHLEN];
struct stat stb;
OSfname(path, ipdir, fn, type);
return(unix_stat(path, &stb));
--- 1393,1401 -----
{
char path[MAXPATHLEN];
struct stat stb;
+ #ifdef NOCASEMATCH
+ register int i;
+ #endif NOCASEMATCH
OSfname(path, ipdir, fn, type);
#ifdef NOCASEMATCH
***************
*** 1324,1329
struct stat stb;
OSfname(path, ipdir, fn, type);
return(unix_stat(path, &stb));
}
--- 1398,1410 -----
#endif NOCASEMATCH
OSfname(path, ipdir, fn, type);
+ #ifdef NOCASEMATCH
+ if((i = unix_stat(path, &stb)) != noErr) {
+ noCaseFind(path);
+ i = unix_stat(path, &stb);
+ }
+ return(i);
+ #else NOCASEMATCH
return(unix_stat(path, &stb));
#endif NOCASEMATCH
}
***************
*** 1325,1330
OSfname(path, ipdir, fn, type);
return(unix_stat(path, &stb));
}
export OSErr
--- 1406,1412 -----
return(i);
#else NOCASEMATCH
return(unix_stat(path, &stb));
+ #endif NOCASEMATCH
}
export OSErr
***************
*** 1340,1345
OSfname(path,ipdir,fn,F_DATA); /* unix file name */
if ((err = unix_stat(path,&stb)) != noErr) {
/* can't find it !!! */
if (idir)
Idrdirid(ipdir, idir); /* remove from tree */
--- 1422,1436 -----
OSfname(path,ipdir,fn,F_DATA); /* unix file name */
if ((err = unix_stat(path,&stb)) != noErr) {
+ #ifdef NOCASEMATCH
+ noCaseFind(path);
+ if ((err = unix_stat(path,&stb)) != noErr) {
+ /* can't find it !!! */
+ if (idir)
+ Idrdirid(ipdir, idir); /* remove from tree */
+ return(err);
+ }
+ #else NOCASEMATCH
/* can't find it !!! */
if (idir)
Idrdirid(ipdir, idir); /* remove from tree */
***************
*** 1344,1349
if (idir)
Idrdirid(ipdir, idir); /* remove from tree */
return(err);
}
if (S_ISDIR(stb.st_mode)) /* if a directory */
--- 1435,1441 -----
if (idir)
Idrdirid(ipdir, idir); /* remove from tree */
return(err);
+ #endif NOCASEMATCH
}
if (S_ISDIR(stb.st_mode)) /* if a directory */
***************
*** 1378,1383
FileDirParm *fdp;
{
u_short EtoIAccess();
char path[MAXPATHLEN];
int own,grp,err; /* owner and group ids */
DirParm *dp = &fdp->fdp_parms.dp_parms;
--- 1470,1476 -----
FileDirParm *fdp;
{
u_short EtoIAccess();
+ char p_ath[MAXPATHLEN];
char path[MAXPATHLEN];
int own,grp,err; /* owner and group ids */
DirParm *dp = &fdp->fdp_parms.dp_parms;
***************
*** 1395,1402
flags = ipdir->flags; /* should use to prevent overworking */
if (own != -1 || grp != -1) {
/* error recovery? do all just in case */
! OSfname(path,ipdir,fn,F_DATA); /* change unix name */
! if ((err = unix_chown(path,own,grp)) != noErr)
return(err);
OSfname(path,ipdir,fn,F_RSRC); /* change unix name */
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
--- 1488,1502 -----
flags = ipdir->flags; /* should use to prevent overworking */
if (own != -1 || grp != -1) {
/* error recovery? do all just in case */
! OSfname(p_ath,ipdir,fn,F_DATA); /* change unix name */
! #ifdef NOCASEMATCH
! if ((err = unix_chown(p_ath,own,grp)) != noErr) {
! noCaseFind(p_ath);
! if ((err = unix_chown(p_ath,own,grp)) != noErr)
! return(err);
! }
! #else NOCASEMATCH
! if ((err = unix_chown(p_ath,own,grp)) != noErr)
return(err);
#endif NOCASEMATCH
strcpy(path,p_ath);
***************
*** 1398,1404
OSfname(path,ipdir,fn,F_DATA); /* change unix name */
if ((err = unix_chown(path,own,grp)) != noErr)
return(err);
! OSfname(path,ipdir,fn,F_RSRC); /* change unix name */
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
return(err);
OSfname(path,ipdir,fn,F_FNDR); /* create unix name */
--- 1498,1506 -----
#else NOCASEMATCH
if ((err = unix_chown(p_ath,own,grp)) != noErr)
return(err);
! #endif NOCASEMATCH
! strcpy(path,p_ath);
! toResFork(path,fn);
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
return(err);
strcpy(path,p_ath);
***************
*** 1401,1407
OSfname(path,ipdir,fn,F_RSRC); /* change unix name */
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
return(err);
! OSfname(path,ipdir,fn,F_FNDR); /* create unix name */
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
return(err);
EModified(ipdir);
--- 1503,1510 -----
toResFork(path,fn);
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
return(err);
! strcpy(path,p_ath);
! toFinderInfo(path,fn);
if ((err = unix_chown(path,own,grp)) != noErr && err != aeObjectNotFound)
return(err);
EModified(ipdir);
***************
*** 1473,1478
printf("os_chmod: setting %o for %s\n",mode,path);
err = unix_chmod(path,mode); /* and set for the directory */
if (err != noErr)
return(err);
--- 1576,1588 -----
printf("os_chmod: setting %o for %s\n",mode,path);
err = unix_chmod(path,mode); /* and set for the directory */
+ #ifdef NOCASEMATCH
+ if (err != noErr) {
+ noCaseFind(path);
+ if((err = unix_chmod(path,mode)) != noErr)
+ return(err);
+ }
+ #else NOCASEMATCH
if (err != noErr)
return(err);
#endif NOCASEMATCH
***************
*** 1475,1480
err = unix_chmod(path,mode); /* and set for the directory */
if (err != noErr)
return(err);
EModified(idir);
return(noErr);
--- 1585,1591 -----
#else NOCASEMATCH
if (err != noErr)
return(err);
+ #endif NOCASEMATCH
EModified(idir);
return(noErr);
***************
*** 1510,1517
case F_DATA:
break;
case F_RSRC:
! path[pl] = '/';
! strcpy(path+pl+1, RFDIRFN);
break;
case F_FNDR:
path[pl] = '/';
--- 1621,1627 -----
case F_DATA:
break;
case F_RSRC:
! strcpy(path+pl, RFDIR);
break;
case F_FNDR:
strcpy(path+pl, FIDIR);
***************
*** 1514,1521
strcpy(path+pl+1, RFDIRFN);
break;
case F_FNDR:
! path[pl] = '/';
! strcpy(path+pl+1, FIDIRFN);
break;
}
if (DBOSI)
--- 1624,1630 -----
strcpy(path+pl, RFDIR);
break;
case F_FNDR:
! strcpy(path+pl, FIDIR);
break;
}
if (DBOSI)
***************
*** 1522,1527
printf("os_chmod: setting %o for %s\n",mode,path);
dirp = opendir(path);
if (dirp == NULL) {
if (DBOSI)
printf("os_chmod: opendir failed on %s\n",path);
--- 1631,1637 -----
printf("os_chmod: setting %o for %s\n",mode,path);
dirp = opendir(path);
+ #ifdef NOCASEMATCH
if (dirp == NULL) {
noCaseFind(path);
if((dirp = opendir(path)) == NULL) {
***************
*** 1523,1528
dirp = opendir(path);
if (dirp == NULL) {
if (DBOSI)
printf("os_chmod: opendir failed on %s\n",path);
return;
--- 1633,1647 -----
dirp = opendir(path);
#ifdef NOCASEMATCH
if (dirp == NULL) {
+ noCaseFind(path);
+ if((dirp = opendir(path)) == NULL) {
+ if (DBOSI)
+ printf("os_chmod: opendir failed on %s\n",path);
+ return;
+ }
+ }
+ #else NOCASEMATCH
+ if (dirp == NULL) {
if (DBOSI)
printf("os_chmod: opendir failed on %s\n",path);
return;
***************
*** 1527,1532
printf("os_chmod: opendir failed on %s\n",path);
return;
}
pl = strlen(path); /* length of the path */
path[pl++] = '/'; /* add component terminator */
--- 1646,1652 -----
printf("os_chmod: opendir failed on %s\n",path);
return;
}
+ #endif NOCASEMATCH
pl = strlen(path); /* length of the path */
path[pl++] = '/'; /* add component terminator */
***************
*** 1706,1711
err = access(path,imode);
if (err == 0)
return(noErr);
switch (errno) {
case ENOTDIR:
return(aeDirNotFound);
--- 1826,1836 -----
err = access(path,imode);
if (err == 0)
return(noErr);
+ #ifdef NOCASEMATCH
+ noCaseFind(path);
+ if(access(path,imode) == 0)
+ return(noErr);
+ #endif NOCASEMATCH
switch (errno) {
case ENOTDIR:
return(aeDirNotFound);
***************
*** 1834,1839
return(noErr);
}
#endif
v->v_size = 0x1000000; /* some random number */
v->v_free = 0x1000000; /* same random number */
return(noErr); /* all ok */
--- 1959,1967 -----
return(noErr);
}
#endif
+ #ifdef SIZESERVER
+ getvolsize(path, &v->v_size, &v->v_free);
+ #else SIZESERVER
v->v_size = 0x1000000; /* some random number */
v->v_free = 0x1000000; /* same random number */
#endif SIZESERVER
***************
*** 1836,1841
#endif
v->v_size = 0x1000000; /* some random number */
v->v_free = 0x1000000; /* same random number */
return(noErr); /* all ok */
}
--- 1964,1970 -----
#else SIZESERVER
v->v_size = 0x1000000; /* some random number */
v->v_free = 0x1000000; /* same random number */
+ #endif SIZESERVER
return(noErr); /* all ok */
}
***************
*** 1839,1844
return(noErr); /* all ok */
}
#ifdef USEGETMNT
/* get info on path using buf when there is ambiguity (ultrix 2.0 or before) */
/* fill in info on v */
--- 1968,2043 -----
return(noErr); /* all ok */
}
+ #ifdef SIZESERVER
+ static jmp_buf gotpipe;
+
+ private void
+ getvolsize(path, ntot, nfree)
+ char *path;
+ sdword *ntot, *nfree;
+ {
+ register int i;
+ int mask, socket[2];
+ struct volsize vs;
+ static int server = -1, server1, servmask;
+ static struct timeval servtimeout = {0, 500000L};
+
+ if(setjmp(gotpipe)) {
+ if(server >= 0)
+ close(server);
+ server = -1;
+ unknown:
+ *ntot = 0x1000000;
+ *nfree = 0x1000000;
+ return;
+ }
+ if(server < 0) {
+ register int pid;
+ int catchsigpipe();
+
+ if(socketpair(AF_UNIX, SOCK_STREAM, 0, socket) < 0)
+ goto unknown;
+ if((pid = fork()) < 0) {
+ close(socket[0]);
+ close(socket[1]);
+ goto unknown;
+ }
+ if(pid == 0) { /* the child */
+ close(socket[0]);
+ if(socket[1] != 0) {
+ dup2(socket[1], 0);
+ close(socket[1]);
+ }
+ execl(SIZESERVER, SIZESERVER, 0);
+ _exit(1);
+ }
+ close(socket[1]);
+ server = socket[0];
+ server1 = server + 1;
+ servmask = 1 << server;
+ signal(SIGPIPE, catchsigpipe);
+ }
+ for(i = 3 ; ; ) {
+ if(i-- <= 0)
+ goto unknown;
+ lseek(server, 0L, 2);
+ write(server, path, strlen(path) + 1);
+ mask = servmask;
+ if(select(server1, &mask, NULL, NULL, &servtimeout) < 1)
+ goto unknown;
+ if(read(server, (char *)&vs, sizeof(vs)) == sizeof(vs))
+ break;
+ }
+ *ntot = vs.total;
+ *nfree = vs.free;
+ }
+
+ catchsigpipe()
+ {
+ longjmp(gotpipe, 1);
+ }
+ #endif SIZESERVER
+
#ifdef USEGETMNT
/* get info on path using buf when there is ambiguity (ultrix 2.0 or before) */
/* fill in info on v */
***************
*** 2064,2069
IDirP spdir,dpdir; /* source and destination parents */
char *sfile,*dfile; /* source and destination file names */
{
char spath[MAXPATHLEN];
char dpath[MAXPATHLEN];
struct stat stb;
--- 2263,2270 -----
IDirP spdir,dpdir; /* source and destination parents */
char *sfile,*dfile; /* source and destination file names */
{
+ char s_path[MAXPATHLEN];
+ char d_path[MAXPATHLEN];
char spath[MAXPATHLEN];
char dpath[MAXPATHLEN];
struct stat stb;
***************
*** 2070,2077
int mo;
int err;
! OSfname(spath,spdir,sfile,F_DATA); /* create unix style name for data */
! OSfname(dpath,dpdir,dfile,F_DATA); /* same for destination */
if (DBOSI)
printf("OSCopyFile: %s -> %s\n",spath,dpath);
--- 2271,2284 -----
int mo;
int err;
! OSfname(s_path,spdir,sfile,F_DATA); /* create unix style name for data */
! #ifdef NOCASEMATCH
! noCaseMatch(s_path);
! #endif NOCASEMATCH
! OSfname(d_path,dpdir,dfile,F_DATA); /* same for destination */
! #ifdef NOCASEMATCH
! noCaseMatch(d_path);
! #endif NOCASEMATCH
if (DBOSI)
printf("OSCopyFile: %s -> %s\n",s_path,d_path);
***************
*** 2074,2080
OSfname(dpath,dpdir,dfile,F_DATA); /* same for destination */
if (DBOSI)
! printf("OSCopyFile: %s -> %s\n",spath,dpath);
err = unix_stat(dpath,&stb); /* see if destination exists... */
if (err == noErr) /* yes... it does */
--- 2281,2287 -----
#endif NOCASEMATCH
if (DBOSI)
! printf("OSCopyFile: %s -> %s\n",s_path,d_path);
err = unix_stat(d_path,&stb); /* see if destination exists... */
if (err == noErr) /* yes... it does */
***************
*** 2076,2082
if (DBOSI)
printf("OSCopyFile: %s -> %s\n",spath,dpath);
! err = unix_stat(dpath,&stb); /* see if destination exists... */
if (err == noErr) /* yes... it does */
return(aeObjectExists); /* return error... */
--- 2283,2289 -----
if (DBOSI)
printf("OSCopyFile: %s -> %s\n",s_path,d_path);
! err = unix_stat(d_path,&stb); /* see if destination exists... */
if (err == noErr) /* yes... it does */
return(aeObjectExists); /* return error... */
***************
*** 2084,2090
if ((err = unix_stat(pathstr(dpdir), &stb)) != noErr)
return(err);
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
! err = os_copy(spath,dpath, mo);
if (err != noErr && DBOSI)
printf("OSCopyFile: DATA copy failed %s\n",afperr(err));
--- 2291,2297 -----
if ((err = unix_stat(pathstr(dpdir), &stb)) != noErr)
return(err);
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
! err = os_copy(s_path,d_path, mo);
if (err != noErr && DBOSI)
printf("OSCopyFile: DATA copy failed %s\n",afperr(err));
***************
*** 2092,2099
if (err != noErr)
return(err);
! OSfname(spath,spdir,sfile,F_RSRC); /* create unix style name for rsrc */
! OSfname(dpath,dpdir,dfile,F_RSRC); /* same for destination */
err = os_copy(spath,dpath,mo); /* do the copy... */
/* allow object not found */
if (err != noErr && err != aeObjectNotFound) { /* if failure.... */
--- 2299,2308 -----
if (err != noErr)
return(err);
! strcpy(spath,s_path);
! toResFork(spath,sfile); /* create unix style name for rsrc */
! strcpy(dpath,d_path);
! toResFork(dpath,dfile); /* same for destination */
err = os_copy(spath,dpath,mo); /* do the copy... */
/* allow object not found */
if (err != noErr && err != aeObjectNotFound) { /* if failure.... */
***************
*** 2103,2110
return(err);
}
! OSfname(spath,spdir,sfile,F_FNDR); /* create unix style name for fndr */
! OSfname(dpath,dpdir,dfile,F_FNDR); /* same for destination */
err = os_copy(spath,dpath,mo); /* do the copy... */
/* allow object not found */
if (err != noErr && err != aeObjectNotFound) {
--- 2312,2321 -----
return(err);
}
! strcpy(spath,s_path);
! toFinderInfo(spath,sfile); /* create unix style name for fndr */
! strcpy(dpath,d_path);
! toFinderInfo(dpath,dfile); /* same for destination */
err = os_copy(spath,dpath,mo); /* do the copy... */
/* allow object not found */
if (err != noErr && err != aeObjectNotFound) {
***************
*** 2210,2215
char *file;
int delf; /* if want to delete existing file */
{
char path[MAXPATHLEN];
int err,derr,rerr,cerr,mo;
struct stat stb;
--- 2421,2427 -----
char *file;
int delf; /* if want to delete existing file */
{
+ char p_ath[MAXPATHLEN];
char path[MAXPATHLEN];
int err,derr,rerr,cerr,mo;
struct stat stb;
***************
*** 2214,2220
int err,derr,rerr,cerr,mo;
struct stat stb;
! OSfname(path,pdir,file,F_DATA); /* create data file name */
if (DBOSI)
printf("OSCreateFile: creating %s with %s\n",path,
--- 2426,2435 -----
int err,derr,rerr,cerr,mo;
struct stat stb;
! OSfname(p_ath,pdir,file,F_DATA); /* create data file name */
! #ifdef NOCASEMATCH
! noCaseMatch(p_ath);
! #endif NOCASEMATCH
if (DBOSI)
printf("OSCreateFile: creating %s with %s\n",p_ath,
***************
*** 2217,2223
OSfname(path,pdir,file,F_DATA); /* create data file name */
if (DBOSI)
! printf("OSCreateFile: creating %s with %s\n",path,
(delf) ? "OverWrite" : "No OverWrite");
err = unix_stat(pathstr(pdir),&stb);
--- 2432,2438 -----
#endif NOCASEMATCH
if (DBOSI)
! printf("OSCreateFile: creating %s with %s\n",p_ath,
(delf) ? "OverWrite" : "No OverWrite");
err = unix_stat(pathstr(pdir),&stb);
***************
*** 2226,2233
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
/* should never get aeObjectExists if delf was true */
! OSfname(path,pdir,file,F_DATA); /* create data fork */
! derr = unix_create(path,delf,mo); /* using user delete flag */
if (derr != noErr && derr != aeObjectExists) {
if (DBOSI)
printf("OSCreateFile: DATA fork create failed\n");
--- 2441,2447 -----
mo = filemode(stb.st_mode, stb.st_uid, stb.st_gid);
/* should never get aeObjectExists if delf was true */
! derr = unix_create(p_ath,delf,mo); /* using user delete flag */
if (derr != noErr && derr != aeObjectExists) {
if (DBOSI)
printf("OSCreateFile: DATA fork create failed\n");
***************
*** 2233,2240
printf("OSCreateFile: DATA fork create failed\n");
/* previously under a conditional on delf, but not necessary */
/* anymore because we don't get here if the object was already there */
! OSfname(path,pdir,file,F_DATA);
! cerr = unix_unlink(path); /* clean up... */
if (cerr != noErr && DBOSI)
printf("OSCreateFile: cleanup failed\n");
return(derr);
--- 2447,2453 -----
printf("OSCreateFile: DATA fork create failed\n");
/* previously under a conditional on delf, but not necessary */
/* anymore because we don't get here if the object was already there */
! cerr = unix_unlink(p_ath); /* clean up... */
if (cerr != noErr && DBOSI)
printf("OSCreateFile: cleanup failed\n");
return(derr);
***************
*** 2240,2246
return(derr);
}
! OSfname(path,pdir,file,F_RSRC); /* try creating resource fork */
rerr = unix_create(path,delf,mo); /* ... */
if (rerr != noErr && rerr != aeObjectExists && rerr != aeObjectNotFound) {
if (DBOSI)
--- 2453,2460 -----
return(derr);
}
! strcpy(path,p_ath);
! toResFork(path,file); /* try creating resource fork */
rerr = unix_create(path,delf,mo); /* ... */
if (rerr != noErr && rerr != aeObjectExists && rerr != aeObjectNotFound) {
if (DBOSI)
***************
*** 2247,2253
printf("OSCreateFile: RSRC create failed\n");
/* previously under a conditional on delf, but not necessary */
/* anymore because we don't get here if the object was already there */
- OSfname(path,pdir,file,F_RSRC);
cerr = unix_unlink(path); /* clean up... */
if (cerr != noErr && DBOSI)
printf("OSCreateFile: cleanup failed\n");
--- 2461,2466 -----
printf("OSCreateFile: RSRC create failed\n");
/* previously under a conditional on delf, but not necessary */
/* anymore because we don't get here if the object was already there */
cerr = unix_unlink(path); /* clean up... */
if (cerr != noErr && DBOSI)
printf("OSCreateFile: cleanup failed\n");
***************
*** 2255,2261
return(rerr);
}
! OSfname(path,pdir,file,F_FNDR); /* create finder fork */
err = unix_create(path,TRUE,mo);
/* ignore error here - exactly what should be done? */
--- 2468,2475 -----
return(rerr);
}
! strcpy(path,p_ath);
! toFinderInfo(path,file); /* create finder fork */
err = unix_create(path,TRUE,mo);
/* ignore error here - exactly what should be done? */
***************
*** 2277,2282
char path[MAXPATHLEN];
char *ms;
int mo;
OSfname(path,pdir,file,typ); /* expand name */
--- 2491,2499 -----
char path[MAXPATHLEN];
char *ms;
int mo;
+ #ifdef NOCASEMATCH
+ register int i;
+ #endif NOCASEMATCH
OSfname(path,pdir,file,typ); /* expand name */
***************
*** 2298,2303
if (DBOSI)
printf("OSOpenFork: Opening %s for %s\n",path,ms);
return(unix_open(path,mo,fhdl));
}
--- 2515,2527 -----
if (DBOSI)
printf("OSOpenFork: Opening %s for %s\n",path,ms);
+ #ifdef NOCASEMATCH
+ if((i = unix_open(path,mo,fhdl)) != noErr) {
+ noCaseFind(path);
+ i = unix_open(path,mo,fhdl);
+ }
+ return(i);
+ #else NOCASEMATCH
return(unix_open(path,mo,fhdl));
#endif NOCASEMATCH
}
***************
*** 2299,2304
printf("OSOpenFork: Opening %s for %s\n",path,ms);
return(unix_open(path,mo,fhdl));
}
--- 2523,2529 -----
return(i);
#else NOCASEMATCH
return(unix_open(path,mo,fhdl));
+ #endif NOCASEMATCH
}
RAZZLE!DAZZLE
fi # End afpos.c.diff
if test -f afposenum.c.diff
then
echo shar: will not overwrite existing file "'afposenum.c.diff'"
else
echo 'x - afposenum.c.diff'
cat << \RAZZLE!DAZZLE > afposenum.c.diff
*** applications/aufs/afposenum.c.orig Thu May 19 12:19:54 1988
--- applications/aufs/afposenum.c Fri Dec 9 11:13:30 1988
***************
*** 29,34
#include <sys/time.h>
#include <netat/appletalk.h>
#include <netat/afp.h>
#include "afps.h"
#include "afpdt.h"
#include "afpgc.h"
--- 29,35 -----
#include <sys/time.h>
#include <netat/appletalk.h>
#include <netat/afp.h>
+ #include <strings.h>
#include "afps.h"
#include "afpdt.h"
#include "afpgc.h"
***************
*** 57,62
private void EC_Free();
private iselect();
/*
* int iselect(struct direct *d)
*
--- 58,68 -----
private void EC_Free();
private iselect();
+ #ifdef NOCASEMATCH
+ private noCaseDir();
+ private searchDirectory();
+ #endif NOCASEMATCH
+
/*
* int iselect(struct direct *d)
*
***************
*** 426,433
OSfname(r,idir,fn,typ)
IDirP idir;
! char *fn,*r;
! int typ;
{
char *p;
--- 432,439 -----
OSfname(r,idir,fn,typ)
IDirP idir;
! register char *fn,*r;
! register int typ;
{
register char *p;
***************
*** 429,435
char *fn,*r;
int typ;
{
! char *p;
for (p = pathstr(idir); *p != '\0';) /* copy the directory */
*r++ = *p++;
--- 435,441 -----
register char *fn,*r;
register int typ;
{
! register char *p;
for (p = pathstr(idir); *p != '\0';) /* copy the directory */
*r++ = *p++;
***************
*** 434,442
for (p = pathstr(idir); *p != '\0';) /* copy the directory */
*r++ = *p++;
- if (typ != F_DATA)
- *r++ = '/';
-
if (typ == F_RSRC || typ == F_FNDR) /* append directory names */
for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; )
*r++ = *p++;
--- 440,445 -----
for (p = pathstr(idir); *p != '\0';) /* copy the directory */
*r++ = *p++;
if (typ == F_RSRC || typ == F_FNDR) /* append directory names */
for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; )
*r++ = *p++;
***************
*** 438,444
*r++ = '/';
if (typ == F_RSRC || typ == F_FNDR) /* append directory names */
! for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; )
*r++ = *p++;
if (*fn != '\0') /* add slash */
--- 441,447 -----
*r++ = *p++;
if (typ == F_RSRC || typ == F_FNDR) /* append directory names */
! for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; )
*r++ = *p++;
if (*fn != '\0') { /* add slash */
***************
*** 441,447
for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; )
*r++ = *p++;
! if (*fn != '\0') /* add slash */
*r++ = '/'; /* if not null file */
while (*fn != '\0')
*r++ = *fn++;
--- 444,450 -----
for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; )
*r++ = *p++;
! if (*fn != '\0') { /* add slash */
*r++ = '/'; /* if not null file */
while (*fn != '\0')
*r++ = *fn++;
***************
*** 443,450
if (*fn != '\0') /* add slash */
*r++ = '/'; /* if not null file */
! while (*fn != '\0')
! *r++ = *fn++;
*r = '\0';
}
--- 446,454 -----
if (*fn != '\0') { /* add slash */
*r++ = '/'; /* if not null file */
! while (*fn != '\0')
! *r++ = *fn++;
! }
*r = '\0';
}
***************
*** 447,452
*r++ = *fn++;
*r = '\0';
}
-
--- 451,456 -----
}
*r = '\0';
}
toResFork(str, fn)
register char *str;
***************
*** 449,452
}
--- 452,462 -----
*r = '\0';
}
+ toResFork(str, fn)
+ register char *str;
+ char *fn;
+ {
+ register char *fp, *tp;
if(*fn) { /* a real file */
if(fp = rindex(str, '/')) /* skip over last slash */
***************
*** 450,452
--- 458,617 -----
{
register char *fp, *tp;
+ if(*fn) { /* a real file */
+ if(fp = rindex(str, '/')) /* skip over last slash */
+ fp++;
+ else
+ fp = str;
+ str = fp;
+ fp = str + strlen(str);
+ tp = fp + DIRRFLEN;
+ *tp = 0;
+ while(fp > str) /* move filename, leaving space for .resource */
+ *--tp = *--fp;
+ fp = DIRRF;
+ while(*fp)
+ *str++ = *fp++;
+ } else /* a directory */
+ strcat(str,RFDIR); /* just append .resource */
+ }
+
+ toFinderInfo(str, fn)
+ register char *str;
+ char *fn;
+ {
+ register char *fp, *tp;
+
+ if(*fn) { /* a real file */
+ if(fp = rindex(str,'/')) /* skip over last slash */
+ fp++;
+ else
+ fp = str;
+ str = fp;
+ fp = str + strlen(str);
+ tp = fp + DIRFILEN;
+ *tp = 0;
+ while(fp > str) /* move filename, leaving space for .finderinfo */
+ *--tp = *--fp;
+ fp = DIRFI;
+ while(*fp)
+ *str++ = *fp++;
+ } else /* a directory */
+ strcat(str,FIDIR); /* just append .finderinfo */
+ }
+
+ #ifdef NOCASEMATCH
+ #include <sys/file.h>
+ #include <ctype.h>
+
+ /*
+ * searchDirectory(dir, name)
+ * Do a case insensitive search for name in dir, and write the true name
+ * of the file in name.
+ */
+
+ private
+ searchDirectory(dir, name)
+ char *dir, *name;
+ {
+ register char *fp, *tp;
+ register DIR *dp;
+ register struct direct *d;
+ register int len;
+ char lname[BUFSIZ], dname[BUFSIZ];
+
+ if((dp = opendir(dir)) == NULL)
+ return(0);
+ len = 0;
+ for(fp = name, tp = lname ; *fp ; fp++) {
+ *tp++ = isupper(*fp) ? tolower(*fp) : *fp;
+ len++;
+ }
+ *tp = 0;
+ while(d = readdir(dp)) {
+ if(d->d_namlen != len)
+ continue;
+ for(fp = d->d_name, tp = dname ; *fp ; fp++)
+ *tp++ = isupper(*fp) ? tolower(*fp) : *fp;
+ *tp = 0;
+ if(strcmp(dname, lname) == 0) {
+ strcpy(name, d->d_name);
+ closedir(dp);
+ return(1);
+ }
+ }
+ closedir(dp);
+ return(0);
+ }
+
+ /*
+ * noCaseDir(path)
+ * Recursively verify the components of path.
+ */
+
+ private
+ noCaseDir(path)
+ register char *path;
+ {
+ register char *last;
+ register int status;
+
+ if(access(path, F_OK) >= 0)
+ return(1);
+ if(last = rindex(path, '/')) {
+ if(last == path)
+ return(searchDirectory("/", last + 1));
+ else {
+ *last++ = 0;
+ status = 0;
+ if(noCaseDir(path))
+ status = searchDirectory(path, last);
+ *--last = '/';
+ return(status);
+ }
+ }
+ return(searchDirectory(".", path));
+ }
+
+ /*
+ * noCaseFind(path)
+ * noCaseFind() calls noCaseDir() and searchDirectory() recursively to
+ * take path (case insensitive) and converts it to (case sensitive) newpath
+ * corresponding to the true Unix filename. This is mainly to fix
+ * HyperCard doing funny things to stack names.
+ */
+
+ void
+ noCaseFind(path)
+ register char *path;
+ {
+ register char *last;
+
+ if(last = rindex(path, '/')) {
+ if(last == path)
+ searchDirectory("/", last + 1);
+ else {
+ *last++ = 0;
+ if(noCaseDir(path))
+ searchDirectory(path, last);
+ *--last = '/';
+ }
+ } else
+ searchDirectory(".", path);
+ }
+
+ /*
+ * noCaseMatch(path)
+ * noCaseMatch() tests path first and will call noCaseFind() is path
+ * doesn't exist.
+ */
+
+ void
+ noCaseMatch(path)
+ register char *path;
+ {
+ if(access(path, F_OK) >= 0)
+ return;
+ noCaseFind(path);
+ }
+ #endif NOCASEMATCH
RAZZLE!DAZZLE
fi # End afposenum.c.diff
if test -f afposfi.c.diff
then
echo shar: will not overwrite existing file "'afposfi.c.diff'"
else
echo 'x - afposfi.c.diff'
cat << \RAZZLE!DAZZLE > afposfi.c.diff
*** applications/aufs/afposfi.c.orig Thu May 19 12:19:56 1988
--- applications/aufs/afposfi.c Thu Jan 26 18:22:52 1989
***************
*** 63,68
private void fc_flush_start();
private void fc_flush_end();
private FileInfo *os_getfi();
#define FICacheSize 128
/* Each cache entry has a lifetime that it goes through before it must */
--- 63,69 -----
private void fc_flush_start();
private void fc_flush_end();
private FileInfo *os_getfi();
+ private fc_readent();
#define FICacheSize 128
/* Each cache entry has a lifetime that it goes through before it must */
***************
*** 104,109
OSfname(path, pdir, "", F_FNDR); /* get directory */
if (stat(path, &stb) < 0) {
fcf_val_dir = NILDIR;
fcf_val_time = 0;
return; /* nothing else we can do */
--- 105,118 -----
OSfname(path, pdir, "", F_FNDR); /* get directory */
if (stat(path, &stb) < 0) {
+ #ifdef NOCASEMATCH
+ noCaseFind(path);
+ if (stat(path, &stb) < 0) {
+ fcf_val_dir = NILDIR;
+ fcf_val_time = 0;
+ return; /* nothing else we can do */
+ }
+ #else NOCASEMATCH
fcf_val_dir = NILDIR;
fcf_val_time = 0;
return; /* nothing else we can do */
***************
*** 107,112
fcf_val_dir = NILDIR;
fcf_val_time = 0;
return; /* nothing else we can do */
}
fcf_val_dir = pdir;
fcf_val_time = stb.st_mtime; /* remember */
--- 116,122 -----
fcf_val_dir = NILDIR;
fcf_val_time = 0;
return; /* nothing else we can do */
+ #endif NOCASEMATCH
}
fcf_val_dir = pdir;
fcf_val_time = stb.st_mtime; /* remember */
***************
*** 142,147
if (fcf_val_dir == fe->fe_pdir &&
(fcf_val_time > fe->fe_mtime) &&
(fcf_val_time > fe->fe_vtime)) {
if (stat(path, &stb) < 0)
return; /* nothing else we can do */
if (stb.st_mtime != fe->fe_mtime) /* reload entry */
--- 152,164 -----
if (fcf_val_dir == fe->fe_pdir &&
(fcf_val_time > fe->fe_mtime) &&
(fcf_val_time > fe->fe_vtime)) {
+ #ifdef NOCASEMATCH
+ if (stat(path, &stb) < 0) {
+ noCaseFind(path);
+ if (stat(path, &stb) < 0)
+ return; /* nothing else we can do */
+ }
+ #else NOCASEMATCH
if (stat(path, &stb) < 0)
return; /* nothing else we can do */
#endif NOCASEMATCH
***************
*** 144,149
(fcf_val_time > fe->fe_vtime)) {
if (stat(path, &stb) < 0)
return; /* nothing else we can do */
if (stb.st_mtime != fe->fe_mtime) /* reload entry */
fe->fe_okay = FALSE; /* make entry as bad */
}
--- 161,167 -----
#else NOCASEMATCH
if (stat(path, &stb) < 0)
return; /* nothing else we can do */
+ #endif NOCASEMATCH
if (stb.st_mtime != fe->fe_mtime) /* reload entry */
fe->fe_okay = FALSE; /* make entry as bad */
}
***************
*** 167,172
if ((fe->fe_pdir->flags & DID_FINDERINFO) == 0) /* always okay */
return(fe->fe_okay);
OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR);
if (stat(path, &stb) < 0)
return(fe->fe_okay); /* nothing else we can do */
if (stb.st_mtime != fe->fe_mtime) /* reload entry */
--- 185,197 -----
if ((fe->fe_pdir->flags & DID_FINDERINFO) == 0) /* always okay */
return(fe->fe_okay);
OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR);
+ #ifdef NOCASEMATCH
+ if (stat(path, &stb) < 0) {
+ noCaseFind(path);
+ if (stat(path, &stb) < 0)
+ return(fe->fe_okay); /* nothing else we can do */
+ }
+ #else NOCASEMATCH
if (stat(path, &stb) < 0)
return(fe->fe_okay); /* nothing else we can do */
#endif NOCASEMATCH
***************
*** 169,174
OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR);
if (stat(path, &stb) < 0)
return(fe->fe_okay); /* nothing else we can do */
if (stb.st_mtime != fe->fe_mtime) /* reload entry */
return(FALSE); /* bad entry */
}
--- 194,200 -----
#else NOCASEMATCH
if (stat(path, &stb) < 0)
return(fe->fe_okay); /* nothing else we can do */
+ #endif NOCASEMATCH
if (stb.st_mtime != fe->fe_mtime) /* reload entry */
return(FALSE); /* bad entry */
}
***************
*** 253,258
printf("fc_readent: reading %s\n",path);
fd = open(path,O_RDONLY);
if (fd >= 0) {
OSLockFileforRead(fd);
err = fstat(fd, &stb);
--- 279,290 -----
printf("fc_readent: reading %s\n",path);
fd = open(path,O_RDONLY);
+ #ifdef NOCASEMATCH
+ if(fd < 0) {
+ noCaseFind(path);
+ fd = open(path,O_RDONLY);
+ }
+ #endif NOCASEMATCH
if (fd >= 0) {
OSLockFileforRead(fd);
err = fstat(fd, &stb);
***************
*** 309,314
/* convert name to internal name */
OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */
if (stat(path,&stb) != 0) /* check if it exists */
return(aeObjectNotFound); /* no... */
if (S_ISDIR(stb.st_mode)) {
--- 341,353 -----
/* convert name to internal name */
OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */
+ #ifdef NOCASEMATCH
+ if (stat(path,&stb) != 0) { /* check if it exists */
+ noCaseFind(path);
+ if (stat(path,&stb) != 0) /* check if it exists */
+ return(aeObjectNotFound); /* no... */
+ }
+ #else NOCASEMATCH
if (stat(path,&stb) != 0) /* check if it exists */
return(aeObjectNotFound); /* no... */
#endif NOCASEMATCH
***************
*** 311,316
OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */
if (stat(path,&stb) != 0) /* check if it exists */
return(aeObjectNotFound); /* no... */
if (S_ISDIR(stb.st_mode)) {
fi->fi_comln = 0;
} else {
--- 350,356 -----
#else NOCASEMATCH
if (stat(path,&stb) != 0) /* check if it exists */
return(aeObjectNotFound); /* no... */
+ #endif NOCASEMATCH
if (S_ISDIR(stb.st_mode)) {
fi->fi_comln = 0;
} else {
***************
*** 352,358
printf("WriteFA: writing %s\n",path);
needu++;
! if ((fd = open(path,O_WRONLY)) < 0) { /* open for write */
if (errno != ENOENT) {
printf("WriteFA: error openning %s errno=%d\n",path,errno);
return;
--- 392,405 -----
printf("WriteFA: writing %s\n",path);
needu++;
! fd = open(path,O_WRONLY);
! #ifdef NOCASEMATCH
! if(fd < 0) {
! noCaseFind(path);
! fd = open(path,O_WRONLY);
! }
! #endif NOCASEMATCH
! if (fd < 0) { /* open for write */
if (errno != ENOENT) {
printf("WriteFA: error openning %s errno=%d\n",path,errno);
return;
RAZZLE!DAZZLE
fi # End afposfi.c.diff
if test -f afps.h.diff
then
echo shar: will not overwrite existing file "'afps.h.diff'"
else
echo 'x - afps.h.diff'
cat << \RAZZLE!DAZZLE > afps.h.diff
*** applications/aufs/afps.h.orig Thu May 19 12:20:07 1988
--- applications/aufs/afps.h Thu Dec 1 11:08:02 1988
***************
*** 182,187
char *OSEnumGet();
int OSEnumInit();
void OSEnumDone();
/* Portable library functions */
--- 182,191 -----
char *OSEnumGet();
int OSEnumInit();
void OSEnumDone();
+ #ifdef NOCASEMATCH
+ void noCaseFind();
+ void noCaseMatch();
+ #endif NOCASEMATCH
/* Portable library functions */
***************
*** 197,202
#define RFDIR "/.resource"
#define FIDIR "/.finderinfo"
/* Finder info bits */
#define DEFCMNT "This is a Unix\252 created file."
--- 201,211 -----
#define RFDIR "/.resource"
#define FIDIR "/.finderinfo"
+
+ #define DIRRF ".resource/"
+ #define DIRFI ".finderinfo/"
+ #define DIRRFLEN 10
+ #define DIRFILEN 12
/* Finder info bits */
#define DEFCMNT "This is a Unix\252 created file."
RAZZLE!DAZZLE
fi # End afps.h.diff
if test -f afpserver.c.diff
then
echo shar: will not overwrite existing file "'afpserver.c.diff'"
else
echo 'x - afpserver.c.diff'
cat << \RAZZLE!DAZZLE > afpserver.c.diff
*** applications/aufs/afpserver.c.orig Thu May 19 12:20:09 1988
--- applications/aufs/afpserver.c Thu Jan 26 18:13:56 1989
***************
*** 167,172
#define NumEntries (sizeof(Entries)/sizeof(AFPDispEntry))
IniServer() /* ini disp entries */
{
int i;
--- 167,174 -----
#define NumEntries (sizeof(Entries)/sizeof(AFPDispEntry))
+ private DumpBuf(), clockstart(), clockend();
+
IniServer() /* ini disp entries */
{
int i;
RAZZLE!DAZZLE
fi # End afpserver.c.diff
if test -f atalkdbm.c.diff
then
echo shar: will not overwrite existing file "'atalkdbm.c.diff'"
else
echo 'x - atalkdbm.c.diff'
cat << \RAZZLE!DAZZLE > atalkdbm.c.diff
*** lib/cap/atalkdbm.c.orig Thu May 19 12:17:05 1988
--- lib/cap/atalkdbm.c Fri Jan 27 14:52:15 1989
***************
*** 37,42
#define HAVE_ZONE -1 /* our zone was set */
#define CONFIGURED 1 /* set when configured */
/*
* Set zone name - sets alternate atalk configuration file: atalk.<zonename>
*
--- 37,44 -----
#define HAVE_ZONE -1 /* our zone was set */
#define CONFIGURED 1 /* set when configured */
+ static int name_toipaddr();
+
/*
* Set zone name - sets alternate atalk configuration file: atalk.<zonename>
*
RAZZLE!DAZZLE
fi # End atalkdbm.c.diff
if test -f atis.c.diff
then
echo shar: will not overwrite existing file "'atis.c.diff'"
else
echo 'x - atis.c.diff'
cat << \RAZZLE!DAZZLE > atis.c.diff
*** etc/atis.c.orig Thu May 19 12:17:32 1988
--- etc/atis.c Fri Jan 27 12:27:46 1989
***************
*** 103,108
void atis_end();
void atis_debuginc();
void atis_undebug();
void
nbp_reload()
--- 103,109 -----
void atis_end();
void atis_debuginc();
void atis_undebug();
+ private int nbpcpy(), c2pkt_ename(), pkt2c_ename();
void
nbp_reload()
***************
*** 121,127
} else log(L_UERR|1, "dump file open failed");
log(1, "loaded %d entries",cnt);
sigsetmask(mask);
! (void)signal(SIGHUP, nbp_reload);
}
void
--- 122,128 -----
} else log(L_UERR|1, "dump file open failed");
log(1, "loaded %d entries",cnt);
sigsetmask(mask);
! (void)signal(SIGHUP, (int (*)())nbp_reload);
}
void
***************
*** 142,148
} else log(L_UERR|1, "dump file (write) open failed");
log(1, "Dumped %d entries",cnt);
sigsetmask(mask);
! (void)signal(SIGQUIT, nbp_dump);
}
void
--- 143,149 -----
} else log(L_UERR|1, "dump file (write) open failed");
log(1, "Dumped %d entries",cnt);
sigsetmask(mask);
! (void)signal(SIGQUIT, (int (*)())nbp_dump);
}
void
***************
*** 161,167
log(0, "DEBUGGING OFF");
if (tempdebugfile)
nologfile();
! signal(SIGEMT, atis_debuginc);
sigsetmask(mask);
}
--- 162,168 -----
log(0, "DEBUGGING OFF");
if (tempdebugfile)
nologfile();
! signal(SIGEMT, (int (*)())atis_debuginc);
sigsetmask(mask);
}
***************
*** 176,182
if (dlevel < L_LVLMAX)
dlevel++;
log(0, "DEBUG LEVEL %d", dlevel);
! signal(SIGIOT, atis_debuginc);
sigsetmask(mask);
}
--- 177,183 -----
if (dlevel < L_LVLMAX)
dlevel++;
log(0, "DEBUG LEVEL %d", dlevel);
! signal(SIGIOT, (int (*)())atis_debuginc);
sigsetmask(mask);
}
***************
*** 354,364
abInit(TRUE); /* init driver */
nbpInit(); /* init NBP */
nbptab_init();
! (void)signal(SIGHUP, nbp_reload);
! (void)signal(SIGQUIT, nbp_dump);
! (void)signal(SIGTERM, atis_end);
! (void)signal(SIGIOT, atis_debuginc);
! (void)signal(SIGEMT, atis_undebug);
log(0, "Reply num max for lkup reply is %d (based on %d)",
NUMREPLYMAX, NBPTUPSIZE);
--- 355,365 -----
abInit(TRUE); /* init driver */
nbpInit(); /* init NBP */
nbptab_init();
! (void)signal(SIGHUP, (int (*)())nbp_reload);
! (void)signal(SIGQUIT, (int (*)())nbp_dump);
! (void)signal(SIGTERM, (int (*)())atis_end);
! (void)signal(SIGIOT, (int (*)())atis_debuginc);
! (void)signal(SIGEMT, (int (*)())atis_undebug);
log(0, "Reply num max for lkup reply is %d (based on %d)",
NUMREPLYMAX, NBPTUPSIZE);
RAZZLE!DAZZLE
fi # End atis.c.diff
if test -f papof.c.diff
then
echo shar: will not overwrite existing file "'papof.c.diff'"
else
echo 'x - papof.c.diff'
cat << \RAZZLE!DAZZLE > papof.c.diff
*** applications/papif/papof.c.orig Thu May 19 12:18:50 1988
--- applications/papif/papof.c Fri Jan 27 12:05:02 1989
***************
*** 54,60
while (1) {
#ifdef BANNER
! if ((bannerfile = fopen(BANNERFILE, "w")) < 0) {
perror("Can't open .banner");
exit(8);
}
--- 54,60 -----
while (1) {
#ifdef BANNER
! if ((bannerfile = fopen(BANNERFILE, "w")) == NULL) {
perror("Can't open .banner");
exit(8);
}
RAZZLE!DAZZLE
fi # End papof.c.diff
echo '***** End of' CAP patches '*****'
exit