AminetAminet
Search:
84799 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/c/wb2argv.lha

Mirror:Random
Showing: m68k-amigaos iconppc-amigaos iconppc-morphos iconi386-aros iconi386-amithlon iconppc-warpup iconppc-powerup icongeneric icon
No screenshot available
Short:GNU getopt() <-> Workbench interface
Author: jensthi at ifi.uio.no (Jens T. Berger Thielemann)
Uploader:<jensthi ifi uio no> (Jens T Berger Thielemann)
Type:dev/c
Version:1.0
Architecture:m68k-amigaos
Date:1996-02-12
Requires:Amiga, C compiler, C= includes, OS 2.04+
Download:dev/c/wb2argv.lha - View contents
Readme:dev/c/wb2argv.readme
Downloads:698

As  C/C++  is  currently  the  only  compilable  languages  worth doing
cross-development  in, I decided to push portability a bit further.  As
many  other  platforms haven't noticed, the computer has a mouse, which
can be utilized for passing options to programs, amongs others.

Still,  as  the  Workbench  is  very OS specific; the GNU getopt_long()
routines  are still the programmer's choice if he wishes to easily port
his program.

WB2Argv  is  a  set of routines which solve this problem.  They convert
the tooltypes and shift-clicked icons into an argv similar array, which
can   be   passed   directly  onto  getopt_long().   The  getopt()  and
getopt_long()  routines  are included in the archive.  A minor quirk is
that  they  require  that  the  Amiga  has OS 2.04 or higher.  This may
change if there is enough interest for these routines.

An  example:   Suppose your program is called "Foo".  The user puts the
following arguments as tooltypes:

SPEED=FAST
IQ=HIGH
UNIVERSE=UTOPIA

In addition, he shift-clicks the files "dh1:Data" and "dh1:Neural".

The routine WB2Argv() will take the WBenchMsg which is passed onto you,
and  convert it to the following array (line shifts indicating separate
array elements):

Foo
--speed=FAST
--iq=HIGH
--universe=UTOPIA
--
dh1:Data
dh1:Neural

This  is  fully  compliant to the getopt_long() format.  The folding of
options case can be specified via flags (it stops at the `=' sign).

As  getopt_long(),  this  is  distributed  under the GNU General Public
License,  with  the  following  addition:   You  must mention that your
program uses my routine in your document.

Copyright © 1996 Jens T. Berger Thielemann.

To contact the author:
        Jens Berger
        Spektrumvn. 4
        N-0666 Oslo
        Norway

Note: These routines were written for one of my other projects, ChkTeX,
      which  may  be  useful  if you're doing serious typesetting using
      LaTeX.  Available on AmiNet as text/tex/chktex.lha.


Contents of dev/c/wb2argv.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                 7370   18828  39.1% -lh5- 567e Feb  6  1996 copying
[generic]                  489     881  55.5% -lh5- ca52 Feb  6  1996 COPYING.info
[generic]                 7422   21898  33.9% -lh5- d15b Feb  6  1996 getopt.c
[generic]                  278     486  57.2% -lh5- 7c93 Feb  6  1996 getopt.c.info
[generic]                 1807    4412  41.0% -lh5- 9fdc Feb  6  1996 getopt.h
[generic]                  233     486  47.9% -lh5- f459 Feb  6  1996 getopt.h.info
[generic]                 1822    4507  40.4% -lh5- 1f47 Feb  6  1996 getopt1.c
[generic]                  276     486  56.8% -lh5- f216 Feb  6  1996 getopt1.c.info
[generic]                 2442    5617  43.5% -lh5- 83db Feb 10  1996 WB2Argv.c
[generic]                  473    2975  15.9% -lh5- c6d4 Feb  6  1996 WB2Argv.c.info
[generic]                  741    1324  56.0% -lh5- e58c Feb  4  1996 WB2Argv.h
[generic]                  434    2913  14.9% -lh5- 06b2 Feb  6  1996 WB2Argv.h.info
[generic]                 1188    2232  53.2% -lh5- b054 Feb 10  1996 WB2Argv.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        13 files   24975   67045  37.3%            Feb 12  1996
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>