@magorium helped quite a bit by providing information and inspiration to start developing the CLI version of IconSplit.
As with every new program I learn a little more about C programming. I learned a lot working on the icon splitter and it was fun.
I learned that using #define to set up a macro to perform byte swapping to convert bytes to long or word is easier than using a helper function (getlong or getword) to do the same. Using a helper function combined with a macro is even better yet.
For IconClone I had written a function called Get_IFFOfset to read a Classic Icon to get an offset to the beginning of the IFF data that starts with 'FORM'. It worked but it was very cumbersome and hard to understand what was going on inside the function. There were too many Offset, Seek, Read and macro calls for each piece of icon data. I knew I would need to re-write it eventually to make it shorter.
As I write each of these small icon apps what I learn will be applied to the previous icon apps to update them and make them more efficient. The concept behind these small apps is to Keep It Super Simple. Many of them are single source code files that can easily be compiled with gcc in a shell.
All these small apps especially IconColor, IconMask & IconBatch are intended for mass production of icon sets. The computer can assemble hundreds of icon images into icons in a few minutes. It would take a human several hours to do it manually. Automation is good.