home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- * WriteIcon V1.0 by Dan Burris
- ***************************************************************************/
- /* Here is a tool that will write you an Icon by path and name, and can
- be changed easily to another Icon type and Image, by using Icon2C by
- Carol Scheppner (on Fred Fish #56), or can be hacked into your program
- to have it generate Icon files for the files that that program saves.
-
- This code is hereby released as Public domain,and do what you will with
- it, just don't do anything malicious, and don't blame me!
-
- The following are compiling instructions for Manx.
-
- cc +c +d writeicon.c
- ln writeicon.o -lc32
- */
-
-
- #include <exec/types.h>
- #include <intuition/intuition.h>
- #include <intuition/intuitionbase.h>
- #include <workbench/workbench.h>
- #include <workbench/startup.h>
-
- #define bufSize 512
- #define INBUFSZ 40
- #define CLEAR '\012'
-
- /* Other Stuff */
- extern UBYTE *OpenLibrary();
- struct IntuitionBase *IntuitionBase;
- struct GfxBase *GfxBase;
- struct DosBase *DosBase;
- struct IconBase *IconBase;
-
- BOOL fromWB;
- char sbuf[INBUFSZ];
- char nbuf[INBUFSZ];
-
-
-
- /* If you are using Lattice, ignore the comments below about changing
- the the Image structure(s) and dig up the Lattice compile and Blink
- instructions you need.
- */
-
- /*
- Definitions for Project Icon begin's here. The code that follows came
- almost straight out of Carol Scheppner's program, Icon2c. You may use that
- program ( on Fred Fish #56) and cut and paste the code that it generates
- in place of this diskobject structure, then change the image structure(s)
- declaration from "USHORT image1[] = {" to "struct Image image1[] = {",
- and change the "(USHORT *)&imageData1," in the same image structure to
- "&imageData1[0]," (if there is a 2nd Image, do the same for it!)
- then recompile with manx. It currently has the Project Icon from the
- Fish disks of a book that opens on one click, uses :c/less read a text file.
- */
- /* Start cut and paste after this comment! */
-
-
- USHORT imageData1[] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5540, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x455F, 0xD555, 0x5540, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4556, 0xD555, 0x5545, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4556, 0x67D7, 0xD547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4556, 0x6767, 0x6547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4556, 0x6666, 0x4547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4556, 0xC666, 0x7547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x455F, 0xC7C7, 0xC547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4554, 0x1505, 0x0547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45FD, 0x7575, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45CC, 0x5171, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45C4, 0x7571, 0x7D47, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45F5, 0x7171, 0xCD47, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45C1, 0x7171, 0xFC47, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45C5, 0x7171, 0xC047, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x45E5, 0x7979, 0x7D47, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4505, 0x4141, 0x4147, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5540, 0x0147, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x4555, 0x5555, 0x5547, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x2FFF, 0xFFFF, 0xFFFF, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x1555, 0x5555, 0x5555, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- /**/
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000,
- 0x0000, 0x0000, 0x0001, 0xFFF0, 0x7FFF, 0xFFFF, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFF9, 0x3FFF, 0xFFFF, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFF9, 0x9C3C, 0x3FFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFF9, 0x9999, 0x9FFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFF9, 0x9999, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFF9, 0x3999, 0x9FFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFF0, 0x7C3C, 0x3FFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFE03, 0xCF8F, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFF33, 0xFFCF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFF3F, 0x8FCF, 0x87FB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFF0F, 0xCFCF, 0x33FB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFF3F, 0xCFCF, 0x03FB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFF3F, 0xCFCF, 0x3FFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFE1F, 0x8787, 0x87FB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFB, 0xC000,
- 0x0000, 0x0000, 0x0001, 0xF800, 0x0000, 0x0003, 0xC000,
- 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000,
- 0x0000, 0x0000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xC000,
- /**/
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- /**/
- };
-
- struct Image image1[] = {
- 0, /* LeftEdge */
- 0, /* TopEdge */
- 98, /* Width */
- 29, /* Height */
- 3, /* Depth */
- &imageData1[0], /* ImageData */
- 0xFF, /* PlanePick */
- 0x0, /* PlaneOnOff */
- 0, /* [NextImage] */
- };
-
- USHORT imageData2[] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2AAA, 0xAAAA, 0xAAA8, 0x0555, 0x5555, 0x5555, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37EA, 0xAAAA, 0xAAE0, 0x03EA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37D5, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x3755, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x3755, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFE0, 0x03FF, 0xFFFF, 0xFFFB, 0x0000,
- 0x3755, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37D5, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x3755, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x3755, 0x5555, 0x557E, 0xBFAA, 0xAAAA, 0xAABB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFE0, 0x03FF, 0xFFFF, 0xFFFB, 0x0000,
- 0x37FF, 0xFF5F, 0xFFFE, 0xBFFF, 0xFEBF, 0xFFFB, 0x0000,
- 0x37FF, 0xFFFF, 0xFFFE, 0xBFFF, 0xFFFF, 0xFFFB, 0x0000,
- 0x3000, 0x0000, 0x0000, 0x8000, 0x0000, 0x0003, 0x0000,
- 0x2AAA, 0xAAAA, 0xAAA8, 0x0555, 0x5555, 0x5555, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- /**/
- 0xFFFF, 0xFFFF, 0xFFFE, 0x1FFF, 0xFFFF, 0xFFFF, 0xC000,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF800, 0x0000, 0x001F, 0xFC15, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF82A, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF8AA, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF8AA, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x001F, 0xFC00, 0x0000, 0x0007, 0xC000,
- 0xF8AA, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF82A, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF8AA, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF8AA, 0xAAAA, 0xAA81, 0xC055, 0x5555, 0x5547, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xF800, 0x0000, 0x001F, 0xFC00, 0x0000, 0x0007, 0xC000,
- 0xF800, 0x00A0, 0x0001, 0xC000, 0x0140, 0x0007, 0xC000,
- 0xF800, 0x0000, 0x0001, 0xC000, 0x0000, 0x0007, 0xC000,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000,
- 0xFFFF, 0xFFFF, 0xFFFE, 0x1FFF, 0xFFFF, 0xFFFF, 0xC000,
- /**/
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- /**/
- };
-
- struct Image image2[] = {
- 0, /* LeftEdge */
- 0, /* TopEdge */
- 98, /* Width */
- 29, /* Height */
- 3, /* Depth */
- &imageData2[0], /* ImageData */
- 0xFF, /* PlanePick */
- 0x0, /* PlaneOnOff */
- 0, /* [NextImage] */
- };
-
- struct DiskObject diskObject = {
- WB_DISKMAGIC, /* do_Magic */
- WB_DISKVERSION, /* do_Version */
-
- /* Embedded Gadget Structure */
- 0, /* [NextGadget] */
- 21, /* LeftEdge */
- 11, /* TopEdge */
- 98, /* Width */
- 29, /* Height */
- 0x6, /* Flags */
- 0x3, /* Activation */
- 0x1, /* GadgetType */
- (APTR)&image1, /* GadgetRender */
- (APTR)&image2, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- 0x0, /* [SpecialInfo] */
- 0, /* GadgetID */
- 0x0, /* [UserData] */
-
- /* Rest of DiskObject structure */
- 0x4, /* do_Type */
- "SYS:c/less", /* do_Default Tool */
- 0x0, /* [do_ToolTypes] */
- 0xFFFFFFF0, /* do_CurrentX */
- 0x0, /* do_CurrentY */
- 0x0, /* [do_DrawerData] */
- 0x0, /* [do_ToolWindow] */
- 0x0, /* do_StackSize */
- };
-
- /* End your cut and paste here! */
-
-
- main(argc, argv)
- int argc;
- char **argv;
-
-
- {
- LONG file;
- char *filename;
- int l;
-
-
- IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 0L);
- if(IntuitionBase == NULL)
- cleanexit("Can't open intuition.library\n");
-
- GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0L);
- if(GfxBase == NULL)
- cleanexit("Can't open graphics.library\n");
-
- IconBase = (struct IconBase *)OpenLibrary("icon.library", 0L);
- if(IconBase == NULL)
- cleanexit("Can't open icon.library\n");
-
-
- if(argc > 1) /* Passed filename via command line */
- {
- filename = argv[1];
- }
- else
- {
- printf("\n\n\n");
-
- printf("\n\n WriteIcon V1.0 © 1989 By Dan Burris\n\n ");
- printf(" Enter Path/Filename for Icon (without .info): ");
- l = gets(&nbuf[0]);
-
- if(l==0) /* No filename - Exit */
- {
- cleanexit("\nIcon not saved, filename required\n");
- }
- else
- {
- filename = &nbuf[0];
- }
- }
-
- printf("\nSaving...\n");
-
-
- if(!(PutDiskObject(filename,&diskObject)))
- {
- cleanexit("Error saving icon\n");
- }
- printf("Icon saved\n");
-
- cleanexit("Done\n");
- }
-
-
- cleanexit(s)
- char *s;
- {
- if(*s) printf(s);
- if ((fromWB)&&(*s)) /* Wait so user can read messages */
- {
- printf("\nPRESS RETURN TO EXIT\n");
- gets(&sbuf[0]);
- }
- cleanup();
- exit();
- }
-
- cleanup()
- {
- if (IntuitionBase) CloseLibrary(IntuitionBase);
- if (GfxBase) CloseLibrary(GfxBase);
- if (IconBase) CloseLibrary(IconBase);
- }
-
-
-
-
-