[comp.sys.amiga] ANSII C-improvements for find12.1

rcpt@rwb.urc.tue.nl (Piet Tutelaers) (12/01/90)

Submitted-by: munnari!bhpese.oz.au!rodney@uunet.UU.NET
Posting-number: Volume 89, Issue 46
Archive-name: unix/find12.1
Rodney Lewis

Hello Rodney (and everybody else),

I use zoo as my favourite archiver to interchange data between my Amiga
and our UNIX boxes at work.  The version of find I used, had as drawback
that it generates absolute filenames instead of relative ones as is the
case on UNIX.  So I looked and found your find12.1 version 
   ftp server: abcfd20.larc.nasa.gov 
   in:         amiga/usenet/comp.sources.amiga/volume89/unix/find12.1.Z. 
Compilation with mancx5.0a gave some problems I have solved.  The
patches to the Makefile and to the program find.c to get everything
through this compiler are included. 

Now I can create archives on my Amiga1000 with the MessyDOS handler in
this way:
	msh:find chess -type f -print | zoo aI msh:chess
	
as I indeed wanted! Which proofs that the AMIGA is still a great machine.

The Find program in usenet/comp.binaries.amiga/volume90/unix/find-3.9c.Z
on the same server does not run on my Amiga (WB1.3 with ARP1.3), and
should be replaced by the binary of find12.1!

Best wishes,

Piet

(Sorry I did not send context diffs. My Amiga `diff' does not support it.)

--------------------------- Makefile.diff -------------------------------
4c4
< 	cc -E200 $*.c
---
> 	cc $*.c
--------------------------- find.c.diff -------------------------------
46a47,54
> /* define new 1.3 protection bits */
> 
> #ifndef FIBB_HIDDEN
> #define FIBB_HIDDEN	7L
> 
> #define FIBF_HIDDEN	(1L << FIBB_HIDDEN)
> #endif
> 
55,64d62
< #ifndef FIBB_HIDDEN
< #define FIBB_HIDDEN	7L
< #define FIBB_SCRIPT	6L
< #define FIBB_PURE	5L
< 
< #define FIBF_HIDDEN	(1L << FIBB_HIDDEN)
< #define FIBF_SCRIPT	(1L << FIBB_SCRIPT)
< #define FIBF_PURE	(1L << FIBB_PURE)
< #endif
< 
140c138
< 	DateStamp(&date);
---
> 	DateStamp((long *)&date);
165c163
< 			start = Lock(argv[i], ACCESS_READ);
---
> 			start = (struct FileLock *) Lock(argv[i], ACCESS_READ);
172c170
< 			UnLock(start);
---
> 			UnLock((BPTR) start);
211c209
< 	if (Examine(lock, fib)) {
---
> 	if (Examine((BPTR) lock, (BPTR) fib)) {
240c238
< 		while(ExNext(lock, fib)) {
---
> 		while(ExNext((BPTR) lock, (BPTR) fib)) {
254c252,253
< 				nlock = Lock(file, ACCESS_READ);
---
> 				nlock = (struct FileLock *) 
> 				           Lock(file, ACCESS_READ);
259c258
< 					UnLock(nlock);
---
> 					UnLock((BPTR) nlock);
507c506
< 			if (node_head == NULL_PRIM) {
---
> 			if ((long *) node_head == (long *) NULL_PRIM) {
740c739,740
< 			if (lock = Lock(argv[++i])) {
---
> 			if (lock = (struct FileLock *) 
> 			    Lock(argv[++i], ACCESS_READ)) {
744c744
< 					UnLock(lock);
---
> 					UnLock((BPTR) lock);
748,751c748,751
< 				if (Examine(lock, fib) == 0) {
< 					fprintf(stderr, "could not examine %s\n", argv[i]);
< 					FreeMem(fib, (long) sizeof(struct FileInfoBlock));
< 					UnLock(lock);
---
> 				if (Examine((BPTR) lock, (BPTR) fib) == 0) {
> 					fprintf(stderr, "could not examine %s\n", argv[i]);
> 					FreeMem(fib, (long) sizeof(struct FileInfoBlock));
> 					UnLock((BPTR) lock);
761c761
< 					UnLock(lock);
---
> 					UnLock((BPTR) lock);
769c769
< 				UnLock(lock);
---
> 				UnLock((BPTR) lock);