Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!felix!dhw68k!macintosh From: edmoy@violet.berkeley.edu (Edward Moy) Newsgroups: comp.sources.mac Subject: New Patches to CAP (part 1 of 2) Message-ID: <23435@dhw68k.cts.com> Date: 3 Jun 89 15:00:31 GMT Sender: macintosh@dhw68k.cts.com Lines: 1543 Approved: Info-Mac@sumex-aim.stanford.edu [New Patches to CAP - part 1 of 2] 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. --- #! /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 # afposenum.c.diff # afposfi.c.diff # afps.h.diff # afpserver.c.diff # atalkdbm.c.diff # atis.c.diff # papof.c.diff # # This archive created: Sat Jun 3 07:29:27 1989 # By: Roger L. Long (bytebug@dhw68k.cts.com) # export PATH; PATH=/bin:$PATH echo shar: extracting "'README'" '(1318 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^X//' << \SHAR_EOF > 'README' XThe patches included in this distribution contain the following: X X1) In AUFS, #ifdef SIZESERVER lines that allow 4.3BSD systems to show volume Xinfo (previously distributed as sizeserver.shar; needs additional code to Xuse this). X X2) In AUFS, #ifdef NOCASEMATCH lines that fixes the case sensitivity of UNIX X(Mac filesystems are case-insensitive). There is some performance degradation, Xespecially when the filename to search for has modified case, like the way XHyperCard 1.2.1 changes the case of letters in a stack name. X X3) CAP now compilies under GCC. Various changes were made to fix incompatibil- Xities with the preprocessors, as well as to silence various warning messages. XThe -DGNUCC flags needs to be given to the compiler. X X4) On NeXT machines (with GCC), Configure has been modified so that "next" can Xbe given as an OS type. It automatically adds -DGNUCC to the C compilier Xflags. (I don't know how to detect a NeXT machine in the Configure script, Xespecially since the entire filesystem may change between 0.8 and 0.9.) X X5) Various minor code enhancements, with no change in functionality. X XEdward Moy Principal Programmer - Macintosh & Unix XWorkstation Support Services Workstation Software Support Group XUniversity of California XBerkeley, CA 94720 X Xedmoy@violet.Berkeley.EDU Xucbvax!violet!edmoy SHAR_EOF if test 1318 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 1318 characters)' fi fi # end of overwriting check echo shar: extracting "'Configure.diff'" '(2258 characters)' if test -f 'Configure.diff' then echo shar: will not over-write existing file "'Configure.diff'" else sed 's/^X//' << \SHAR_EOF > 'Configure.diff' X*** Configure.orig Thu Feb 9 21:01:00 1989 X--- Configure Thu Feb 9 21:01:50 1989 X*************** X*** 141,146 X "aux") valid=1;; X "pyr") valid=1;; X "sunos") valid=1;; X "?"|*) X if [ "${os}" != "?" ]; then X echo "unknown type ${os}, valid are:" X X--- 141,147 ----- X "aux") valid=1;; X "pyr") valid=1;; X "sunos") valid=1;; X+ "next") valid=1;; X "?"|*) X if [ "${os}" != "?" ]; then X echo "unknown type ${os}, valid are:" X*************** X*** 152,157 X echo " aux - A/UX"; X echo " pyr - pyramid"; X echo " sunos - suns"; X ;; X esac X done X X--- 153,159 ----- X echo " aux - A/UX"; X echo " pyr - pyramid"; X echo " sunos - suns"; X+ echo " next - NeXT/MACH"; X ;; X esac X done X*************** X*** 299,304 X # "aux" - A/UX X # "pyr" - pyramid (in BSD universe) X # "sunos" - SunOS X # Warning: hpux, pyr are hardcoded in some of the makefiles (sorry) X X # MAJOR CONFIGURATION X X--- 301,307 ----- X # "aux" - A/UX X # "pyr" - pyramid (in BSD universe) X # "sunos" - SunOS X+ # "next" - NeXT/MACH X # Warning: hpux, pyr are hardcoded in some of the makefiles (sorry) X X # MAJOR CONFIGURATION X*************** X*** 448,453 X os,[hpux],[HP-UX (for 9000 series)], X os,[bsd],[Standard BSD], X os,[pyr],[Pyramid in BSD universe], X [Unknown])) X define([cflags],ifdef([selfdefinetypes],[-O -D_TYPES],[-O])) X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X X--- 451,457 ----- X os,[hpux],[HP-UX (for 9000 series)], X os,[bsd],[Standard BSD], X os,[pyr],[Pyramid in BSD universe], X+ os,[next],[NeXT/MACH], X [Unknown])) X define([cflags],ifdef([selfdefinetypes],[-O -D_TYPES],[-O])) X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X*************** X*** 453,458 X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X ifelse(os,[pyr],[ X define([cflags],concat(cflags,[ -q]))]) X # was used for nbp, but found we needed more... leave in case X define([nbpflags],[]) X X X--- 457,464 ----- X define([bigcflags],ifelse(os,[hpux],[+Nd2000 +Ns2000])) X ifelse(os,[pyr],[ X define([cflags],concat(cflags,[ -q]))]) X+ ifelse(os,[next],[ X+ define([cflags],concat(cflags,[ -DGNUCC]))]) X # was used for nbp, but found we needed more... leave in case X define([nbpflags],[]) X SHAR_EOF if test 2258 -ne "`wc -c < 'Configure.diff'`" then echo shar: error transmitting "'Configure.diff'" '(should have been 2258 characters)' fi fi # end of overwriting check echo shar: extracting "'abasp.c.diff'" '(2206 characters)' if test -f 'abasp.c.diff' then echo shar: will not over-write existing file "'abasp.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'abasp.c.diff' X*** lib/cap/abasp.c.orig Thu May 19 12:16:31 1988 X--- lib/cap/abasp.c Fri Jan 27 14:50:59 1989 X*************** X*** 25,33 X #include "abasp.h" X X int aspInit(); X! SPGetParms(); X! SPInit(); X! SPGetNetworkInfo(); X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X X--- 25,33 ----- X #include "abasp.h" X X int aspInit(); X! int SPGetParms(); X! int SPInit(); X! int SPGetNetworkInfo(); X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X*************** X*** 31,41 X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X! SPGetSession(); X! SPCloseSession(); X! SPGetRequest(); X! SPCmdReply(); X! SPWrtReply(); X private int spreply(); X SPWrtContinue(); X SPNewStatus(); X X--- 31,41 ----- X private void handle_aspserver(); X private void asp_doopensess(); X private void sessopenreply(); X! int SPGetSession(); X! int SPCloseSession(); X! int SPGetRequest(); X! int SPCmdReply(); X! int SPWrtReply(); X private int spreply(); X int SPWrtContinue(); X int SPNewStatus(); X*************** X*** 37,45 X SPCmdReply(); X SPWrtReply(); X private int spreply(); X! SPWrtContinue(); X! SPNewStatus(); X! SPAttention(); X X SPGetStatus(); X SPOpenSession(); X X--- 37,45 ----- X int SPCmdReply(); X int SPWrtReply(); X private int spreply(); X! int SPWrtContinue(); X! int SPNewStatus(); X! int SPAttention(); X X int SPGetStatus(); X int SPOpenSession(); X*************** X*** 41,48 X SPNewStatus(); X SPAttention(); X X! SPGetStatus(); X! SPOpenSession(); X private void handle_aspclient(); X SPCommand(); X SPWrite(); X X--- 41,48 ----- X int SPNewStatus(); X int SPAttention(); X X! int SPGetStatus(); X! int SPOpenSession(); X private void handle_aspclient(); X int SPCommand(); X int SPWrite(); X*************** X*** 44,51 X SPGetStatus(); X SPOpenSession(); X private void handle_aspclient(); X! SPCommand(); X! SPWrite(); X private void asp_do_write(); X X private void handle_asp_sndreq(); X X--- 44,51 ----- X int SPGetStatus(); X int SPOpenSession(); X private void handle_aspclient(); X! int SPCommand(); X! int SPWrite(); X private void asp_do_write(); X X private void handle_asp_sndreq(); SHAR_EOF if test 2206 -ne "`wc -c < 'abasp.c.diff'`" then echo shar: error transmitting "'abasp.c.diff'" '(should have been 2206 characters)' fi fi # end of overwriting check echo shar: extracting "'abatp.c.diff'" '(448 characters)' if test -f 'abatp.c.diff' then echo shar: will not over-write existing file "'abatp.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'abatp.c.diff' X*** lib/cap/abatp.c.orig Thu May 19 12:16:35 1988 X--- lib/cap/abatp.c Fri Jan 27 14:49:11 1989 X*************** X*** 83,88 X {(caddr_t)&atph, atpSize}, /* atp */ X {(caddr_t)atpdata, atpMaxData} /* atp user data */ X }; X X /* X * ATPSndRequest X X--- 83,90 ----- X {(caddr_t)&atph, atpSize}, /* atp */ X {(caddr_t)atpdata, atpMaxData} /* atp user data */ X }; X+ private delete_tcb_skt(); X+ private int ATPWrite(); X X /* X * ATPSndRequest SHAR_EOF if test 448 -ne "`wc -c < 'abatp.c.diff'`" then echo shar: error transmitting "'abatp.c.diff'" '(should have been 448 characters)' fi fi # end of overwriting check echo shar: extracting "'abkip.c.diff'" '(710 characters)' if test -f 'abkip.c.diff' then echo shar: will not over-write existing file "'abkip.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'abkip.c.diff' X*** lib/cap/abkip.c.orig Thu May 19 12:16:50 1988 X--- lib/cap/abkip.c Fri Jan 27 14:55:42 1989 X*************** X*** 278,284 X return(ddpSktErr); X for (i=0; i < 128; i++,ipskt++,(*skt)++) { X lsin.sin_port = htons(ipskt); X! if ((err = bind(fd, (caddr_t)&lsin, sizeof(lsin))) == 0) X break; X if (rskt != 0) /* bind failed and wanted exact? */ X return(err); /* yes... */ X X--- 278,284 ----- X return(ddpSktErr); X for (i=0; i < 128; i++,ipskt++,(*skt)++) { X lsin.sin_port = htons(ipskt); X! if ((err = bind(fd, (struct sockaddr *)&lsin, sizeof(lsin))) == 0) X break; X if (rskt != 0) /* bind failed and wanted exact? */ X return(err); /* yes... */ SHAR_EOF if test 710 -ne "`wc -c < 'abkip.c.diff'`" then echo shar: error transmitting "'abkip.c.diff'" '(should have been 710 characters)' fi fi # end of overwriting check echo shar: extracting "'afpc.c.diff'" '(1428 characters)' if test -f 'afpc.c.diff' then echo shar: will not over-write existing file "'afpc.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpc.c.diff' X*** lib/afpc/afpc.c.orig Thu May 19 12:17:22 1988 X--- lib/afpc/afpc.c Thu Jan 26 15:36:31 1989 X*************** X*** 286,292 X { X char lbuf[sizeof(FlushPkt)+1]; X int len; X! extern PackEntry ProtoFVP[]; X X len = htonPackX(ProtoCFP, fv, lbuf); X X X--- 286,292 ----- X { X char lbuf[sizeof(FlushPkt)+1]; X int len; X! extern PackEntry ProtoCFP[]; X X len = htonPackX(ProtoCFP, fv, lbuf); X X*************** X*** 319,325 X char lbuf[sizeof(GetAPPLPkt)+1]; X char buf[sizeof(GetAPPLReplyPkt)+1]; X int rlen, comp, len; X! extern PackEntry ProtoGAP[], ProtoGAPR[]; X X len = htonPackX(ProtoGAP, gap, lbuf); X SPCommand(srn,lbuf,len,buf,sizeof(GetAPPLReplyPkt),cr,&rlen,-1,&comp); X X--- 319,325 ----- X char lbuf[sizeof(GetAPPLPkt)+1]; X char buf[sizeof(GetAPPLReplyPkt)+1]; X int rlen, comp, len; X! extern PackEntry ProtoGAP[], ProtoGAPR[], ProtoFileAttr[]; X X len = htonPackX(ProtoGAP, gap, lbuf); X SPCommand(srn,lbuf,len,buf,sizeof(GetAPPLReplyPkt),cr,&rlen,-1,&comp); X*************** X*** 714,720 X word *refnum; X dword *cr; X { X! extern PackEntry ProtoOFkP[]; X byte lbuf[sizeof(OpenForkPkt)], buf[sizeof(FileDirParm)+20], *p; X int rlen, comp, len; X word bitmap; X X--- 714,720 ----- X word *refnum; X dword *cr; X { X! extern PackEntry ProtoOFkP[], ProtoFileAttr[]; X byte lbuf[sizeof(OpenForkPkt)], buf[sizeof(FileDirParm)+20], *p; X int rlen, comp, len; X word bitmap; SHAR_EOF if test 1428 -ne "`wc -c < 'afpc.c.diff'`" then echo shar: error transmitting "'afpc.c.diff'" '(should have been 1428 characters)' fi fi # end of overwriting check echo shar: extracting "'afpcmd.h.diff'" '(3235 characters)' if test -f 'afpcmd.h.diff' then echo shar: will not over-write existing file "'afpcmd.h.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpcmd.h.diff' X*** netat/afpcmd.h.orig Thu May 19 12:16:16 1988 X--- netat/afpcmd.h Fri Jan 27 12:52:44 1989 X*************** X*** 624,629 X /* Pack(pointer, type of data, scalar result field) */ X #define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Paks(pointer, type of data, array result field) */ X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Both require that a "type of data" field type P_BMAP be set first */ X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X X--- 624,632 ----- X /* Pack(pointer, type of data, scalar result field) */ X #define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Paks(pointer, type of data, array result field) */ X+ #ifdef GNUCC X+ #define PAKS(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X+ #else GNUCC X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X #endif GNUCC X /* Both require that a "type of data" field type P_BMAP be set first */ X*************** X*** 625,630 X #define PACK(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Paks(pointer, type of data, array result field) */ X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X /* Both require that a "type of data" field type P_BMAP be set first */ X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X X--- 628,634 ----- X #define PAKS(pt,t,s) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),0} X #else GNUCC X #define PAKS(pt,t,s) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),0} X+ #endif GNUCC X /* Both require that a "type of data" field type P_BMAP be set first */ X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X*************** X*** 629,634 X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X /* pksb(pointer, type of data, array result field, bit of bitmap */ X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X X /* Pack even - to mark that we should be on even boundary */ X X--- 633,641 ----- X /* pakb(pointer, type of data, scalar result field, bit of bitmap */ X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X /* pksb(pointer, type of data, array result field, bit of bitmap */ X+ #ifdef GNUCC X+ #define PKSB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X+ #else GNUCC X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X #endif GNUCC X X*************** X*** 630,635 X #define PAKB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X /* pksb(pointer, type of data, array result field, bit of bitmap */ X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X X /* Pack even - to mark that we should be on even boundary */ X #define PACKEVEN() {P_EVEN, 0, 0, 0} X X--- 637,643 ----- X #define PKSB(pt,t,s,b) {t,(int) &((pt) 0)->s,sizeof(((pt) 0)->s),b} X #else GNUCC X #define PKSB(pt,t,s,b) {t,(int) ((pt) 0)->s,sizeof(((pt) 0)->s),b} X+ #endif GNUCC X X /* Pack even - to mark that we should be on even boundary */ X #define PACKEVEN() {P_EVEN, 0, 0, 0} SHAR_EOF if test 3235 -ne "`wc -c < 'afpcmd.h.diff'`" then echo shar: error transmitting "'afpcmd.h.diff'" '(should have been 3235 characters)' fi fi # end of overwriting check echo shar: extracting "'afpdid.c.diff'" '(1305 characters)' if test -f 'afpdid.c.diff' then echo shar: will not over-write existing file "'afpdid.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpdid.c.diff' X*** applications/aufs/afpdid.c.orig Thu May 19 12:19:31 1988 X--- applications/aufs/afpdid.c Thu Jan 26 18:19:33 1989 X*************** X*** 85,90 X int xd_idsize; /* size of idirs array */ X } ExtDir; X X /* X * nfind scans and finds whether a particular directory "dir" has a X * subdirectory by the name "nam" X X--- 85,93 ----- X int xd_idsize; /* size of idirs array */ X } ExtDir; X X+ private char *ipathstr(); X+ private sdword NewEDirid(); X+ X /* X * nfind scans and finds whether a particular directory "dir" has a X * subdirectory by the name "nam" X*************** X*** 112,118 X char *name; X { X IDirP dir; X- sdword NewEDirid(); X X dir = (IDirP) malloc(sizeof(IDir)); X dir->name = (char *) malloc((unsigned) strlen(name)+1); X X--- 115,120 ----- X char *name; X { X IDirP dir; X X dir = (IDirP) malloc(sizeof(IDir)); X dir->name = (char *) malloc((unsigned) strlen(name)+1); X*************** X*** 162,168 X IDirP cd; X { X static char paths[MAXPATHLEN]; X- char *ipathstr(); X X if (lastcd == cd) /* same as last request? */ X return(paths); /* yes.. just return old paths */ X X--- 164,169 ----- X IDirP cd; X { X static char paths[MAXPATHLEN]; X X if (lastcd == cd) /* same as last request? */ X return(paths); /* yes.. just return old paths */ SHAR_EOF if test 1305 -ne "`wc -c < 'afpdid.c.diff'`" then echo shar: error transmitting "'afpdid.c.diff'" '(should have been 1305 characters)' fi fi # end of overwriting check echo shar: extracting "'afpdir.c.diff'" '(459 characters)' if test -f 'afpdir.c.diff' then echo shar: will not over-write existing file "'afpdir.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpdir.c.diff' X*** applications/aufs/afpdir.c.orig Thu May 19 12:19:33 1988 X--- applications/aufs/afpdir.c Thu Jan 26 18:17:19 1989 X*************** X*** 43,48 X #include "afpntoh.h" X #include "afps.h" /* common server header */ X X /* X * OSErr FPGetDirParms(byte *p,byte *r,int *rl) X * X X--- 43,50 ----- X #include "afpntoh.h" X #include "afps.h" /* common server header */ X X+ private int EnumPack(); X+ X /* X * OSErr FPGetDirParms(byte *p,byte *r,int *rl) X * SHAR_EOF if test 459 -ne "`wc -c < 'afpdir.c.diff'`" then echo shar: error transmitting "'afpdir.c.diff'" '(should have been 459 characters)' fi fi # end of overwriting check echo shar: extracting "'afpdt.c.diff'" '(391 characters)' if test -f 'afpdt.c.diff' then echo shar: will not over-write existing file "'afpdt.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpdt.c.diff' X*** applications/aufs/afpdt.c.orig Thu May 19 12:19:36 1988 X--- applications/aufs/afpdt.c Thu Jan 26 18:15:43 1989 X*************** X*** 81,86 X #define REMOVEAPPLIDB 0 X #define REMOVEICONIDB 1 X X /* X * PrintINode(AVLUData *node) X * X X--- 81,88 ----- X #define REMOVEAPPLIDB 0 X #define REMOVEICONIDB 1 X X+ private ReadIDesk(), ReadADesk(); X+ X /* X * PrintINode(AVLUData *node) X * SHAR_EOF if test 391 -ne "`wc -c < 'afpdt.c.diff'`" then echo shar: error transmitting "'afpdt.c.diff'" '(should have been 391 characters)' fi fi # end of overwriting check echo shar: extracting "'afposenum.c.diff'" '(7261 characters)' if test -f 'afposenum.c.diff' then echo shar: will not over-write existing file "'afposenum.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afposenum.c.diff' X*** applications/aufs/afposenum.c.orig Thu May 19 12:19:54 1988 X--- applications/aufs/afposenum.c Fri Dec 9 11:13:30 1988 X*************** X*** 29,34 X #include X #include X #include X #include "afps.h" X #include "afpdt.h" X #include "afpgc.h" X X--- 29,35 ----- X #include X #include X #include X+ #include X #include "afps.h" X #include "afpdt.h" X #include "afpgc.h" X*************** X*** 57,62 X private void EC_Free(); X private iselect(); X X /* X * int iselect(struct direct *d) X * X X--- 58,68 ----- X private void EC_Free(); X private iselect(); X X+ #ifdef NOCASEMATCH X+ private noCaseDir(); X+ private searchDirectory(); X+ #endif NOCASEMATCH X+ X /* X * int iselect(struct direct *d) X * X*************** X*** 426,433 X X OSfname(r,idir,fn,typ) X IDirP idir; X! char *fn,*r; X! int typ; X { X char *p; X X X--- 432,439 ----- X X OSfname(r,idir,fn,typ) X IDirP idir; X! register char *fn,*r; X! register int typ; X { X register char *p; X X*************** X*** 429,435 X char *fn,*r; X int typ; X { X! char *p; X X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X X--- 435,441 ----- X register char *fn,*r; X register int typ; X { X! register char *p; X X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X*************** X*** 434,442 X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X X- if (typ != F_DATA) X- *r++ = '/'; X- X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; ) X *r++ = *p++; X X--- 440,445 ----- X for (p = pathstr(idir); *p != '\0';) /* copy the directory */ X *r++ = *p++; X X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; ) X *r++ = *p++; X*************** X*** 438,444 X *r++ = '/'; X X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X! for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; ) X *r++ = *p++; X X if (*fn != '\0') /* add slash */ X X--- 441,447 ----- X *r++ = *p++; X X if (typ == F_RSRC || typ == F_FNDR) /* append directory names */ X! for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; ) X *r++ = *p++; X X if (*fn != '\0') { /* add slash */ X*************** X*** 441,447 X for (p = ((typ == F_RSRC) ? RFDIRFN : FIDIRFN); *p != '\0'; ) X *r++ = *p++; X X! if (*fn != '\0') /* add slash */ X *r++ = '/'; /* if not null file */ X while (*fn != '\0') X *r++ = *fn++; X X--- 444,450 ----- X for (p = ((typ == F_RSRC) ? RFDIR : FIDIR); *p != '\0'; ) X *r++ = *p++; X X! if (*fn != '\0') { /* add slash */ X *r++ = '/'; /* if not null file */ X while (*fn != '\0') X *r++ = *fn++; X*************** X*** 443,450 X X if (*fn != '\0') /* add slash */ X *r++ = '/'; /* if not null file */ X! while (*fn != '\0') X! *r++ = *fn++; X *r = '\0'; X } X X X--- 446,454 ----- X X if (*fn != '\0') { /* add slash */ X *r++ = '/'; /* if not null file */ X! while (*fn != '\0') X! *r++ = *fn++; X! } X *r = '\0'; X } X X*************** X*** 447,452 X *r++ = *fn++; X *r = '\0'; X } X- X X X X--- 451,456 ----- X } X *r = '\0'; X } X X toResFork(str, fn) X register char *str; X*************** X*** 449,452 X } X X X X X--- 452,462 ----- X *r = '\0'; X } X X+ toResFork(str, fn) X+ register char *str; X+ char *fn; X+ { X+ register char *fp, *tp; X X if(*fn) { /* a real file */ X if(fp = rindex(str, '/')) /* skip over last slash */ X*************** X*** 450,452 X X X X X--- 458,617 ----- X { X register char *fp, *tp; X X+ if(*fn) { /* a real file */ X+ if(fp = rindex(str, '/')) /* skip over last slash */ X+ fp++; X+ else X+ fp = str; X+ str = fp; X+ fp = str + strlen(str); X+ tp = fp + DIRRFLEN; X+ *tp = 0; X+ while(fp > str) /* move filename, leaving space for .resource */ X+ *--tp = *--fp; X+ fp = DIRRF; X+ while(*fp) X+ *str++ = *fp++; X+ } else /* a directory */ X+ strcat(str,RFDIR); /* just append .resource */ X+ } X+ X+ toFinderInfo(str, fn) X+ register char *str; X+ char *fn; X+ { X+ register char *fp, *tp; X+ X+ if(*fn) { /* a real file */ X+ if(fp = rindex(str,'/')) /* skip over last slash */ X+ fp++; X+ else X+ fp = str; X+ str = fp; X+ fp = str + strlen(str); X+ tp = fp + DIRFILEN; X+ *tp = 0; X+ while(fp > str) /* move filename, leaving space for .finderinfo */ X+ *--tp = *--fp; X+ fp = DIRFI; X+ while(*fp) X+ *str++ = *fp++; X+ } else /* a directory */ X+ strcat(str,FIDIR); /* just append .finderinfo */ X+ } X+ X+ #ifdef NOCASEMATCH X+ #include X+ #include X+ X+ /* X+ * searchDirectory(dir, name) X+ * Do a case insensitive search for name in dir, and write the true name X+ * of the file in name. X+ */ X+ X+ private X+ searchDirectory(dir, name) X+ char *dir, *name; X+ { X+ register char *fp, *tp; X+ register DIR *dp; X+ register struct direct *d; X+ register int len; X+ char lname[BUFSIZ], dname[BUFSIZ]; X+ X+ if((dp = opendir(dir)) == NULL) X+ return(0); X+ len = 0; X+ for(fp = name, tp = lname ; *fp ; fp++) { X+ *tp++ = isupper(*fp) ? tolower(*fp) : *fp; X+ len++; X+ } X+ *tp = 0; X+ while(d = readdir(dp)) { X+ if(d->d_namlen != len) X+ continue; X+ for(fp = d->d_name, tp = dname ; *fp ; fp++) X+ *tp++ = isupper(*fp) ? tolower(*fp) : *fp; X+ *tp = 0; X+ if(strcmp(dname, lname) == 0) { X+ strcpy(name, d->d_name); X+ closedir(dp); X+ return(1); X+ } X+ } X+ closedir(dp); X+ return(0); X+ } X+ X+ /* X+ * noCaseDir(path) X+ * Recursively verify the components of path. X+ */ X+ X+ private X+ noCaseDir(path) X+ register char *path; X+ { X+ register char *last; X+ register int status; X+ X+ if(access(path, F_OK) >= 0) X+ return(1); X+ if(last = rindex(path, '/')) { X+ if(last == path) X+ return(searchDirectory("/", last + 1)); X+ else { X+ *last++ = 0; X+ status = 0; X+ if(noCaseDir(path)) X+ status = searchDirectory(path, last); X+ *--last = '/'; X+ return(status); X+ } X+ } X+ return(searchDirectory(".", path)); X+ } X+ X+ /* X+ * noCaseFind(path) X+ * noCaseFind() calls noCaseDir() and searchDirectory() recursively to X+ * take path (case insensitive) and converts it to (case sensitive) newpath X+ * corresponding to the true Unix filename. This is mainly to fix X+ * HyperCard doing funny things to stack names. X+ */ X+ X+ void X+ noCaseFind(path) X+ register char *path; X+ { X+ register char *last; X+ X+ if(last = rindex(path, '/')) { X+ if(last == path) X+ searchDirectory("/", last + 1); X+ else { X+ *last++ = 0; X+ if(noCaseDir(path)) X+ searchDirectory(path, last); X+ *--last = '/'; X+ } X+ } else X+ searchDirectory(".", path); X+ } X+ X+ /* X+ * noCaseMatch(path) X+ * noCaseMatch() tests path first and will call noCaseFind() is path X+ * doesn't exist. X+ */ X+ X+ void X+ noCaseMatch(path) X+ register char *path; X+ { X+ if(access(path, F_OK) >= 0) X+ return; X+ noCaseFind(path); X+ } X+ #endif NOCASEMATCH SHAR_EOF if test 7261 -ne "`wc -c < 'afposenum.c.diff'`" then echo shar: error transmitting "'afposenum.c.diff'" '(should have been 7261 characters)' fi fi # end of overwriting check echo shar: extracting "'afposfi.c.diff'" '(6644 characters)' if test -f 'afposfi.c.diff' then echo shar: will not over-write existing file "'afposfi.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afposfi.c.diff' X*** applications/aufs/afposfi.c.orig Thu May 19 12:19:56 1988 X--- applications/aufs/afposfi.c Thu Jan 26 18:22:52 1989 X*************** X*** 63,68 X private void fc_flush_start(); X private void fc_flush_end(); X private FileInfo *os_getfi(); X X #define FICacheSize 128 X /* Each cache entry has a lifetime that it goes through before it must */ X X--- 63,69 ----- X private void fc_flush_start(); X private void fc_flush_end(); X private FileInfo *os_getfi(); X+ private fc_readent(); X X #define FICacheSize 128 X /* Each cache entry has a lifetime that it goes through before it must */ X*************** X*** 104,109 X X OSfname(path, pdir, "", F_FNDR); /* get directory */ X if (stat(path, &stb) < 0) { X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X X--- 105,118 ----- X X OSfname(path, pdir, "", F_FNDR); /* get directory */ X if (stat(path, &stb) < 0) { X+ #ifdef NOCASEMATCH X+ noCaseFind(path); X+ if (stat(path, &stb) < 0) { X+ fcf_val_dir = NILDIR; X+ fcf_val_time = 0; X+ return; /* nothing else we can do */ X+ } X+ #else NOCASEMATCH X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X*************** X*** 107,112 X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X } X fcf_val_dir = pdir; X fcf_val_time = stb.st_mtime; /* remember */ X X--- 116,122 ----- X fcf_val_dir = NILDIR; X fcf_val_time = 0; X return; /* nothing else we can do */ X+ #endif NOCASEMATCH X } X fcf_val_dir = pdir; X fcf_val_time = stb.st_mtime; /* remember */ X*************** X*** 142,147 X if (fcf_val_dir == fe->fe_pdir && X (fcf_val_time > fe->fe_mtime) && X (fcf_val_time > fe->fe_vtime)) { X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X X--- 152,164 ----- X if (fcf_val_dir == fe->fe_pdir && X (fcf_val_time > fe->fe_mtime) && X (fcf_val_time > fe->fe_vtime)) { X+ #ifdef NOCASEMATCH X+ if (stat(path, &stb) < 0) { X+ noCaseFind(path); X+ if (stat(path, &stb) < 0) X+ return; /* nothing else we can do */ X+ } X+ #else NOCASEMATCH X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X #endif NOCASEMATCH X*************** X*** 144,149 X (fcf_val_time > fe->fe_vtime)) { X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X fe->fe_okay = FALSE; /* make entry as bad */ X } X X--- 161,167 ----- X #else NOCASEMATCH X if (stat(path, &stb) < 0) X return; /* nothing else we can do */ X+ #endif NOCASEMATCH X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X fe->fe_okay = FALSE; /* make entry as bad */ X } X*************** X*** 167,172 X if ((fe->fe_pdir->flags & DID_FINDERINFO) == 0) /* always okay */ X return(fe->fe_okay); X OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR); X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X X--- 185,197 ----- X if ((fe->fe_pdir->flags & DID_FINDERINFO) == 0) /* always okay */ X return(fe->fe_okay); X OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR); X+ #ifdef NOCASEMATCH X+ if (stat(path, &stb) < 0) { X+ noCaseFind(path); X+ if (stat(path, &stb) < 0) X+ return(fe->fe_okay); /* nothing else we can do */ X+ } X+ #else NOCASEMATCH X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X #endif NOCASEMATCH X*************** X*** 169,174 X OSfname(path, fe->fe_pdir, fe->fe_fnam, F_FNDR); X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X return(FALSE); /* bad entry */ X } X X--- 194,200 ----- X #else NOCASEMATCH X if (stat(path, &stb) < 0) X return(fe->fe_okay); /* nothing else we can do */ X+ #endif NOCASEMATCH X if (stb.st_mtime != fe->fe_mtime) /* reload entry */ X return(FALSE); /* bad entry */ X } X*************** X*** 253,258 X printf("fc_readent: reading %s\n",path); X X fd = open(path,O_RDONLY); X if (fd >= 0) { X OSLockFileforRead(fd); X err = fstat(fd, &stb); X X--- 279,290 ----- X printf("fc_readent: reading %s\n",path); X X fd = open(path,O_RDONLY); X+ #ifdef NOCASEMATCH X+ if(fd < 0) { X+ noCaseFind(path); X+ fd = open(path,O_RDONLY); X+ } X+ #endif NOCASEMATCH X if (fd >= 0) { X OSLockFileforRead(fd); X err = fstat(fd, &stb); X*************** X*** 309,314 X X /* convert name to internal name */ X OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */ X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X if (S_ISDIR(stb.st_mode)) { X X--- 341,353 ----- X X /* convert name to internal name */ X OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */ X+ #ifdef NOCASEMATCH X+ if (stat(path,&stb) != 0) { /* check if it exists */ X+ noCaseFind(path); X+ if (stat(path,&stb) != 0) /* check if it exists */ X+ return(aeObjectNotFound); /* no... */ X+ } X+ #else NOCASEMATCH X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X #endif NOCASEMATCH X*************** X*** 311,316 X OSfname(path,fe->fe_pdir,fe->fe_fnam,F_DATA); /* create plain name */ X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X if (S_ISDIR(stb.st_mode)) { X fi->fi_comln = 0; X } else { X X--- 350,356 ----- X #else NOCASEMATCH X if (stat(path,&stb) != 0) /* check if it exists */ X return(aeObjectNotFound); /* no... */ X+ #endif NOCASEMATCH X if (S_ISDIR(stb.st_mode)) { X fi->fi_comln = 0; X } else { X*************** X*** 352,358 X printf("WriteFA: writing %s\n",path); X X needu++; X! if ((fd = open(path,O_WRONLY)) < 0) { /* open for write */ X if (errno != ENOENT) { X printf("WriteFA: error openning %s errno=%d\n",path,errno); X return; X X--- 392,405 ----- X printf("WriteFA: writing %s\n",path); X X needu++; X! fd = open(path,O_WRONLY); X! #ifdef NOCASEMATCH X! if(fd < 0) { X! noCaseFind(path); X! fd = open(path,O_WRONLY); X! } X! #endif NOCASEMATCH X! if (fd < 0) { /* open for write */ X if (errno != ENOENT) { X printf("WriteFA: error openning %s errno=%d\n",path,errno); X return; SHAR_EOF if test 6644 -ne "`wc -c < 'afposfi.c.diff'`" then echo shar: error transmitting "'afposfi.c.diff'" '(should have been 6644 characters)' fi fi # end of overwriting check echo shar: extracting "'afps.h.diff'" '(895 characters)' if test -f 'afps.h.diff' then echo shar: will not over-write existing file "'afps.h.diff'" else sed 's/^X//' << \SHAR_EOF > 'afps.h.diff' X*** applications/aufs/afps.h.orig Thu May 19 12:20:07 1988 X--- applications/aufs/afps.h Thu Dec 1 11:08:02 1988 X*************** X*** 182,187 X char *OSEnumGet(); X int OSEnumInit(); X void OSEnumDone(); X X /* Portable library functions */ X X X--- 182,191 ----- X char *OSEnumGet(); X int OSEnumInit(); X void OSEnumDone(); X+ #ifdef NOCASEMATCH X+ void noCaseFind(); X+ void noCaseMatch(); X+ #endif NOCASEMATCH X X /* Portable library functions */ X X*************** X*** 197,202 X X #define RFDIR "/.resource" X #define FIDIR "/.finderinfo" X X /* Finder info bits */ X #define DEFCMNT "This is a Unix\252 created file." X X--- 201,211 ----- X X #define RFDIR "/.resource" X #define FIDIR "/.finderinfo" X+ X+ #define DIRRF ".resource/" X+ #define DIRFI ".finderinfo/" X+ #define DIRRFLEN 10 X+ #define DIRFILEN 12 X X /* Finder info bits */ X #define DEFCMNT "This is a Unix\252 created file." SHAR_EOF if test 895 -ne "`wc -c < 'afps.h.diff'`" then echo shar: error transmitting "'afps.h.diff'" '(should have been 895 characters)' fi fi # end of overwriting check echo shar: extracting "'afpserver.c.diff'" '(460 characters)' if test -f 'afpserver.c.diff' then echo shar: will not over-write existing file "'afpserver.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'afpserver.c.diff' X*** applications/aufs/afpserver.c.orig Thu May 19 12:20:09 1988 X--- applications/aufs/afpserver.c Thu Jan 26 18:13:56 1989 X*************** X*** 167,172 X X #define NumEntries (sizeof(Entries)/sizeof(AFPDispEntry)) X X IniServer() /* ini disp entries */ X { X int i; X X--- 167,174 ----- X X #define NumEntries (sizeof(Entries)/sizeof(AFPDispEntry)) X X+ private DumpBuf(), clockstart(), clockend(); X+ X IniServer() /* ini disp entries */ X { X int i; SHAR_EOF if test 460 -ne "`wc -c < 'afpserver.c.diff'`" then echo shar: error transmitting "'afpserver.c.diff'" '(should have been 460 characters)' fi fi # end of overwriting check echo shar: extracting "'atalkdbm.c.diff'" '(557 characters)' if test -f 'atalkdbm.c.diff' then echo shar: will not over-write existing file "'atalkdbm.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'atalkdbm.c.diff' X*** lib/cap/atalkdbm.c.orig Thu May 19 12:17:05 1988 X--- lib/cap/atalkdbm.c Fri Jan 27 14:52:15 1989 X*************** X*** 37,42 X #define HAVE_ZONE -1 /* our zone was set */ X #define CONFIGURED 1 /* set when configured */ X X /* X * Set zone name - sets alternate atalk configuration file: atalk. X * X X--- 37,44 ----- X #define HAVE_ZONE -1 /* our zone was set */ X #define CONFIGURED 1 /* set when configured */ X X+ static int name_toipaddr(); X+ X /* X * Set zone name - sets alternate atalk configuration file: atalk. X * SHAR_EOF if test 557 -ne "`wc -c < 'atalkdbm.c.diff'`" then echo shar: error transmitting "'atalkdbm.c.diff'" '(should have been 557 characters)' fi fi # end of overwriting check echo shar: extracting "'atis.c.diff'" '(2688 characters)' if test -f 'atis.c.diff' then echo shar: will not over-write existing file "'atis.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'atis.c.diff' X*** etc/atis.c.orig Thu May 19 12:17:32 1988 X--- etc/atis.c Fri Jan 27 12:27:46 1989 X*************** X*** 103,108 X void atis_end(); X void atis_debuginc(); X void atis_undebug(); X X void X nbp_reload() X X--- 103,109 ----- X void atis_end(); X void atis_debuginc(); X void atis_undebug(); X+ private int nbpcpy(), c2pkt_ename(), pkt2c_ename(); X X void X nbp_reload() X*************** X*** 121,127 X } else log(L_UERR|1, "dump file open failed"); X log(1, "loaded %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGHUP, nbp_reload); X } X X void X X--- 122,128 ----- X } else log(L_UERR|1, "dump file open failed"); X log(1, "loaded %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGHUP, (int (*)())nbp_reload); X } X X void X*************** X*** 142,148 X } else log(L_UERR|1, "dump file (write) open failed"); X log(1, "Dumped %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGQUIT, nbp_dump); X } X X void X X--- 143,149 ----- X } else log(L_UERR|1, "dump file (write) open failed"); X log(1, "Dumped %d entries",cnt); X sigsetmask(mask); X! (void)signal(SIGQUIT, (int (*)())nbp_dump); X } X X void X*************** X*** 161,167 X log(0, "DEBUGGING OFF"); X if (tempdebugfile) X nologfile(); X! signal(SIGEMT, atis_debuginc); X sigsetmask(mask); X } X X X--- 162,168 ----- X log(0, "DEBUGGING OFF"); X if (tempdebugfile) X nologfile(); X! signal(SIGEMT, (int (*)())atis_debuginc); X sigsetmask(mask); X } X X*************** X*** 176,182 X if (dlevel < L_LVLMAX) X dlevel++; X log(0, "DEBUG LEVEL %d", dlevel); X! signal(SIGIOT, atis_debuginc); X sigsetmask(mask); X } X X X--- 177,183 ----- X if (dlevel < L_LVLMAX) X dlevel++; X log(0, "DEBUG LEVEL %d", dlevel); X! signal(SIGIOT, (int (*)())atis_debuginc); X sigsetmask(mask); X } X X*************** X*** 354,364 X abInit(TRUE); /* init driver */ X nbpInit(); /* init NBP */ X nbptab_init(); X! (void)signal(SIGHUP, nbp_reload); X! (void)signal(SIGQUIT, nbp_dump); X! (void)signal(SIGTERM, atis_end); X! (void)signal(SIGIOT, atis_debuginc); X! (void)signal(SIGEMT, atis_undebug); X X log(0, "Reply num max for lkup reply is %d (based on %d)", X NUMREPLYMAX, NBPTUPSIZE); X X--- 355,365 ----- X abInit(TRUE); /* init driver */ X nbpInit(); /* init NBP */ X nbptab_init(); X! (void)signal(SIGHUP, (int (*)())nbp_reload); X! (void)signal(SIGQUIT, (int (*)())nbp_dump); X! (void)signal(SIGTERM, (int (*)())atis_end); X! (void)signal(SIGIOT, (int (*)())atis_debuginc); X! (void)signal(SIGEMT, (int (*)())atis_undebug); X X log(0, "Reply num max for lkup reply is %d (based on %d)", X NUMREPLYMAX, NBPTUPSIZE); SHAR_EOF if test 2688 -ne "`wc -c < 'atis.c.diff'`" then echo shar: error transmitting "'atis.c.diff'" '(should have been 2688 characters)' fi fi # end of overwriting check echo shar: extracting "'papof.c.diff'" '(470 characters)' if test -f 'papof.c.diff' then echo shar: will not over-write existing file "'papof.c.diff'" else sed 's/^X//' << \SHAR_EOF > 'papof.c.diff' X*** applications/papif/papof.c.orig Thu May 19 12:18:50 1988 X--- applications/papif/papof.c Fri Jan 27 12:05:02 1989 X*************** X*** 54,60 X X while (1) { X #ifdef BANNER X! if ((bannerfile = fopen(BANNERFILE, "w")) < 0) { X perror("Can't open .banner"); X exit(8); X } X X--- 54,60 ----- X X while (1) { X #ifdef BANNER X! if ((bannerfile = fopen(BANNERFILE, "w")) == NULL) { X perror("Can't open .banner"); X exit(8); X } SHAR_EOF if test 470 -ne "`wc -c < 'papof.c.diff'`" then echo shar: error transmitting "'papof.c.diff'" '(should have been 470 characters)' fi fi # end of overwriting check # End of shell archive exit 0 --- end of part 1 ---