History log of /freebsd-current/usr.bin/indent/args.c
Revision Date Author Comments
# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b5b9eaa9 29-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Restore and document -ps / -nps option.

Sponsored by: Klara, Inc.
Reviewed by: pauamma_gundo.com, pstef, kevans
Differential Revision: https://reviews.freebsd.org/D40788


# 89463812 15-Jul-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): move case_indent from parser state to the options struct

This was missed in r334927.


# bb92a28b 10-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): rename -nsac/-sac ("space after cast") to -ncs/-cs

Also update tests and the manpage.

GNU indent had the option earlier as -cs, let's not diverge unnecessarily.


# 7e53aaed 10-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): group global option variables into an options structure

It's clearer now when a variable represents a toggable command line option.

Many options were stored in the parser's state structure, so fix also that.


# d0f86f66 04-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): add --version option

There exist multi-platform programs that check indent's version in order to
know what they can expect from it. GNU indent provides that via --version,
so implement the same option here.


# aac30b75 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): new option -lpl

With -lpl, code surrounded by parentheses in continuation lines is lined up
even if it would extend past the right margin.

With -nlpl (the default), such a line that would extend past the right
margin is moved left to keep it within the margin, if that does not require
placing it to the left of the prevailing indentation level.

These switches have no effect if -nlp is selected.

Submitted by: Tom Lane


# 50a29760 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): revert introduction of -lpl

That was committed with the wrong message. Will be re-added.


# 971e1c47 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): new option -lpl (always line up to parenthesis)

With -lp, if a line has an opening paren which is not closed on that line,
then continuation lines will be lined up to start at the character position
just after the opening paren.

Submitted by: Tom Lane


# 1479f36d 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): remove troff output support

The troff output in indent was invented at Sun and the online documentation
for some post-SunOS operating system includes this:
The usual way to get a troffed listing is with the command
indent -troff program.c | troff -mindent

The indent manual page in FreeBSD 1.0 already lacks that information and
troff -mindent complains about not being able to find the macro file.
It seems that the file did exist on SunOS and was supposed to be imported
into 4.3BSD together with the feature, but that has never happened.

Removal of troff output support simplifies a lot of indent's code.

vgrind(1) seems to be a promising replacement.


# e1baf57e 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): limit character classification functions' input to unsigned char


# 5bdd8509 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): remove undocumented and rather useless option (-ps)

It's used to treat the "->" access operator as a binary operator and put
space characters around it.


# 0de58b3f 01-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): improve an error message

When producing a "[...] requires a parameter" error, provide the recognized
name of the option instead of argument provided.


# df57947f 18-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

spdx: initial adoption of licensing ID tags.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D13133


# fbdbd284 25-Jul-2017 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): add option -tsn for setting tab size.


# 183668da 02-Jan-2017 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): add a piece missed in r311138.


# 86adac04 02-Jan-2017 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): add option -P for loading user-provided files as profiles

Without this change, indent(1) would only look to load options from ~/.indent.pro if it's there and -npro wasn't used on the command line. This option lets the user set their own path to the file.

Approved by: pfg (mentor)
Differential Revision: https://reviews.freebsd.org/D9010


# f3c23ec3 22-Aug-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

indent(1): Fix memory leaks pointed out by clang-analyzer.

Shift the responsibility of allocating memory for the string duplicate
from the caller (set_option, add_typedefs_from_file) to the callee
(add_typename) as it has more knowledge about when the duplication
actually needs to occur.

Taken from: Piotr Stefaniak


# a6bcfda4 04-Aug-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

indent(1): Use bsearch() for looking up type keywords.

Reference:
https://github.com/pstef/freebsd_indent/commit/f3b8e6e57fd47364b2360b44011a2fad5d11adc7

Submitted by: Piotr Stefaniak
Differential Revision: https://reviews.freebsd.org/D6966


# 771aff0a 03-Aug-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

indent(1): add new -sac and -U options.

Add -sac (space after cast) and -nsac options.
These control whether space character is put after a cast operator or not.
Default is -nsac.

Add -U option for providing a file containing list of types.
This is needed for properly deciding which asterisks denote unary
operation and which denote binary.

These come from PostgreSQL.

Reference:
https://github.com/pstef/freebsd_indent/commit/84b00e3d46dfd6d955b2f481a1f3b275de9ad6d1
https://github.com/pstef/freebsd_indent/commit/49c52cf383fa2a246a1a22c6640a5a21b0f1fd90

Differential Revision: https://reviews.freebsd.org/D6966 (Partial)
Submitted by: Piotr Stefaniak


