Qsr Nrwn
Website
C Programming Language, Nice C Tool
Copyright 1997 Roger Moser, Switzerland
NiceC is a fast, learning and easy to use C source formatter. It completely formats C or C++ source codes according to your style which it has learned from a sample of your source code.
Copy NICEC.EXE to a subdirectory that is listed in the DOS PATH and then let NiceC learn your style by running "nicec -l sample.c". That's all.
If you are upgrading from version 1, you should run "nicec -l nicec.cfg" and then check in nicec.cfg if the style of "x::x():a() {}" is your style.
NICEC.EXE contains both versions, 16-bit and 32-bit. If you start it under Windows 95 or NT, the 32-bit version runs which can process long file names.
Otherwise the 16-bit version runs.
| Usage: | NICEC [options] filenames NICEC [options] <input >output |
| Options: | -l learn
-tn[,n] tab spacing in input andd output file
-tn,0 no tabs in output file
-b if, else, for, while andd do always with {}
-cfilename[.cfg] configuration file> |
| Default: | -t8,8 -cNICEC.CFG |
You can specify more than one filename and wildcards are allowed.
NiceC saves your style in a configuration file. The default name is NICEC.CFG (in the same subdirectory as NICE.EXE). If you detect errors, you may modify the configuration file with an ASCII editor.
The meaning of the configuration file should be clear except following:
| Configuration file | Explanation |
char *t[] = {0, 1, 2}; // | If there is a tab before '2' then NiceC preserves the tabs within a initialization list. If there is a tab before '//' then NiceC preserves the tabs before comments. |
void calculate(int a,
int b); | The indentation of the continuation of the function declaration defines whether the continuation has a fixed indentation or is aligned to '('. |
a b; | If there is a tab between 'a' and 'b' then NiceC preserves the tabs within statements. |
stat1; stat2; | If 'stat1;' and 'stat2;' are on separate lines then NiceC will put every statement on a separate line. |
if (ok && i == k & 2
|| x > 0)
while (ok
&& i > 0) | The indentation of the continuation of the 'if' and the 'while' statement defines whether the continuation has a fixed indentation or is aligned to '('. |
calculate(v1,
v2); | The indentation of the continuation of the function call defines whether the continuation has a fixed indentation or is aligned to '('. |
lab: | If 'lab:' is at the first column then NiceC will put all labels at the beginning of the line. Otherwise it will outdent the labels according to the relative position of 'lab:'. |
NiceC always creates backup files with the extension .BAK (or .BK0, .BK1 etc. if there would be a name conflict).
NiceC is a copyright reserved free software. That means, you may use and distribute it freely but you may not pretend that you have written it.
struct {
void (*f)();
};
x = a + b;
y::y()
: b()
{
}
If NiceC cannot learn your style or if it changes your source in an undesired way then please send me a E-mail with a small example of your source code and the configuration file.
Roger Moser© 2004 Qsr Nrwn