the Fink project is an effort to port
popular Unix programs to Mac OS X
# DISCLAIMER: Max Horn is the sole maintainer of this package.
# Please DO NOT MAKE MODIFICATIONS without informing the maintainer.
# Preferably, send a patch to me instead of making changes yourself!
# If that is not possible due to extra urgency, at least send me a mail.
#
# Explanation: I am sick and tired of getting back to my packages and
# discovering that people have messed with it. I am then forced to
# retrace their steps, find out who, when and why did make a certain
# change etc. -- i.e. it makes my life as maintainer harder.
# Furthermore, as maintainer I am responsible for problems caused by my
# packages. But I am not willing to take responsibility for something I
# did not do. In particular, for changes that other people introduced
# behind my back, no matter how good and noble their intentions were. As
# such, I may see myself forced to drop responsibility for (and hence,
# maintainership of) the affected package.
Package: astyle
Version: 2.02
Revision: 1
Maintainer: Max Horn
#Distribution: 10.5,10.6
Source: mirror:sourceforge:%n/%n_%v_macosx.tar.gz
Source-MD5: 16192ba46ba5348f107c712d6482c15a
SourceDirectory: %n
CompileScript: <<
mv build/mac/Makefile src
cd src; make
<<
InstallScript: <<
mkdir -p %i/bin
cp src/bin/astyle %i/bin/%n
<<
DocFiles: doc/*.html doc/styles.css
Description: Beautifier/Reformatter of C, C++, C# & Java
DescDetail: <<
Artistic Style is a source code indenter, formatter, and beautifier for
the C, C++, C# and Java programming languages.
When indenting source code, we as programmers have a tendency to use
both spaces and tab characters to create the wanted indentation.
Since the NUMBER of space characters showed on screen for each tab
character in the source code changes between editors, one of the
standard problems programmers are facing when moving from one editor to
another is that code containing both spaces and tabs that was up to now
perfectly indented, suddenly becomes a mess to look at when changing to
another editor.
To address this problem, Artistic Style was created - a filter written
in C++ that automatically re-indents and re-formats C / C++ / C# / Java
source files. It can be used from a command line, or it can be
incorporated as classes in another C++ program.
<<
DescUsage: <<
Read the options in %p/share/doc/astyle.html or astyle --help. Then
set your preferred astyle flags in .astylerc or the
ARTISTIC_STYLE_OPTIONS environment variable.
If you want to use the class in your own apps, extract the astyle source
from the %p/src dir.
<<
DescPort: <<
Maintainer up to version 1.23: Ben Hines
<<
License: GPL3
Homepage: http://astyle.sourceforge.net/
diff -Nurd -x'*~' astyle.orig/astyle_main.cpp astyle/astyle_main.cpp
--- astyle.orig/astyle_main.cpp 2002-03-07 08:22:30.000000000 -0500
+++ astyle/astyle_main.cpp 2006-01-17 23:24:36.000000000 -0500
@@ -151,47 +151,6 @@
-template
-bool parseOptions(ASFormatter &formatter,
- const ITER &optionsBegin,
- const ITER &optionsEnd,
- const string &errorInfo)
-{
- ITER option;
- bool ok = true;
- string arg, subArg;
-
- for (option = optionsBegin; option != optionsEnd; ++option)
- {
- arg = *option; //string(*option);
-
- if (arg.COMPARE(0, 2, string("--")) == 0)
- ok &= parseOption(formatter, arg.substr(2), errorInfo);
- else if (arg[0] == '-')
- {
- int i;
-
- for (i=1; i < arg.length(); ++i)
- {
- if (isalpha(arg[i]) && i > 1)
- {
- ok &= parseOption(formatter, subArg, errorInfo);
- subArg = "";
- }
- subArg.append(1, arg[i]);
- }
- ok &= parseOption(formatter, subArg, errorInfo);
- subArg = "";
- }
- else
- {
- ok &= parseOption(formatter, arg, errorInfo);
- subArg = "";
- }
- }
-
- return ok;
-}
void manuallySetJavaStyle(ASFormatter &formatter)
{
@@ -425,6 +384,47 @@
return true; //o.k.
}
+template
+bool parseOptions(ASFormatter &formatter,
+ const ITER &optionsBegin,
+ const ITER &optionsEnd,
+ const string &errorInfo)
+{
+ ITER option;
+ bool ok = true;
+ string arg, subArg;
+
+ for (option = optionsBegin; option != optionsEnd; ++option)
+ {
+ arg = *option; //string(*option);
+
+ if (arg.COMPARE(0, 2, string("--")) == 0)
+ ok &= parseOption(formatter, arg.substr(2), errorInfo);
+ else if (arg[0] == '-')
+ {
+ int i;
+
+ for (i=1; i < arg.length(); ++i)
+ {
+ if (isalpha(arg[i]) && i > 1)
+ {
+ ok &= parseOption(formatter, subArg, errorInfo);
+ subArg = "";
+ }
+ subArg.append(1, arg[i]);
+ }
+ ok &= parseOption(formatter, subArg, errorInfo);
+ subArg = "";
+ }
+ else
+ {
+ ok &= parseOption(formatter, arg, errorInfo);
+ subArg = "";
+ }
+ }
+
+ return ok;
+}
void importOptions(istream &in, vector