[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

1798.0. "IFF CAT(?) archiver and CLIcon..." by ROMULN::MYEE (Boycott Styrofoam cups, save the ozone.) Thu Oct 20 1988 15:21

    
    I extracted the following from the USENET a while back, and just
    UNshared it today.  I don't know what it does.  Maybe one of you
    can tell me what a CAT archive is ??  You can get IFFAR - IFF CAT
    archiver at:
    
    ROMULN""::DUB3:[PUBLIC.AMIGA]IFFAR.ARC
    
    _Mike_
    (Next note <.1> describes CLIcon)
    
--------------------- r e a d m e   f i l e ----------------------------------

iffar - IFF CAT Archiver, Release 1.2, 5/9/88
 
Written by: 
 
	Karl Lehenbauer
	3918 Panorama
	Missouri City, TX  77459
	usenet:  ..uunet!nuchat!sugar!karl  or  ..bellcore!tness7!sugar!karl
	BIX: kelehen
 
All liability is disclaimed!  This code is free.  We do not have a contract.
 
This software, source and binary, is released to the public domain, 5/9/88.
 
I ask that you retain my name as the original author in the source and
documentation if you redistribute this and that I be credited in the user 
manual if iffar is redistributed with a commercial product.
 
Regards,  Karl Lehenbauer @ The Hacker's Haven,  Missouri City, Texas, 5/9/88
 
---------------------------------------------------------------------
 
NAME
 
	iffar - IFF CAT archiver
 
SYNOPSIS
 
	iffar option [posname] archive_file [IFF_file] ...
 
DESCRIPTION
 
	Iffar maintains archives of Interchange File Format (IFF) FORM, CAT 
	and LIST  files in a manner  that complies with the IFF CAT specification.
 
	IFF CAT archives should be portable to different machines.  No promises.
 
	The option string must start with 'd', 'q', 'r', 't' or 'x' and may
	additionally have modifiers of 'a', 'b', 'c', 'i' or 'v'.  Not all
	modifiers are valid with all options.
 
	The options are:
 
		'd'		Delete named IFF files from the CAT archive.
 
		'q'		Quickly append named IFF files to the CAT archive.
 
		'r'		Replace named IFF files in the CAT archive; append new ones.
 
		't'		Print a table of contents of the CAT archive.
 
		'x'		Extract named IFF files from the CAT archive.
				If no names are specified, all files are extracted.
 
 
	The modifiers are:
		'a'		"after", replace or append IFF files after entry in CAT
					archive named by posname 
 
		'b'		"before", replace or append IFF files before entry in CAT
					archive named by posname
 
		'c'		Do not print a message indicating archive is being created
					when it must be created.
 
		'i'		a synonym for "before"
 
		'v'		print verbose description of all activity
				For table of contents, prints IDs, and
				lengths of chunks within the IFF file chunks
				in the CAT archive.  It prints the contents of
				chunks that it knows to be textual and short.
 
 
	On all operations that modify the archive, except for "quick append",
	the archive will be renamed with a ".old" extension and a new archive
	will be created.
 
	The "quick append" option causes the named files to be added to the
	end of the archive without rewriting the archive or looking to see
	if the entry already exists.  This is to avoid quadratic behavior
	when building up an archive one or just a few entries at a time.
 
	Wildcards of the semi-Unix-type as supplied by Manx are provided.
 
	Only the basename of the specified IFF filenames will be used for
	element names within the archive.  In other words, pathnames are
	stripped from filenames to create the archive element name.
	This is also true for extracts.  
	
EXAMPLES
 
	iffar x foo ram:t/bar
 
		would extract element "bar" from archive "foo" into file 
		"ram:t/bar"
		
	iffar ra sounds Cabasa dh0:sounds/Snare
	
		would replace a FORM, CAT or LIST named Snare in the 
		archive with dh0:sounds/Snare, placing Snare directly 
		after Cabasa.  If Cabasa is not found in the archive,
		Snare is placed at the end.
 
BUGS
 
	The archive will be corrupted if a write error (including
	running out of disk space) occurs during "quick 
	append" mode and there won't be a ".old" backup file.
 
	Running out of disk space leaves corrupted archives.
	For all options but "q" the ".old" backup file will contain
	the archive in its state prior to the run that blew it up.
	The program should delete the corrupted archive and restore 
	the ".old" file, but it doesn't.
 
IMPLEMENTATION NOTES
 
	Iffar is written to run under Manx Aztec C 3.6a for the Amiga
	under AmigaDOS version 1.2.
 
	My IFF archiving routines were written to be well-behaved from an 
	IFF point of view; that is, they try to respect the virtual 
	end-of-file defined by the size field of a chunk's header when 
	diving through the chunk's subchunks.  It makes for more work to use
	the routines, but adds some certainty that the program is working
	properly.  I don't know.  The IFF spec requests that we do, so I do.
 
	Note that when converting your code to use a CAT file instead of
	reading several FORM files (it's about twice as fast for an
	application of mine involving about 25 files from two to ten
	kilobytes each, reading them in from floppy.), your code needs 
	to either be driven by the files  read from the CAT (you search 
	a list of names you're looking for when you see a FORM and load 
	what you want) or your code has to know what's coming from the 
	CAT specifically.  I'd prefer that you do the former, of course.
	The table of contents routines (toc.c) provide a reasonable template 
	for your CAT-reading application.
 
NOTES FOR THOSE WISHING TO PORT THE ARCHIVER
 
	Knock yourselves out.  The code is written using standard C library
	calls, with the exception of calls to "scdir", which Manx uses as
	a means of expanding wildcards.  If you get it to work on a different
	system, such as Unix System/V, please send me a copy, preferably
	with #ifdefs so the Manx stuff still works.  Ultimately, I think an
	alternative "_main" startup routine should be written for the Amiga
	that expands wildcards inline to provide an argc and argv as they
	would look on Unix after the shell had expanded all the wildcards.
 
 
REVISION HISTORY
 
4/25/88, version 1.1
 
	Initial version - never distributed, as far as I know
 
5/9/88, version 1.2
 
	Made 'r' (replace) option create the archive if it isn't there.
 
	Fixed bug that caused the IFF reader to get lost when doing
	  a verbose table of contents on certain archives.
 
	Flattened the source directory structure.
 
	Updated the documentation.
 
-----------------------------------------------------------------------------

T.RTitleUserPersonal
Name
DateLines
1798.1CLIcon utilityROMULN::MYEEBoycott Styrofoam cups, save the ozone.Thu Oct 20 1988 15:2663
    
    Another program fresh off the Usenet to replase IconExec.  You can
    get it from:
    
    ROMULN""::DUB3:[PUBLIC.AMIGA]CLICON.ARC
    
    _Mike_ (DECwindows_is_a_plot_to_make_emacs_look_simple)
    
    
-------------------- C L I c o n   D O C -------------------------------------

                                CLIcon
                    Icon executer for CLI programs
                   Copyright (C) by 1988 Bryan Ford
 
    I wrote this program because, basically, I wasn't at all satisfied with
IconExec, which is the only other one I know of.  First, IconExec requires
a separate copy each time it's used.  Second, it gives very little control
over the window size, and doesn't give the option to halt the window after
the program has finished executing.  So here is my version.
    To use it, you should copy CLIcon to C: or another place on your
Workbench disk, so it is easily accessible by all its "clients".  Then, all
you need to do is create icons for all of the CLI programs you want to run.
They must be PROJECT icons, not TOOL icons.  If you don't have a project
icon handy, just load up an application (like the Notepad), save a project
of some kind, and just use its icon.  You can edit the icon with IconEd.
    To set up the icon so it will load with CLIcon, use the Workbench Info
command.  Set the Default Tool field to C:CLIcon or wherever you put it.
The ToolTypes field can have several things.  There is one required
ToolType: COMMAND.  Set this to the command you wish to execute when this
icon is activated.  It must contain the full path to the CLI program, even
if it is in the same directory as the icon, unless it's in the C directory.
(This is a bug I couldn't fix, and I don't have time to work on it.)  For
example, to get a directory of RAM whenever you click the icon, set a
ToolType as "COMMAND=Dir RAM:".
    You can set the optional WINDOW tooltype to the name to open for the
program's window.  If you don't specify it, it defaults to
"CON:0/0/640/200/Application Window".  If you wanted the RAW: device, with
a smaller window, you might use "RAW:10/10/100/50/Raw Window" or something
like that.
    The last ToolType, FLAGS, can activate two features of CLIcon.  If it
containts WAITBEFORE, then CLIcon will pause before it runs the program
with a message, and wait for you to press RETURN.  If it contains
WAITAFTER, it will pause after the program is run, when it is about to
close the window.  This gives you a chance to see the program's output
before you lose the window.  If you want both, just use
"FLAGS=WAITBEFORE|WAITAFTER".
    I haven't had time to test this program fully, so please report any
bugs to me.  One problem I had while testing was when I was using Info to
change the icon's parameters.  The ToolTypes started merging together.  I
think (hope :) it's a problem with Info, not CLIcon, since CLIcon wasn't
even running when it happened.
    I'm not going to require a donation, but if you use it a lot and think
it's worth something, just send whatever you think it's worth to the
address below.  Comments and ideas welcome, flames sent to NIL:.
    Enjoy!
                            Bryan Ford
                    Snail:  1790 East 1400 North
                            Logan, UT 84321
                    Phone:  (801)753-1159
                    Bitnet: FATQW@USU