Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!apple!mattd From: mattd@Apple.COM (Matt Deatherage) Newsgroups: comp.sys.apple Subject: Re: //gs APW "compress" Message-ID: <37372@apple.Apple.COM> Date: 18 Dec 89 22:39:56 GMT References: <3734.feeds.info-apple@pro-tcc> Organization: Apple Computer Inc, Cupertino, CA Lines: 35 In article <3734.feeds.info-apple@pro-tcc> lvirden@pro-tcc.cts.com (Larry Virden) writes: > >Also, has anyone thought of a way to build an interface to a C program so that >it would operate in 3 modes: > >1. from a shell with arguments >2. from a program launcher without arguments (from prosel, etc.) >3. from the Finder launched as a part of an Icon. > >I would think that a standard subroutine could pretty much be written up which >could use getopt to parse arguments as provided by the user, or prompt the >user (perhaps as dialog boxes?) as necessary. > >Has anyone taken this source code and compiled it under Orca/C? >-- >Larry W. Virden ProLine: pro-tcc!lvirden >674 Falls Place Work: lvirden@cas.bitnet >Reynoldsburg, OH 43068-1614 Aline: LVIRDEN > CIS: 75046,606 Actually, this is not difficult. When a program is launched, the X and Y registers point to the arguments (if there are any), and are both $0000 if there are none. The "Finder" interface is the same for all program launchers (including ProSEL), which specifies that if Message #1 exists in the Message Center, it's the pathnames of documents to open. The MessageCenter chapter of Toolbox Reference and the GS/OS Reference contain all the information any interested party needs to write such a piece of code. -- ============================================================================ Matt Deatherage, Apple Computer, Inc. | "The opinions represented here are Developer Technical Support, Apple II | not necessarily those of Apple Group. Personal mail only, please. | Computer, Inc. Remember that." ============================================================================