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

dev/c/ged6indent.lha

Mirror:Random
Showing: ppc-morphos icongeneric icon
No screenshot available
Short:Indent C source code in GoldEd6
Author:"Thomas Aglassinger" agi at giga.or.at
Uploader:Thomas Aglassinger <agi giga or at>
Type:dev/c
Version:1.3
Architecture:m68k-amigaos
Date:1999-08-06
Requires:GoldEd 6.x, GNUindent
Download:dev/c/ged6indent.lha - View contents
Readme:dev/c/ged6indent.readme
Downloads:667

TITLE

  ged6indent

VERSION

  1.3

AUTHOR

  Thomas Aglassinger <agi@giga.or.at>

DESCRIPTION

  Ged6indent is an ARexx-script which indents a C-source currently
  displayed in GoldEd by using GNUindent.

FEATURES

  None; simply does its job.

SPECIAL REQUIREMENTS

  o GoldEd, release 6.x (http://members.tripod.com/golded/)
  o GNUindent (aminet:dev/c/Indent191.lha)

AVAILABILITY

  aminet:dev/c/ged6indent.lha

PRICE

  Freeware

DISTRIBUTABILITY

  Public Domain.

DISCLAIMER

  No responsibilities are taken for trashed sources, damaged Amigas
  or any other components or data involved while using ged6indent.

CREDITS

  This script is based on material written by Michael Bauer. His
  scripts are available from `aminet:dev/c/GEDindent.lha', but
  do no longer work with GoldEd, release 6.

  An older version of the script that works with GoldEd, release 6,
  can be found in `aminet:dev/c/ged6indent.lha'.

  There is also a related tool in `aminet:text/edit/Smartindent.lha',
  indenting your code online - not only on request like this script.
  Maybe you prefer this approach.

INSTALLATION

  Copy the ARexx-script `ged6indent.ged' to `GoldEd:ARexx/', and
  build up a new menu entry for it, for example:

  COMMAND: GoldEd:Arexx/ged6indent.ged
  TYPE   : Arexx
  OUTPUT : CON:0/2048/384/128/Indent/AUTO/WAIT/CLOSE/SCREEN*

  Error messages will then appear at the bottom of the front-most
  screen, which should be the screen of GoldEd.

CONFIGURATION

  By default, `indent' will be invoked using options matching the
  style GoldEd supports in its initial configuration. If you do not
  like this style, you can set an environment variable named
  `ged6indent.prefs' with your preferred style, for example:

    setenv ged6indent.prefs "-bl -bli0 -i4 -sob -sc -npsl -npcs -lp"

  You can add a line like the above to your s:user-startup.

  Refer to the manual of indent for the meaning of these options.

ERROR HANDLING

  In case of `indent' shows up any error messages, a window will open
  and display these messages. The source code in the current editor
  window remains untouched.

  But usually the message reported by `indent' are not of much use.
  You better run a compiler on your faulty source code to find out
  details.

INDENTING A SINGLE FUNCTION

  If you do not want to indent the whole file, but just the function
  the cursor currently is on, there is a second script included called
  `ged6findent.ged'.

  To find the beginning of the current function, it searches backwards
  for a `{' at the first column of a line. If found, it searches for
  the corresponding `}' and marks the text in between.

  This block is written to a temporary file, processed by `indent' and
  reloaded again. Because of the block operations, there will be some
  flickering on the screen.

  Installation and configuration also work as described above.

PROBLEMS

  The version of `indent' included on the Geek Gadgets always opens an
  output window on the screen, even if `indent' does not show any
  messages. I do not know why exactly, but it seems to be related to
  the way ixemul.library handles the `stdout' stream. To avoid this,
  use the SAS-compiled port in aminet:dev/c/Indent191.lha.

  For `ged6findent.ged' it is important that the first curly brace
  (`{') of the function is in the first column of a line. This means,
  if you think you have to use a style like

    int sepp(char *hugo) {
      ....
    }

  the script will be unable to determine where the function starts.
  Instead, you have to use

    int sepp(char *hugo)
    {
      ....
    }

  to make it work properly.

  Because `ged6findent.ged' uses the internal bracket matching
  routines of GoldEd, it also has the same quirks. For example,

  void sepp(int x)
  {
      if (x) {
          printf("\"}");
      }
  }

  will not work. This is because bracket matching in GoldEd does not
  care about which language the code is written in, and therefore does
  not recognise the escaped `\"'.

  As a workaround, you can use the global `ged6indent.ged' for code
  that contains fragments like the above.

HISTORY

  v1.3, 5-Aug-1999
  - basically took `ged4indent.lha' and replaced all 4's by 6's
  - renamed ged4indent.prefs to ged6indent.prefs; if you are upgrading
    from the old v4 script, remember to change a possible `setenv' in
    your s:user-startup
  - replaced PING/PONG by QUERY LINE/GOTO LINE due to GoldEd6's new
    behavior of purging PING-information after loading a file. The
    column is not restored anymore. Instead, the cursor jumps to the
    beginning of the line (using GOTO INDENT).
  - `ged6findent.ged' now restores the find string, so the find
    requester does not display a `{' to the user the next time he
    wants to search the text.
  - added status message "Reformatting..." while script is running
  - fixed a typo in one of the requester texts

  v1.2, 25-Sep-1997
  - added `ged4findent.ged' which indents only the current function
  - temporary files are always removed, even in case of error
  - cursor position is always restored, even in case of error

  v1.1, 11-Jun-1997
  - added support for environment variable `ged4indent.prefs'
  - indented version is first created in a temporary file, and only
    read into editor again if no error occurred

  v1.0, 26-Jan-1997
  - initial release


Contents of dev/c/ged6indent.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                  275     628  43.8% -lh5- 0859 Sep 25  1997 ged6indent.info
[generic]                 1970    4847  40.6% -lh5- 2039 Aug  5  1999 ged6indent/ged6findent.ged
[generic]                  290     519  55.9% -lh5- 8b25 Sep 25  1997 ged6indent/ged6findent.ged.info
[generic]                 1239    2612  47.4% -lh5- 03a5 Aug  5  1999 ged6indent/ged6indent.ged
[generic]                  286     519  55.1% -lh5- 77d6 Sep 25  1997 ged6indent/ged6indent.ged.info
[generic]                 2609    5589  46.7% -lh5- 11c7 Aug  5  1999 ged6indent/ged6indent.readme
[generic]                  239     468  51.1% -lh5- 1ad3 Sep 25  1997 ged6indent/ged6indent.readme.info
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         7 files    6908   15182  45.5%            Aug  6  1999
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>