# 70a3049e 01-Aug-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

indent(1): Use a dash in the license headers.

Use of the canonical dash avoids indent(1) from reformatting the
license headers.


# e725fe4b 31-Jul-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

indent(1): Rearrange option parsing code to squelch clang's static analyzer.

clang-analyzer complained that eqin() sets file-scoped pointer param_start
to point into char buffer defined in scan_profile(), and once
scan_profile() exits, param_start is a "dangling reference". param_start
was never used afterwards, but it's cleaner to move it to set_option()
which is the only branch where param_start is needed.

Reference:
https://github.com/pstef/freebsd_indent/commit/ab0e44e5da3ff0fa4b62e451e4bbc3ea1ec7f365

Differential Revision: https://reviews.freebsd.org/D6966 (Partial)
Submitted by: Piotr Stefaniak


# c917a54b 29-Jul-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

indent(1): Use NULL instead of zero for pointers.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# ce749f10 12-Apr-2010 Andriy Gapon <avg@FreeBSD.org>

MFC r205989: indent(1): new option, -ta, to treat all *_t identifiers as types


# c58c7416 31-Mar-2010 Andriy Gapon <avg@FreeBSD.org>

indent(1): add a new option, -ta, to treat all *_t identifiers as types

Submitted by: Hans Petter Selasky
Discussed with: bde
MFC after: 10 days


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# c4c326cf 19-Sep-2004 David Schultz <das@FreeBSD.org>

Fix a buffer overflow by using strncpy() instead of strcpy().
Also, use strdup() instead of malloc()/strcpy().

PR: 64164


# e3625e9c 27-Jun-2004 Jens Schweikhardt <schweikh@FreeBSD.org>

Fix problems with non-8 space tabs. New options for function
declarations with the opening brace on the same line as the declaration
of arguments all spaces and no tabs (a feature which exists in GNU's
indent). Man page update to follow RSN.

PR: bin/67983
Submitted by: Chip Norkus <wd@teleri.net>
Style guidance and bug for bug compatibility by: bde
MFC after: 2 weeks


# efc4d24d 20-Mar-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Support C-style comments in profile.


# 88ce0e7f 09-Feb-2004 Bruce Evans <bde@FreeBSD.org>

Added an option -ldi<N> to control indentation of local variable names.
The default is to be backwards compatible and non-KNF (use the same
indentation for locals as for globals; -ldi0 gives KNF indentation
for locals (none)). The indentation for globals also applies to struct
member names in local declatations. The indentation of variable names
in multi-line declarations is broken in various ways and this commit
gives some new variations.

indent.1:
Also clarified the description of -di<N>.


# d0054952 15-Jun-2003 Philippe Charnier <charnier@FreeBSD.org>

err() on allocation failure. WARNS=9 compliant
use #if 0, #ifndef lint, #endif /* not lint */, #endif ordering
when a message is provided, use errx() instead of err().


# e026a48c 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use FBSDID


# 90af6a72 24-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Remove deprecated register qualifier.


# 8c7e7698 30-Mar-2002 David Malone <dwmalone@FreeBSD.org>

1) Const enough things to avoid warnings.
2) Cast ifdef_level to a size_t before comparing it to a ratio of size_ts.
Ifdef_level should always be positive.
3) Complete prototype for chfont.
4) Cast some ptrdiff_ts to ints before using as a field width.
5) Avoid shadowing a local variable p with another local variable p.


# 7916863d 28-Oct-2001 Jens Schweikhardt <schweikh@FreeBSD.org>

Make this compile cleanly when warnings are enabled:
- ANSIfy function declarations
- braces around initializers structs within structs
- add parens in complicated expressions
- disambiguate dangling elses
- no more implicit int
- make functions static where possible
- use prototypes
- don't use varargs hack for diag()

Requested by: joerg
MFC after: 2 weeks


# 175f26d6 24-Dec-2000 David E. O'Brien <obrien@FreeBSD.org>

Don't abuse the SCCS `@(#)' for RCS.

Requested by: bde


# 9e50dd77 09-Dec-2000 David E. O'Brien <obrien@FreeBSD.org>

Add or fix FreeBSD IDs.


# a5e1cac0 09-Dec-2000 David E. O'Brien <obrien@FreeBSD.org>

"Implement -[n]fcb (formatting of block comments) and attempt to implement
no-space=after-sizeof (not optional) and no-space-after 'struct foo *'
(not optional). Without these, indent unKNFizes even more perfectly KNF code."

Submitted by: bde


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 958d7c9f 15-Jul-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3) instead of local redefinition. Add usage().


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources