Blame


1 af9b97b5 2002-05-22 alex .TH ANSI2KNR 1 "19 Jan 1996"
2 af9b97b5 2002-05-22 alex .SH NAME
3 af9b97b5 2002-05-22 alex ansi2knr \- convert ANSI C to Kernighan & Ritchie C
4 af9b97b5 2002-05-22 alex .SH SYNOPSIS
5 af9b97b5 2002-05-22 alex .I ansi2knr
6 af9b97b5 2002-05-22 alex [--varargs] input_file [output_file]
7 af9b97b5 2002-05-22 alex .SH DESCRIPTION
8 af9b97b5 2002-05-22 alex If no output_file is supplied, output goes to stdout.
9 af9b97b5 2002-05-22 alex .br
10 af9b97b5 2002-05-22 alex There are no error messages.
11 af9b97b5 2002-05-22 alex .sp
12 af9b97b5 2002-05-22 alex .I ansi2knr
13 af9b97b5 2002-05-22 alex recognizes function definitions by seeing a non-keyword identifier at the left
14 af9b97b5 2002-05-22 alex margin, followed by a left parenthesis, with a right parenthesis as the last
15 af9b97b5 2002-05-22 alex character on the line, and with a left brace as the first token on the
16 af9b97b5 2002-05-22 alex following line (ignoring possible intervening comments). It will recognize a
17 af9b97b5 2002-05-22 alex multi-line header provided that no intervening line ends with a left or right
18 af9b97b5 2002-05-22 alex brace or a semicolon. These algorithms ignore whitespace and comments, except
19 af9b97b5 2002-05-22 alex that the function name must be the first thing on the line.
20 af9b97b5 2002-05-22 alex .sp
21 af9b97b5 2002-05-22 alex The following constructs will confuse it:
22 af9b97b5 2002-05-22 alex .br
23 af9b97b5 2002-05-22 alex - Any other construct that starts at the left margin and follows the
24 af9b97b5 2002-05-22 alex above syntax (such as a macro or function call).
25 af9b97b5 2002-05-22 alex .br
26 af9b97b5 2002-05-22 alex - Some macros that tinker with the syntax of the function header.
27 af9b97b5 2002-05-22 alex .sp
28 af9b97b5 2002-05-22 alex The --varargs switch is obsolete, and is recognized only for
29 af9b97b5 2002-05-22 alex backwards compatibility. The present version of
30 af9b97b5 2002-05-22 alex .I ansi2knr
31 af9b97b5 2002-05-22 alex will always attempt to convert a ... argument to va_alist and va_dcl.
32 af9b97b5 2002-05-22 alex .SH AUTHOR
33 af9b97b5 2002-05-22 alex L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
34 af9b97b5 2002-05-22 alex continues to maintain the current version; most of the code in the current
35 af9b97b5 2002-05-22 alex version is his work. ansi2knr also includes contributions by Francois
36 af9b97b5 2002-05-22 alex Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.