1 .\" $Id: ansi2knr.1,v 1.2 2000/04/12 09:43:21 kevind Exp $
2 .TH ANSI2KNR 1 "9 September 1998" \" -*- nroff -*-
4 ansi2knr \- convert ANSI C to Kernighan & Ritchie C
6 \fBansi2knr\fR [\fB--filename\fR \fIfilename\fR] [\fIinput_file\fR [\fIoutput_file\fR]]
9 \fB--filename\fR provides the file name for the #line directive in the output,
10 overriding \fIinput_file\fR (if present).
12 If no \fIinput_file\fR is supplied, input is read from stdin.
14 If no \fIoutput_file\fR is supplied, output goes to stdout.
16 There are no error messages.
19 recognizes function definitions by seeing a non-keyword identifier at the left
20 margin, followed by a left parenthesis, with a right parenthesis as the last
21 character on the line, and with a left brace as the first token on the
22 following line (ignoring possible intervening comments). It will recognize a
23 multi-line header provided that no intervening line ends with a left or right
24 brace or a semicolon. These algorithms ignore whitespace and comments, except
25 that the function name must be the first thing on the line.
28 also recognizes adjacent string literals and concatenates them.
30 The following constructs will confuse it:
32 - Any other construct that starts at the left margin and follows the
33 above syntax (such as a macro or function call).
35 - Some macros that tinker with the syntax of the function header.
37 - String literals whose concatenation requires rewriting
38 their contents; e.g. "ab\0" "07c" is concatenated to "ab\007c",
41 The --varargs switch is obsolete, and is recognized only for
42 backwards compatibility. The present version of
44 will always attempt to convert a ... argument to va_alist and va_dcl.
46 L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
47 continues to maintain the current version; most of the code in the current
48 version is his work. ansi2knr also includes contributions by Francois
49 Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.