1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260
|
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename indent.info
@settitle @command{indent}: Indent and Format C Program Source
@finalout
@include version.texi
@c %**end of header
@c smallbook
@c Note: some of the long options are too long for the index in
@c smallbook format. This will need some thought. --rjc
@dircategory Indent Code Formatter
@direntry
* Indent: (indent). C code formatter.
@end direntry
@synindex cp ky
@setchapternewpage odd
@c !BEGIN INTRO
@ifinfo
This is Edition @value{EDITION} of @cite{The @command{indent} Manual},
for Indent Version @value{VERSION}, last updated @value{UPDATED}.
@c !END INTRO
@c @vskip 0pt plus 1filll
@c !BEGIN COPYING
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Joseph Arceneaux.
Copyright (C) 1999 Carlo Wood.
Copyright (C) 2001 David Ingamells.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled ``GNU General Public License'' is included exactly as
in the original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that the section entitled ``GNU General Public License'' may be
included in a translation approved by the author instead of in the
original English.
@end ignore
@c !END COPYING
@end ifinfo
@titlepage
@title Indent
@subtitle Format C Code
@sp 1
@subtitle Edition @value{EDITION}, for Indent Version @value{VERSION}
@subtitle @value{UPDATED}
@c !BEGIN AUTHORS
@author Carlo Wood
@author Joseph Arceneaux
@author Jim Kingdon
@author David Ingamells
@c !END AUTHORS
@page
@vskip 0pt plus1filll
Copyright @copyright{} 1989, 1992, 1993, 1994, 1995, 1996 Free Software
Foundation, Inc.
Copyright @copyright{} 1995, 1996 Joseph Arceneaux.
Copyright @copyright{} 1999, Carlo Wood.
Copyright @copyright{} 2001, David Ingamells.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end titlepage
@page
@c put the following line in the file dir in the info directory
@c under wherever you have installed emacs (assuming that
@c the info file made from this file is in the file "indent")
@c * indent:(indent). How to change the appearance of a C program.
@ifinfo
@node Top, Indent Program, (dir), (dir)
@top @command{indent}: Indent and Format C Program Source
The @command{indent} program
@c !BEGIN NAME
changes the appearance of a C program by inserting or deleting whitespace.
@c !END NAME
This is Edition @value{EDITION}, @value{UPDATED}, of @cite{The @command{indent} Manual},
for Indent Version @value{VERSION}.
@menu
* Indent Program:: The @command{indent} Program
* Option Summary:: Option Summary
* Index:: Index
@end menu
@end ifinfo
@node Indent Program, Option Summary, Top, Top
@chapter The @command{indent} Program
@c !BEGIN DESCRIPTION
@iftex
The @command{indent} program changes the appearance of a C program by
inserting or deleting whitespace.
@end iftex
@ifinfo
The @command{indent} program
@end ifinfo
@iftex
It
@end iftex
can be used to make code easier to read. It can also convert from one
style of writing C to another.
@command{indent} understands a substantial amount about the syntax of C,
but it also attempts to cope with incomplete and misformed syntax.
In version 1.2 and more recent versions, the GNU style of indenting is
the default.
@c !END DESCRIPTION
@menu
* Invoking indent:: Invoking @command{indent}
* Backup files:: Backup Files
* Common styles:: Common styles
* Blank lines:: Blank lines
* Comments:: Comments
* Statements:: Statements
* Declarations:: Declarations
* Indentation:: Indentation
* Breaking long lines:: Breaking long lines
* Disabling Formatting:: Disabling Formatting
* Miscellaneous options:: Miscellaneous options
* Bugs:: Bugs
* Copyright:: Copyright
@end menu
@c !BEGIN THEREST
@node Invoking indent, Backup files, , Indent Program
@section Invoking @command{indent}
@cindex Invoking @command{indent}
@cindex Starting @command{indent}
@cindex Beginning @command{indent}
As of version 1.3, the format of the @command{indent} command is:
@example
@group
indent [@var{options}] [@var{input-files}]
indent [@var{options}] [@var{single-input-file}] [-o @var{output-file}]
@end group
@end example
This format is different from earlier versions and other versions of
@command{indent}.
In the first form, one or more input files are specified. @command{indent}
makes a backup copy of each file, and the original file is replaced with
its indented version. @xref{Backup files}, for an explanation of how
backups are made.
@cindex Output File Specification
@kindex -o
@kindex --output-file
In the second form, only one input file is specified. In this case, or
when the standard input is used, you may specify an output file after
the @option{-o} option.
@cindex Standard Output
@kindex -st
@kindex --standard-output
To cause @command{indent} to write to standard output, use the @option{-st}
option. This is only allowed when there is only one input file, or when
the standard input is used.
@cindex Using Standard Input
If no input files are named, the standard input is read for input.
Also, if a filename named @option{-} is specified, then the standard input
is read.
As an example, each of the following commands will input the program
@file{slithy_toves.c} and write its indented text to
@file{slithy_toves.out}:
@example
@group
indent slithy_toves.c -o slithy_toves.out
indent -st slithy_toves.c > slithy_toves.out
cat slithy_toves.c | indent -o slithy_toves.out
@end group
@end example
@cindex Long options, use of
Most other options to @command{indent} control how programs are formatted.
As of version 1.2, @command{indent} also recognizes a long name for each
option name. Long options are prefixed by either @option{--} or
@option{+}.
@footnote{ @option{+} is being superseded by @option{--} to
maintain consistency with the POSIX standard.}
In most of this document,
the traditional, short names are used for the sake of brevity.
@xref{Option Summary}, for a list of options, including both long and
short names.
Here is another example:
@example
indent -br test/metabolism.c -l85
@end example
This will indent the program @file{test/metabolism.c} using the
@option{-br} and @option{-l85} options, write the output back to
@file{test/metabolism.c}, and write the original contents of
@file{test/metabolism.c} to a backup file in the directory @file{test}.
Equivalent invocations using long option names for this example would
be:
@example
@group
indent --braces-on-if-line --line-length185 test/metabolism.c
indent +braces-on-if-line +line-length185 test/metabolism.c
@end group
@end example
@cindex @file{.indent.pro} file
@cindex Initialization file
@kindex -npro
@kindex --ignore-profile
If you find that you often use @command{indent} with the same options, you
may put those options into a file named @file{.indent.pro}.
@command{indent} will look for a profile file in three places. First it will check
the environment variable @env{INDENT_PROFILE}. If that exists its value
is expected to name the file that is to be used. If the environment variable does
not exist, indent looks for @file{.indent.pro} in the current directory
and use that if found. Finally @command{indent} will search
your home directory for @file{.indent.pro} and use that file if it is
found. This behaviour is different from that of other versions of
@command{indent}, which load both files if they both exist.
The format of @file{.indent.pro} is simply a list of options, just as
they would appear on the command line, separated by white space (tabs,
spaces, and newlines). Options in @file{.indent.pro} may be surrounded by C
or C++ comments, in which case they are ignored.
Command line switches are handled @emph{after} processing
@file{.indent.pro}. Options specified later override arguments
specified earlier, with one exception: Explicitly specified options
always override background options (@pxref{Common styles}). You can
prevent @command{indent} from reading an @file{.indent.pro} file by
specifying the @option{-npro} option.@refill
@node Backup files, Common styles, Invoking indent, Indent Program
@comment node-name, next, previous, up
@section Backup Files
@cindex backup files
As of version 1.3, GNU @command{indent} makes GNU-style backup files, the
same way GNU Emacs does. This means that either @dfn{simple} or
@dfn{numbered} backup filenames may be made.
Simple backup file names are generated by appending a suffix to the
original file name. The default for this suffix is the
one-character string @file{~} (tilde). Thus, the backup file for
@file{python.c} would be @file{python.c~}.
Instead of the default, you may specify any string as a suffix by
setting the environment variable @env{SIMPLE_BACKUP_SUFFIX} to
your preferred suffix.
Numbered backup versions of a file @file{momeraths.c} look like
@file{momeraths.c.~23~}, where 23 is the version of this particular
backup. When making a numbered backup of the file @file{src/momeraths.c},
the backup file will be named @file{src/momeraths.c.~@var{V}~}, where
@var{V} is one greater than the highest version currently existing in
the directory @file{src}. The environment variable @env{VERSION_WIDTH}
controls the number of digits, using left zero padding when necessary.
For instance, setting this variable to "2" will lead to the backup
file being named @file{momeraths.c.~04~}.
The type of backup file made is controlled by the value of the
environment variable @env{VERSION_CONTROL}. If it is the string
@samp{simple}, then only simple backups will be made. If its value is
the string @samp{numbered}, then numbered backups will be made. If its
value is @samp{numbered-existing}, then numbered backups will be made if
there @emph{already exist} numbered backups for the file being indented;
otherwise, a simple backup is made. If @env{VERSION_CONTROL} is not
set, then @command{indent} assumes the behaviour of
@samp{numbered-existing}.
Other versions of @command{indent} use the suffix @file{.BAK} in naming
backup files. This behaviour can be emulated by setting
@env{SIMPLE_BACKUP_SUFFIX} to @samp{.BAK}.
Note also that other versions of @command{indent} make backups in the
current directory, rather than in the directory of the source file as
GNU @command{indent} now does.
@node Common styles, Blank lines, Backup files, Indent Program
@comment node-name, next, previous, up
@section Common styles
There are several common styles of C code, including the GNU style, the
Kernighan & Ritchie style, and the original Berkeley style. A style may
be selected with a single @dfn{background} option, which specifies a set
of values for all other options. However, explicitly specified options
always override options implied by a background option.
@cindex GNU style
@kindex -gnu
@kindex --gnu-style
As of version 1.2, the default style of GNU @command{indent} is the GNU
style. Thus, it is no longer necessary to specify the option
@option{-gnu} to obtain this format, although doing so will not cause an
error. Option settings which correspond to the GNU style are:
@example
@group
-nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2
-ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -nprs -psl -saf -sai
-saw -nsc -nsob
@end group
@end example
The GNU coding style is that preferred by the GNU project. It is the
style that the GNU Emacs C mode encourages and which is used in the C
portions of GNU Emacs. (People interested in writing programs for
Project GNU should get a copy of @cite{The GNU Coding Standards}, which
also covers semantic and portability issues such as memory usage, the
size of integers, etc.)
@cindex Kernighan & Ritchie style
@kindex -kr
@kindex --k-and-r-style
@comment --kernighan-and-ritchie-style works, too, as does
@comment --kernighan-and-ritchie. Which is most intuitive?
The Kernighan & Ritchie style is used throughout their well-known book
@cite{The C Programming Language}. It is enabled with the @option{-kr}
option. The Kernighan & Ritchie style corresponds to the following set
of options:
@example
@group
-nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0
-cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs
-nprs -npsl -saf -sai -saw -nsc -nsob -nss
@end group
@end example
@noindent
Kernighan & Ritchie style does not put comments to the right of code in
the same column at all times (nor does it use only one space to the
right of the code), so for this style @command{indent} has arbitrarily
chosen column 33.
@cindex Berkeley style
@cindex Original Berkeley style
@kindex -orig
@kindex --original
The style of the original Berkeley @command{indent} may be obtained by
specifying @option{-orig} (or by specifying @option{--original}, using the
long option name). This style is equivalent to the following settings:
@example
@group
-nbad -nbap -bbo -bc -br -brs -c33 -cd33 -cdb -ce -ci4 -cli0
-cp33 -di16 -fc1 -fca -hnl -i4 -ip4 -l75 -lp -npcs -nprs -psl
-saf -sai -saw -sc -nsob -nss -ts8
@end group
@end example
@cindex Linux style
@kindex -linux
@kindex --linux-style
The Linux style is used in the linux kernel code and drivers. Code
generally has to follow the Linux coding style to be accepted.
This style is equivalent to the following settings:
@example
@group
-nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4
-cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai
-saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1
@end group
@end example
@node Blank lines, Comments, Common styles, Indent Program
@comment node-name, next, previous, up
@section Blank lines
@cindex Blank lines
Various programming styles use blank lines in different places.
@command{indent} has a number of options to insert or delete blank lines in
specific places.
The @option{-bad} option causes @command{indent} to force a blank line after
every block of declarations. The @option{-nbad} option causes
@command{indent} not to force such blank lines.
The @option{-bap} option forces a blank line after every procedure body.
The @option{-nbap} option forces no such blank line.
@kindex -bbb
@kindex --blank-lines-before-block-comments
@kindex -nbbb
@kindex --no-blank-lines-before-block-comments
The @option{-bbb} option forces a blank line before every boxed comment
(@xref{Comments}.)
The @option{-nbbb} option does not force such blank lines.
@kindex -sob
@kindex --swallow-optional-blank-lines
@kindex -nsob
@kindex --leave-optional-blank-lines
The @option{-sob} option causes @command{indent} to swallow optional blank
lines (that is, any optional blank lines present in the input will be
removed from the output). If the @option{-nsob} is specified, any blank
lines present in the input file will be copied to the output file.
@ifinfo
@menu
* -bad:: More on the @option{-bad} option.
* -bap:: More on the @option{-bap} option.
@end menu
@end ifinfo
@node -bad, -bap, , Blank lines
@comment node-name, next, previous, up
@subsection --blank-lines-after-declarations
The @option{-bad} option forces a blank line after every block of
declarations. The @option{-nbad} option does not add any such blank
lines.
For example, given the input
@example
@group
char *foo;
char *bar;
/* This separates blocks of declarations. */
int baz;
@end group
@end example
@kindex -bad
@kindex --blank-lines-after-declarations
@kindex -nbad
@kindex --no-blank-lines-after-declarations
@noindent
@code{indent -bad} produces
@example
@group
char *foo;
char *bar;
/* This separates blocks of declarations. */
int baz;
@end group
@end example
@noindent
and @code{indent -nbad} produces
@example
@group
char *foo;
char *bar;
/* This separates blocks of declarations. */
int baz;
@end group
@end example
@node -bap, , -bad, Blank lines
@comment node-name, next, previous, up
@subsection --blank-lines-after-procedures
@kindex -bap
@kindex --blank-lines-after-procedures
@kindex -nbap
@kindex --no-blank-lines-after-procedures
The @option{-bap} option forces a blank line after every procedure body.
For example, given the input
@example
@group
int
foo ()
@{
puts("Hi");
@}
/* The procedure bar is even less interesting. */
char *
bar ()
@{
puts("Hello");
@}
@end group
@end example
@noindent
@code{indent -bap} produces
@example
@group
int
foo ()
@{
puts ("Hi");
@}
/* The procedure bar is even less interesting. */
char *
bar ()
@{
puts ("Hello");
@}
@end group
@end example
@noindent
@c A better `group' would be better than `need'.
@need 1250
and @code{indent -nbap} produces
@example
@group
int
foo ()
@{
puts ("Hi");
@}
/* The procedure bar is even less interesting. */
char *
bar ()
@{
puts ("Hello");
@}
@end group
@end example
@noindent
No blank line will be added after the procedure @code{foo}.
@node Comments, Statements, Blank lines, Indent Program
@comment node-name, next, previous, up
@section Comments
@cindex Comments
@command{indent} formats both C and C++ comments. C comments are begun with
@samp{/*}, terminated with @samp{*/} and may contain newline characters.
C++ comments begin with the delimiter @samp{//} and end at the newline.
@command{indent} handles comments differently depending upon their context.
@command{indent} attempts to distinguish between comments which follow
statements, comments which follow declarations, comments following
preprocessor directives, and comments which are not preceded by code of
any sort, i.e., they begin the text of the line (although not
necessarily in column 1).
@command{indent} further distinguishes between comments found outside of
procedures and aggregates, and those found within them. In particular,
comments beginning a line found within a procedure will be indented to
the column at which code is currently indented. The exception to this
is a comment beginning in the leftmost column; such a comment is output
at that column.
@command{indent} attempts to leave @dfn{boxed comments} unmodified. The
general idea of such a comment is that it is enclosed in a rectangle or
``box'' of stars or dashes to visually set it apart. More precisely,
boxed comments are defined as those in which the initial @samp{/*} is
followed immediately by the character @samp{*}, @samp{=}, @samp{_}, or
@samp{-}, or those in which the beginning comment delimiter (@samp{/*})
is on a line by itself, and the following line begins with a @samp{*} in
the same column as the star of the opening delimiter.
Examples of boxed comments are:
@example
@group
/**********************
* Comment in a box!! *
**********************/
/*
* A different kind of scent,
* for a different kind of comment.
*/
@end group
@end example
@command{indent} attempts to leave boxed comments exactly as they are found
in the source file. Thus the indentation of the comment is unchanged,
and its length is not checked in any way. The only alteration made is
that an embedded tab character may be converted into the appropriate
number of spaces.
If the @option{-bbb} option is specified, all such boxed comments will be
preceded by a blank line, unless such a comment is preceded by code.
@kindex -fca
@kindex --format-all-comments
@kindex -nfca
@kindex --dont-format-comments
@kindex -fc1
@kindex --format-first-column-comments
@kindex -nfc1
@kindex --dont-format-first-column-comments
Comments which are not boxed comments may be formatted, which means that
the line is broken to fit within a right margin and left-filled with
whitespace. Single newlines are equivalent to a space, but blank lines
(two or more newlines in a row) are taken to mean a paragraph break.
Formatting of comments which begin after the first column is enabled
with the @option{-fca} option. To format those beginning in column one,
specify @option{-fc1}. Such formatting is disabled by default.
The right margin for formatting defaults to 78, but may be changed with
the @option{-lc} option. If the margin specified does not allow the
comment to be printed, the margin will be automatically extended for the
duration of that comment. The margin is not respected if the comment is
not being formatted.
@kindex -d@var{n}
@kindex --line-comments-indentation@var{n}
If the comment begins a line (i.e., there is no program text to its
left), it will be indented to the column it was found in unless the
comment is within a block of code. In that case, such a comment will be
aligned with the indented code of that block (unless the comment began
in the first column). This alignment may be affected by the @option{-d}
option, which specifies an amount by which such comments are moved to
the @emph{left}, or unindented. For example, @option{-d2} places comments
two spaces to the left of code. By default, comments are aligned with
code, unless they begin in the first column, in which case they are left
there by default --- to get them aligned with the code, specify @option{-fc1}.
@kindex -c@var{n}
@kindex --comment-indentation@var{n}
@kindex -cd@var{n}
@kindex --declaration-comment-column@var{n}
@kindex -cp@var{n}
@kindex --else-endif-column@var{n}
@kindex --left-justify-declarations
@kindex --dont-left-justify-declarations
@kindex -dj
@kindex -ndj
Comments to the right of code will appear by default in column 33.
This may be changed with one of three options. @option{-c} will specify
the column for comments following code, @option{-cd} specifies the
column for comments following declarations, and @option{-cp} specifies
the column for comments following preprocessor directives @code{#else}
and @code{#endif}. @option{-dj} together with @option{-cd0} can be used
to suppress alignment of comments to the right of declarations, causing the
comment to follow one tabstop from the end of the declaration. Normally @option{-cd0}
causes @option{-c} to become effective.
If the code to the left of the comment exceeds the beginning column,
the comment column will be extended to the next tabstop column past
the end of the code, or in the case of preprocessor directives, to one
space past the end of the directive. This extension lasts only for
the output of that particular comment.
@kindex -cdb
@kindex --comment-delimiters-on-blank-lines
@kindex -ncdb
@kindex --no-comment-delimiters-on-blank-lines
The @option{-cdb} option places the comment delimiters on blank lines.
Thus, a single line comment like @code{/* Loving hug */} can be
transformed into:
@example
@group
/*
Loving hug
*/
@end group
@end example
@kindex -sc
@kindex --star-left-side-of-comments
@kindex -nsc
@kindex --dont-star-comments
Stars can be placed at the beginning of multi-line comments with the
@option{-sc} option. Thus, the single-line comment above can be
transformed (with @option{-cdb -sc}) into:
@example
@group
/*
* Loving hug
*/
@end group
@end example
@node Statements, Declarations, Comments, Indent Program
@comment node-name, next, previous, up
@section Statements
@kindex -br
@kindex --braces-on-if-line
@kindex -bl
@kindex --braces-after-if-line
The @option{-br} or @option{-bl} option specifies how to format braces.
@c another paragraph that needs to be attached to its example.
@need 650
The @option{-br} option formats statement braces like this:
@example
@group
if (x > 0) @{
x--;
@}
@end group
@end example
@noindent
The @option{-bl} option formats them like this:
@example
@group
if (x > 0)
@{
x--;
@}
@end group
@end example
@kindex -bli@var{n}
@kindex --brace-indent@var{n}
If you use the @option{-bl} option, you may also want to specify the
@option{-bli} option. This option specifies the number of spaces by
which braces are indented. @option{-bli2}, the default, gives the
result shown above. @option{-bli0} results in the following:
@example
@group
if (x > 0)
@{
x--;
@}
@end group
@end example
@kindex -ce
@kindex --cuddle-else
@kindex -dce
@kindex --dont-cuddle-else
If you are using the @option{-br} option, you probably want to also use
the @option{-ce} option. This causes the @code{else} in an if-then-else
construct to cuddle up to the immediately preceding @samp{@}}. For
example, with @option{-br -ce} you get the following:
@example
@group
if (x > 0) @{
x--;
@} else @{
fprintf (stderr, "...something wrong?\n");
@}
@end group
@end example
@noindent
With @option{-br -nce} that code would appear as
@example
@group
if (x > 0) @{
x--;
@}
else @{
fprintf (stderr, "...something wrong?\n");
@}
@end group
@end example
@kindex -cdw
@kindex --cuddle-do-while
@kindex -ncdw
@kindex --dont-cuddle-do-while
This causes the @code{while} in a do-while
loop to cuddle up to the immediately preceding @samp{@}}. For
example, with @option{-cdw} you get the following:
@example
@group
do @{
x--;
@} while (x);
@end group
@end example
@noindent
With @option{-ncdw} that code would appear as
@example
@group
do @{
x--;
@}
while (x);
@end group
@end example
@kindex -cli@var{n}
@kindex --case-indentation@var{n}
The @option{-cli} option specifies the number of spaces that case labels
should be indented to the right of the containing @code{switch}
statement.
@noindent
The default gives code like:
@example
@group
switch (i)
@{
case 0:
break;
case 1:
@{
++i;
@}
default:
break;
@}
@end group
@end example
@need 1550
Using the @option{-cli2} that would become:
@example
@group
switch (i)
@{
case 0:
break;
case 1:
@{
++i;
@}
default:
break;
@}
@end group
@end example
@kindex -cbi@var{n}
@kindex --case-brace-indentation@var{n}
The indentation of the braces below a case statement can be
controlled with the @option{-cbi@var{n}} option. For example,
using @option{-cli2 -cbi0} results in:
@example
@group
switch (i)
@{
case 0:
break;
case 1:
@{
++i;
@}
default:
break;
@}
@end group
@end example
@kindex -ss
@kindex --space-special-semicolon
@kindex -nss
@kindex --dont-space-special-semicolon
If a semicolon is on the same line as a @code{for} or @code{while}
statement, the @option{-ss} option will cause a space to be placed before
the semicolon. This emphasizes the semicolon, making it clear that the
body of the @code{for} or @code{while} statement is an empty statement.
@option{-nss} disables this feature.
@kindex -pcs
@kindex --space-after-procedure-calls
@kindex -npcs
@kindex --no-space-after-function-call-names
The @option{-pcs} option causes a space to be placed between the name of
the procedure being called and the @samp{(} (for example, @w{@code{puts
("Hi");}}. The @option{-npcs} option would give @code{puts("Hi");}).
@refill
@kindex -cs
@kindex --space-after-cast
@kindex -ncs
@kindex --no-space-after-cast
If the @option{-cs} option is specified, @command{indent} puts a space between
a cast operator and the object to be cast. The @option{-ncs} ensures that there
is no space between the cast operator and the object. Remember that @command{indent}
only knows about the standard C data types and so cannot recognise user-defined types
in casts. Thus @code{(mytype)thing} is not treated as a cast.
@kindex -bs
@kindex --blank-after-sizeof
The @option{-bs} option ensures that there is a space between the
keyword @code{sizeof} and its argument. In some versions, this is
known as the @samp{Bill_Shannon} option.
@kindex -saf
@kindex --space-after-for
@kindex -nsaf
@kindex --no-space-after-for
The @option{-saf} option forces a space between a @code{for}
and the following parenthesis. This is the default.
@kindex -sai
@kindex --space-after-if
@kindex -nsai
@kindex --no-space-after-if
The @option{-sai} option forces a space between a @code{if}
and the following parenthesis. This is the default.
@kindex -saw
@kindex --space-after-while
@kindex -nsaw
@kindex --no-space-after-while
The @option{-saw} option forces a space between a @code{while}
and the following parenthesis. This is the default.
@kindex -prs
@kindex --space-after-parentheses
The @option{-prs} option causes all parentheses to be separated with
a space from whatever is between them. For example, using @option{-prs}
results in code like:
@example
@group
while ( ( e_code - s_code ) < ( dec_ind - 1 ) )
@{
set_buf_break ( bb_dec_ind );
*e_code++ = ' ';
@}
@end group
@end example
@node Declarations, Indentation, Statements, Indent Program
@comment node-name, next, previous, up
@section Declarations
@kindex -di@var{n}
@kindex --declaration-indentation@var{n}
By default @command{indent} will line up identifiers, in the column
specified by the @option{-di} option. For example, @option{-di16} makes
things look like:
@example
@group
int foo;
char *bar;
@end group
@end example
Using a small value (such as one or two) for the @option{-di} option can
be used to cause the identifiers to be placed in the first available
position; for example:
@example
@group
int foo;
char *bar;
@end group
@end example
The value given to the @option{-di} option will still affect variables
which are put on separate lines from their types, for example
@option{-di2} will lead to:
@example
@group
int
foo;
@end group
@end example
@kindex -bc
@kindex --blank-lines-after-commas
@kindex -nbc
@kindex --no-blank-lines-after-commas
If the @option{-bc} option is specified, a newline is forced after each
comma in a declaration. For example,
@example
@group
int a,
b,
c;
@end group
@end example
@noindent
With the @option{-nbc} option this would look like
@example
int a, b, c;
@end example
@kindex -bfda
@kindex --break-function-decl-args
@kindex -nbfda
@kindex --dont-break-function-decl-args
@kindex -bfde
@kindex --break-function-decl-args-end
@kindex -nbfde
@kindex --dont-break-function-decl-args-end
The @option{-bfda} option causes a newline to be forced after the comma
separating the arguments of a function declaration. The arguments will
appear at one indention level deeper than the function declaration. This
is particularly helpful for functions with long argument lists.
The option @option{-bfde} causes a newline to be forced before the closing
bracket of the function declaration. For both options the 'n' setting is the default:
-nbdfa and -nbdfe.
For
example,
@example
@group
void foo (int arg1, char arg2, int *arg3, long arg4, char arg5);
@end group
@end example
@noindent
With the @option{-bfda} option this would look like
@example
void foo (
int arg1,
char arg2,
int *arg3,
long arg4,
char arg5);
@end example
With, in addition, the @option{-bfde} option this would look like
@example
void foo (
int arg1,
char arg2,
int *arg3,
long arg4,
char arg5
);
@end example
@kindex -psl
@kindex --procnames-start-lines
@kindex -npsl
@kindex --dont-break-procedure-type
@cindex @command{etags} requires @option{-psl}
The @option{-psl} option causes the type of a procedure being defined to
be placed on the line before the name of the procedure. This style is
required for the @command{etags} program to work correctly, as well as some
of the @code{c-mode} functions of Emacs.
@kindex -T
@cindex Typenames
@cindex typedef
You must use the @option{-T}
option to tell @command{indent} the name of all the typenames in your
program that are defined by @code{typedef}. @option{-T} can be specified
more than once, and all names specified are used. For example, if your
program contains
@example
@group
typedef unsigned long CODE_ADDR;
typedef enum @{red, blue, green@} COLOR;
@end group
@end example
@noindent
you would use the options @option{-T CODE_ADDR -T COLOR}.
@kindex -bls
@kindex --braces-after-struct-decl-line
@kindex -brs
@kindex --braces-on-struct-decl-line
The @option{-brs} or @option{-bls} option specifies how to format braces
in struct declarations. The @option{-brs} option formats braces like
this:
@example
@group
struct foo @{
int x;
@};
@end group
@end example
@noindent
The @option{-bls} option formats them like this:
@example
@group
struct foo
@{
int x;
@};
@end group
@end example
@kindex -blf
@kindex --braces-after-func-def-line
@kindex -brs
@kindex --braces-on-func-def-line
Similarly to the structure brace @option{-brs} and @option{-bls} options,
the function brace options @option{-brf} or @option{-blf} specify how to format the braces
in function definitions. The @option{-brf} option formats braces like
this:
@example
@group
int one(void) @{
return 1;
@};
@end group
@end example
@noindent
The @option{-blf} option formats them like this:
@example
@group
int one(void)
@{
return 1;
@};
@end group
@end example
@node Indentation, Breaking long lines, Declarations, Indent Program
@comment node-name, next, previous, up
@section Indentation
@kindex -i@var{n}
@kindex --indent-level@var{n}
@kindex -ci@var{n}
@kindex --continuation-indentation@var{n}
@kindex -lp
@kindex --continue-at-parentheses
@kindex -nlp
@kindex --dont-line-up-parentheses
One issue in the formatting of code is how far each line should be
indented from the left margin. When the beginning of a statement such
as @code{if} or @code{for} is encountered, the indentation level is
increased by the value specified by the @option{-i} option. For example,
use @option{-i8} to specify an eight character indentation for each
level. When a statement is broken across two lines, the second line is
indented by a number of additional spaces specified by the @option{-ci}
option. @option{-ci} defaults to 0. However, if the @option{-lp} option is
specified, and a line has a left parenthesis which is not closed on that
line, then continuation lines will be lined up to start at the character
position just after the left parenthesis. This processing also applies
to @samp{[} and applies to @samp{@{} when it occurs in initialization
lists. For example, a piece of continued code might look like this with
@option{-nlp -ci3} in effect:
@example
@group
p1 = first_procedure (second_procedure (p2, p3),
third_procedure (p4, p5));
@end group
@end example
@noindent
With @option{-lp} in effect the code looks somewhat clearer:
@example
@group
p1 = first_procedure (second_procedure (p2, p3),
third_procedure (p4, p5));
@end group
@end example
@kindex -ts@var{n}
@kindex --tab-size@var{n}
When a statement is broken in between two or more paren pairs (...),
each extra pair causes the indentation level extra indentation:
@example
@group
if ((((i < 2 &&
k > 0) || p == 0) &&
q == 1) ||
n = 0)
@end group
@end example
@noindent
The option @option{-ip@var{N}} can be used to set the extra offset per paren.
For instance, @option{-ip0} would format the above as:
@example
@group
if ((((i < 2 &&
k > 0) || p == 0) &&
q == 1) ||
n = 0)
@end group
@end example
@noindent
@command{indent} assumes that tabs are placed at regular intervals of both
input and output character streams. These intervals are by default 8
columns wide, but (as of version 1.2) may be changed by the @option{-ts}
option. Tabs are treated as the equivalent number of spaces.
@kindex -ip@var{n}
@kindex --parameter-indentation@var{n}
@kindex -nip
@kindex --no-parameter-indentation
The indentation of type declarations in old-style function definitions
is controlled by the @option{-ip} parameter. This is a numeric parameter
specifying how many spaces to indent type declarations. For example,
the default @w{@option{-ip5}} makes definitions look like this:
@example
@group
char *
create_world (x, y, scale)
int x;
int y;
float scale;
@{
. . .
@}
@end group
@end example
For compatibility with other versions of indent, the option @option{-nip}
is provided, which is equivalent to @option{-ip0}.
@kindex -lps
@kindex --leave-preprocessor-space
@kindex -nlps
@kindex --remove-preprocessor-space
ANSI C allows white space to be placed on preprocessor command lines
between the character @samp{#} and the command name. By default,
@command{indent} removes this space, but specifying the @option{-lps} option
directs @command{indent} to leave this space unmodified. The option @option{-ppi}
overrides @option{-nlps} and @option{-lps}.
@kindex -ppi@var{n}
@kindex --preprocessor-indentation@var{n}
This option can be used to request that preprocessor conditional statements can
be indented by to given number of spaces, for example with the option @option{-ppi 3}
@example
@group
#if X
#if Y
#define Z 1
#else
#define Z 0
#endif
#endif
@end group
@end example
becomes
@example
@group
#if X
# if Y
# define Z 1
# else
# define Z 0
# endif
#endif
@end group
@end example
@kindex -il@var{n}
@kindex --indent-label@var{n}
This option sets the offset at which a label (except case labels)
will be positioned. If it is set to zero or a positive number, this indicates how
far from the left margin to indent a label. If it is set to a negative number,
this indicates how far back from the current indent level to place the label.
The default setting is -2 which matches the behaviour of earlier versions of indent.
Note that this parameter does not affect the placing of case labels; see the
@option{-cli} parameter for that. For example with the option @option{-il 1}
@example
@group
function()
@{
if (do_stuff1() == ERROR)
goto cleanup1;
if (do_stuff2() == ERROR)
goto cleanup2;
return SUCCESS;
cleanup2:
do_cleanup2();
cleanup1:
do_cleanup1();
return ERROR;
@}
@end group
@end example
becomes
@example
@group
function()
@{
if (do_stuff1() == ERROR)
goto cleanup1;
if (do_stuff2() == ERROR)
goto cleanup2;
return SUCCESS;
cleanup2:
do_cleanup2();
cleanup1:
do_cleanup1();
return ERROR;
@}
@end group
@end example
@node Breaking long lines, Disabling Formatting, Indentation, Indent Program
@comment node-name, next, previous, up
@section Breaking long lines
@kindex -l@var{n}
@kindex --line-length@var{n}
With the option @option{-l@var{n}}, or @option{--line-length@var{n}}, it is
possible to specify the maximum length of a line of C code, not including
possible comments that follow it.
When lines become longer than the specified line length, GNU @command{indent}
tries to break the line at a logical place. This is new as of version 2.1
however and not very intelligent or flexible yet.
@kindex -bbo
@kindex --break-before-boolean-operator
@kindex -nbbo
@kindex --break-after-boolean-operator
@kindex -hnl
@kindex --honour-newlines
@kindex -nhnl
@kindex --ignore-newlines
Currently there are two options that allow one to interfere with the
algorithm that determines where to break a line.
The @option{-bbo} option causes GNU @command{indent} to prefer to break
long lines before the boolean operators @code{&&} and @code{||}. The
@option{-nbbo} option causes GNU @command{indent} not have that
preference. For example, the default option @option{-bbo} (together
with @option{--line-length60} and @option{--ignore-newlines}) makes code
look like this:
@example
@group
if (mask
&& ((mask[0] == '\0')
|| (mask[1] == '\0'
&& ((mask[0] == '0') || (mask[0] == '*')))))
@end group
@end example
Using the option @option{-nbbo} will make it look like this:
@example
@group
if (mask &&
((mask[0] == '\0') ||
(mask[1] == '\0' &&
((mask[0] == '0') || (mask[0] == '*')))))
@end group
@end example
The default @option{-hnl}, however, honours newlines in the input file by
giving them the highest possible priority to break lines at. For example,
when the input file looks like this:
@example
@group
if (mask
&& ((mask[0] == '\0')
|| (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*')))))
@end group
@end example
@noindent
then using the option @option{-hnl}, or @option{--honour-newlines},
together with the previously mentioned @option{-nbbo} and
@option{--line-length60}, will cause the output not to be what is given
in the last example but instead will prefer to break at the positions
where the code was broken in the input file:
@example
@group
if (mask
&& ((mask[0] == '\0')
|| (mask[1] == '\0' &&
((mask[0] == '0') || (mask[0] == '*')))))
@end group
@end example
The idea behind this option is that lines which are too long, but are already
broken up, will not be touched by GNU @command{indent}. Really messy code
should be run through @command{indent} at least once using the
@option{--ignore-newlines} option though.
@node Disabling Formatting, Miscellaneous options, Breaking long lines, Indent Program
@comment node-name, next, previous, up
@section Disabling Formatting
Formatting of C code may be disabled for portions of a program by
embedding special @dfn{control comments} in the program. To turn off
formatting for a section of a program, place the disabling control
comment @code{/* *INDENT-OFF* */} on a line by itself just before that
section. Program text scanned after this control comment is output
precisely as input with no modifications until the corresponding
enabling comment is scanned on a line by itself. The disabling control
comment is @code{/* *INDENT-ON* */}, and any text following the comment
on the line is also output unformatted. Formatting begins again with
the input line following the enabling control comment.
More precisely, @command{indent} does not attempt to verify the closing
delimiter (@code{*/}) for these C comments, and any whitespace on the
line is totally transparent.
These control comments also function in their C++ formats, namely
@code{// *INDENT-OFF*} and @code{// *INDENT-ON*}.
It should be noted that the internal state of @command{indent} remains
unchanged over the course of the unformatted section. Thus, for
example, turning off formatting in the middle of a function and
continuing it after the end of the function may lead to bizarre
results. It is therefore wise to be somewhat modular in selecting code
to be left unformatted.
As a historical note, some earlier versions of @command{indent} produced
error messages beginning with @code{*INDENT**}. These versions of
@command{indent} were written to ignore any input text lines which began
with such error messages. I have removed this incestuous feature from
GNU @command{indent}.
@node Miscellaneous options, Bugs, Disabling Formatting, Indent Program
@comment node-name, next, previous, up
@section Miscellaneous options
@kindex -version
To find out what version of @command{indent} you have, use the command
@code{indent -version}. This will report the version number of
@command{indent}, without doing any of the normal processing.
@kindex -v
@kindex --verbose
@kindex -nv
@kindex --no-verbosity
@comment Would --terse be better? I think not, but perhaps accepting
@comment --no-verbose would avoid error messages.
The @option{-v} option can be used to turn on verbose mode. When in
verbose mode, @command{indent} reports when it splits one line of input
into two more more lines of output, and gives some size statistics at
completion.
@kindex -pmt
@kindex --preserve-mtime
@kindex -npmt
The @option{-pmt} option causes @command{indent} to preserve the access
and modification times on the output files. Using this option
has the advantage that running indent on all source and header
files in a project won't cause @code{make} to rebuild all targets.
This option is only available on Operating Systems that have the
POSIX @code{utime(2)} function.
@node Bugs, Copyright, Miscellaneous options, Indent Program
@comment node-name, next, previous, up
@section Bugs
Please report any bugs to @email{bug-indent@@gnu.org}.
When @command{indent} is run twice on a file, with the same profile,
it should @emph{never} change that file the second time. With the
current design of @command{indent}, this can not be guaranteed,
and it has not been extensively tested.
@command{indent} does not understand C. In some cases this leads to
the inability to join lines. The result is that running a file
through @command{indent} is @emph{irreversible}, even if the used input
file was the result of running @command{indent} with a given profile
(@file{.indent.pro}).
While an attempt was made to get @command{indent} working for C++, it
will not do a good job on any C++ source except the very simplest.
@command{indent} does not look at the given @option{--line-length} option
when writing comments to the output file. This results often in comments
being put far to the right. In order to prohibit @command{indent} from
joining a broken line that has a comment at the end, make sure that the
comments start on the first line of the break.
@command{indent} does not count lines and comments (see the @option{-v}
option) when @command{indent} is turned off with
@code{/* *INDENT-OFF* */}.
Comments of the form @code{/*UPPERCASE*/} are not treated as comment but as an
identifier, causing them to be joined with the next line. This renders
comments of this type useless, unless they are embedded in the code to
begin with.
@node Copyright, , Bugs, Indent Program
@comment node-name, next, previous, up
@section Copyright
The following copyright notice applies to the @command{indent} program.
The copyright and copying permissions for this manual appear near the
beginning of @file{indent.texinfo} and @file{indent.info}, and near the
end of @file{indent.1}.
@display
Copyright @copyright{} 2001 David Ingamells.
Copyright @copyright{} 1999 Carlo Wood.
Copyright @copyright{} 1995, 1996 Joseph Arceneaux.
Copyright @copyright{} 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation
Copyright @copyright{} 1985 Sun Microsystems, Inc.
Copyright @copyright{} 1980 The Regents of the University of California.
Copyright @copyright{} 1976 Board of Trustees of the University of Illinois.
All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley, the University of Illinois,
Urbana, and Sun Microsystems, Inc. The name of either University
or Sun Microsystems may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
@end display
@c !END THEREST
@node Option Summary, Index, Indent Program, Top
@appendix Option Summary
Here is a list of all the options for @command{indent}, alphabetized by
short option. It is followed by a cross key alphabetized by long option.
@c !BEGIN OPTIONS
@c The cross references are all on lines by themselves because this
@c looks better in both printed output and Info. 4 Feb 1992 --rjc
@table @samp
@item -bad
@itemx --blank-lines-after-declarations
Force blank lines after the declarations.@*
@xref{Blank lines}.
@item -bap
@itemx --blank-lines-after-procedures
Force blank lines after procedure bodies.@*
@xref{Blank lines}.
@item -bbb
@itemx --blank-lines-before-block-comments
Force blank lines before block comments.@*
@xref{Blank lines}.
@item -bbo
@itemx --break-before-boolean-operator
Prefer to break long lines before boolean operators.@*
@xref{Breaking long lines}.
@item -bc
@itemx --blank-lines-after-commas
Force newline after comma in declaration.@*
@xref{Declarations}.
@item -bl
@itemx --braces-after-if-line
Put braces on line after @code{if}, etc.@*
@xref{Statements}.
@item -blf
@itemx --braces-after-func-def-line
Put braces on line following function definition line.@*
@xref{Declarations}.
@item -bli@var{n}
@itemx --brace-indent@var{n}
Indent braces @var{n} spaces.@*
@xref{Statements}.
@item -bls
@itemx --braces-after-struct-decl-line
Put braces on the line after @code{struct} declaration lines.@*
@xref{Declarations}.
@item -br
@itemx --braces-on-if-line
Put braces on line with @code{if}, etc.@*
@xref{Statements}.
@item -brf
@itemx --braces-on-func-def-line
Put braces on function definition line.@*
@xref{Declarations}.
@item -brs
@itemx --braces-on-struct-decl-line
Put braces on @code{struct} declaration line.@*
@xref{Declarations}.
@item -bs
@itemx --Bill-Shannon
@itemx --blank-before-sizeof
Put a space between @code{sizeof} and its argument.@*
@xref{Statements}.
@item -c@var{n}
@itemx --comment-indentation@var{n}
Put comments to the right of code in column @var{n}.@*
@xref{Comments}.
@item -cbi@var{n}
@itemx --case-brace-indentation@var{n}
Indent braces after a case label N spaces.@*
@xref{Statements}.
@item -cd@var{n}
@itemx --declaration-comment-column@var{n}
Put comments to the right of the declarations in column @var{n}.@*
@xref{Comments}.
@item -cdb
@itemx --comment-delimiters-on-blank-lines
Put comment delimiters on blank lines.@*
@xref{Comments}.
@item -cdw
@itemx --cuddle-do-while
Cuddle while of @code{do @{@} while;} and preceding @samp{@}}.@*
@xref{Comments}.
@item -ce
@itemx --cuddle-else
Cuddle else and preceding @samp{@}}.@*
@xref{Comments}.
@item -ci@var{n}
@itemx --continuation-indentation@var{n}
Continuation indent of @var{n} spaces.@*
@xref{Statements}.
@item -cli@var{n}
@itemx --case-indentation@var{n}
Case label indent of @var{n} spaces.@*
@xref{Statements}.
@item -cp@var{n}
@itemx --else-endif-column@var{n}
Put comments to the right of @code{#else} and
@code{#endif} statements in column @var{n}.@*
@xref{Comments}.
@item -cs
@itemx --space-after-cast
Put a space after a cast operator.@*
@xref{Statements}.
@item -d@var{n}
@itemx --line-comments-indentation@var{n}
Set indentation of comments not to the right
of code to @var{n} spaces.@*
@xref{Comments}.
@item -bfda
@itemx --break-function-decl-args
Break the line before all arguments in a declaration.@*
@xref{Declarations}.
@item -bfde
@itemx --break-function-decl-args-end
Break the line after the last argument in a declaration.@*
@xref{Declarations}.
@item -dj
@itemx --left-justify-declarations
If -cd 0 is used then comments after declarations are left justified
behind the declaration.@*
@xref{Declarations}.
@item -di@var{n}
@itemx --declaration-indentation@var{n}
Put variables in column @var{n}.@*
@xref{Declarations}.
@item -fc1
@itemx --format-first-column-comments
Format comments in the first column.@*
@xref{Comments}.
@item -fca
@itemx --format-all-comments
Do not disable all formatting of comments.@*
@xref{Comments}.
@item -gnu
@itemx --gnu-style
Use GNU coding style. This is the default.@*
@xref{Common styles}.
@item -hnl
@itemx --honour-newlines
Prefer to break long lines at the position of newlines in the input.@*
@xref{Breaking long lines}.
@item -i@var{n}
@itemx --indent-level@var{n}
Set indentation level to @var{n} spaces.@*
@xref{Indentation}.
@item -il@var{n}
@itemx --indent-label@var{n}
Set offset for labels to column @var{n}.@*
@xref{Indentation}.
@item -ip@var{n}
@itemx --parameter-indentation@var{n}
Indent parameter types in old-style function
definitions by @var{n} spaces.@*
@xref{Indentation}.
@item -kr
@itemx --k-and-r-style
Use Kernighan & Ritchie coding style.@*
@xref{Common styles}.
@item -l@var{n}
@itemx --line-length@var{n}
Set maximum line length for non-comment lines to @var{n}.@*
@xref{Breaking long lines}.
@item -lc@var{n}
@itemx --comment-line-length@var{n}
Set maximum line length for comment formatting to @var{n}.@*
@xref{Comments}.
@item -linux
@itemx --linux-style
Use Linux coding style.@*
@xref{Common styles}.
@item -lp
@itemx --continue-at-parentheses
Line up continued lines at parentheses.@*
@xref{Indentation}.
@item -lps
@itemx --leave-preprocessor-space
Leave space between @samp{#} and preprocessor directive.@*
@xref{Indentation}.
@item -nbad
@itemx --no-blank-lines-after-declarations
Do not force blank lines after declarations.@*
@xref{Blank lines}.
@item -nbap
@itemx --no-blank-lines-after-procedures
Do not force blank lines after procedure bodies.@*
@xref{Blank lines}.
@ignore
@comment Didn't do anything, so I removed it
@item -nbbb
@itemx --no-blank-lines-before-block-comments
Do not force blank-lines before block comments.@*
@xref{Blank lines}.
@end ignore
@item -nbbo
@itemx --break-after-boolean-operator
Do not prefer to break long lines before boolean operators.@*
@xref{Breaking long lines}.
@item -nbc
@itemx --no-blank-lines-after-commas
Do not force newlines after commas in declarations.@*
@xref{Declarations}.
@item -nbfda
@itemx --dont-break-function-decl-args
Don't put each argument in a function declaration on a separate line.@*
@xref{Declarations}.
@item -ncdb
@itemx --no-comment-delimiters-on-blank-lines
Do not put comment delimiters on blank lines.@*
@xref{Comments}.
@item -ncdw
@itemx --dont-cuddle-do-while
Do not cuddle @code{@}} and the @code{while} of a @code{do @{@} while;}.@*
@xref{Statements}.
@item -nce
@itemx --dont-cuddle-else
Do not cuddle @code{@}} and @code{else}.@*
@xref{Statements}.
@item -ncs
@itemx --no-space-after-casts
Do not put a space after cast operators.@*
@xref{Statements}.
@item -ndj@var{n}
@itemx --dont-left-justify-declarations
Comments after declarations are treated the same as
comments after other statements.@*
@xref{Declarations}.
@item -nfc1
@itemx --dont-format-first-column-comments
Do not format comments in the first column as normal.@*
@xref{Comments}.
@item -nfca
@itemx --dont-format-comments
Do not format any comments.@*
@xref{Comments}.
@item -nhnl
@itemx --ignore-newlines
Do not prefer to break long lines at the position of newlines in the input.@*
@xref{Breaking long lines}.
@item -nip
@itemx --no-parameter-indentation
Zero width indentation for parameters.@*
@xref{Indentation}.
@item -nlp
@itemx --dont-line-up-parentheses
Do not line up parentheses.@*
@xref{Statements}.
@item -npcs
@itemx --no-space-after-function-call-names
Do not put space after the function in function calls.@*
@xref{Statements}.
@item -nprs
@itemx --no-space-after-parentheses
Do not put a space after every '(' and before every ')'.@*
@xref{Statements}.
@item -npsl
@itemx --dont-break-procedure-type
Put the type of a procedure on the same line as its name.@*
@xref{Declarations}.
@item -nsaf
@itemx --no-space-after-for
Do not put a space after every @code{for}.@*
@xref{Statements}.
@item -nsai
@itemx --no-space-after-if
Do not put a space after every @code{if}.@*
@xref{Statements}.
@item -nsaw
@itemx --no-space-after-while
Do not put a space after every @code{while}.@*
@xref{Statements}.
@item -nsc
@itemx --dont-star-comments
Do not put the @samp{*} character at the left of comments.@*
@xref{Comments}.
@item -nsob
@itemx --leave-optional-blank-lines
Do not swallow optional blank lines.@*
@xref{Blank lines}.
@item -nss
@itemx --dont-space-special-semicolon
Do not force a space before the semicolon after certain statements.
Disables @option{-ss}.@*
@xref{Statements}.
@item -nut
@itemx --no-tabs
Use spaces instead of tabs.@*
@xref{Indentation}.
@item -nv
@itemx --no-verbosity
Disable verbose mode.@*
@xref{Miscellaneous options}.
@item -orig
@itemx --original
Use the original Berkeley coding style.@*
@xref{Common styles}.
@item -npro
@itemx --ignore-profile
Do not read @file{.indent.pro} files.@*
@xref{Invoking indent}.
@item -pcs
@itemx --space-after-procedure-calls
Insert a space between the name of the
procedure being called and the @samp{(}.@*
@xref{Statements}.
@item -pi@var{n}
@itemx --paren-indentation@var{n}
Specify the extra indentation per open parentheses '(' when a
statement is broken.
@xref{Statements}.
@item -pmt
@itemx --preserve-mtime
Preserve access and modification times on output files.
@xref{Miscellaneous options}.
@item -ppi@var{n}
@itemx --preprocessor-indentation@var{n}
Specify the indentation for preprocessor conditional statements.
@xref{Indentation}.
@item -prs
@itemx --space-after-parentheses
Put a space after every '(' and before every ')'.@*
@xref{Statements}.
@item -psl
@itemx --procnames-start-lines
Put the type of a procedure on the line before its name.@*
@xref{Declarations}.
@item -saf
@itemx --space-after-for
Put a space after each @code{for}.@*
@xref{Statements}.
@item -sai
@itemx --space-after-if
Put a space after each @code{if}.@*
@xref{Statements}.
@item -saw
@itemx --space-after-while
Put a space after each @code{while}.@*
@xref{Statements}.
@item -sbi@var{n}
@itemx --struct-brace-indentation@var{n}
Indent braces of a struct, union or enum N spaces.@*
@xref{Statements}.
@item -sc
@itemx --start-left-side-of-comments
Put the @samp{*} character at the left of comments.@*
@xref{Comments}.
@item -sob
@itemx --swallow-optional-blank-lines
Swallow optional blank lines.@*
@xref{Blank lines}.
@item -ss
@itemx --space-special-semicolon
On one-line @code{for} and @code{while} statements,
force a blank before the semicolon.@*
@xref{Statements}.
@item -st
@itemx --standard-output
Write to standard output.@*
@xref{Invoking indent}.
@item -T
Tell @command{indent} the name of typenames.@*
@xref{Declarations}.
@item -ts@var{n}
@itemx --tab-size@var{n}
Set tab size to @var{n} spaces.@*
@xref{Indentation}.
@item -ut
@itemx --use-tabs
Use tabs. This is the default.@*
@xref{Indentation}.
@item -v
@itemx --verbose
Enable verbose mode.@*
@xref{Miscellaneous options}.
@item -version
Output the version number of @command{indent}.@*
@xref{Miscellaneous options}.
@end table
@c !END OPTIONS
@c !BEGIN CROSSREF
@subheading Options' Cross Key
Here is a list of options alphabetized by long option, to help you find
the corresponding short option.
@iftex
@sp 2
@end iftex
@tex
\def\leaderfill{\leaders\hbox to 1em{\hss.\hss}\hfill}
{\tt
\line{ --blank-lines-after-commas \leaderfill -bc\ \ }
\line{ --blank-lines-after-declarations \leaderfill -bad\ }
\line{ --blank-lines-after-procedures \leaderfill -bap\ }
\line{ --blank-lines-before-block-comments \leaderfill -bbb\ }
\line{ --braces-after-if-line \leaderfill -bl\ \ }
\line{ --braces-after-func-def-line \leaderfill -blf\ \ }
\line{ --brace-indent \leaderfill -bli@var{n}}
\line{ --braces-after-struct-decl-line \leaderfill -bls\ \ }
\line{ --break-after-boolean-operator \leaderfill -nbbo\ \ }
\line{ --break-before-boolean-operator \leaderfill -bbo\ \ }
\line{ --break-function-decl-args \leaderfill -bfda}
\line{ --break-function-decl-args-end \leaderfill -bfde}
\line{ --braces-on-if-line \leaderfill -br\ \ }
\line{ --braces-on-func-def-line \leaderfill -brf\ \ }
\line{ --braces-on-struct-decl-line \leaderfill -brs\ \ }
\line{ --case-indentation \leaderfill -cli@var{n}}
\line{ --case-brace-indentation \leaderfill -cbi@var{n}}
\line{ --comment-delimiters-on-blank-lines \leaderfill -cdb\ }
\line{ --comment-indentation \leaderfill -c@var{n}\ \ }
\line{ --continuation-indentation \leaderfill -ci@var{n}\ }
\line{ --continue-at-parentheses \leaderfill -lp\ \ }
\line{ --cuddle-do-while \leaderfill -cdw\ \ }
\line{ --cuddle-else \leaderfill -ce\ \ }
\line{ --declaration-comment-column \leaderfill -cd@var{n}\ }
\line{ --declaration-indentation \leaderfill -di@var{n}\ }
\line{ --dont-break-function-decl-args \leaderfill -nbfda}
\line{ --dont-break-function-decl-args-end \leaderfill -nbfde}
\line{ --dont-break-procedure-type \leaderfill -npsl}
\line{ --dont-cuddle-do-while \leaderfill -ncdw\ \ }
\line{ --dont-cuddle-else \leaderfill -nce\ }
\line{ --dont-format-comments \leaderfill -nfca}
\line{ --dont-format-first-column-comments \leaderfill -nfc1}
\line{ --dont-left-justify-declarations \leaderfill -ndj\ }
\line{ --dont-line-up-parentheses \leaderfill -nlp\ }
\line{ --dont-space-special-semicolon \leaderfill -nss\ }
\line{ --dont-star-comments \leaderfill -nsc\ }
\line{ --else-endif-column \leaderfill -cp@var{n}\ }
\line{ --format-all-comments \leaderfill -fca\ }
\line{ --format-first-column-comments \leaderfill -fc1\ }
\line{ --gnu-style \leaderfill -gnu\ }
\line{ --honour-newlines \leaderfill -hnl\ \ }
\line{ --ignore-newlines \leaderfill -nhnl\ \ }
\line{ --ignore-profile \leaderfill -npro}
\line{ --indent-label \leaderfill -il@var{n}\ \ }
\line{ --indent-level \leaderfill -i@var{n}\ \ }
\line{ --k-and-r-style \leaderfill -kr\ \ }
\line{ --leave-optional-blank-lines \leaderfill -nsob}
\line{ --leave-preprocessor-space \leaderfill -lps\ }
\line{ --left-justify-declarations \leaderfill -dj\ }
\line{ --line-comments-indentation \leaderfill -d@var{n}\ \ }
\line{ --line-length \leaderfill -l@var{n}\ \ }
\line{ --linux-style \leaderfill -linux\ \ }
\line{ --no-blank-lines-after-commas \leaderfill -nbc\ }
\line{ --no-blank-lines-after-declarations \leaderfill -nbad}
\line{ --no-blank-lines-after-procedures \leaderfill -nbap}
\line{ --no-blank-lines-before-block-comments \leaderfill -nbbb}
\line{ --no-comment-delimiters-on-blank-lines \leaderfill -ncdb}
\line{ --no-space-after-casts \leaderfill -ncs\ }
\line{ --no-parameter-indentation \leaderfill -nip\ }
\line{ --no-space-after-for \leaderfill -nsaf}
\line{ --no-space-after-function-call-names \leaderfill -npcs}
\line{ --no-space-after-if \leaderfill -nsai}
\line{ --no-space-after-parentheses \leaderfill -nprs}
\line{ --no-space-after-while \leaderfill -nsaw}
\line{ --no-tabs \leaderfill -nut\ \ }
\line{ --no-verbosity \leaderfill -nv\ \ }
\line{ --original \leaderfill -orig}
\line{ --parameter-indentation \leaderfill -ip@var{n}\ }
\line{ --paren-indentation \leaderfill -pi@var{n}\ }
\line{ --preprocessor-indentation \leaderfill -ppi@var{n}\ }
\line{ --preserve-mtime \leaderfill -pmt\ }
\line{ --procnames-start-lines \leaderfill -psl\ }
\line{ --space-after-cast \leaderfill -cs\ \ }
\line{ --space-after-for \leaderfill -saf\ }
\line{ --space-after-if \leaderfill -sai\ }
\line{ --space-after-parentheses \leaderfill -prs\ }
\line{ --space-after-procedure-calls \leaderfill -pcs\ }
\line{ --space-after-while \leaderfill -saw\ }
\line{ --space-special-semicolon \leaderfill -ss\ \ }
\line{ --standard-output \leaderfill -st\ \ }
\line{ --start-left-side-of-comments \leaderfill -sc\ \ }
\line{ --struct-brace-indentation \leaderfill -sbi@var{n}}
\line{ --swallow-optional-blank-lines \leaderfill -sob\ }
\line{ --tab-size \leaderfill -ts@var{n}\ }
\line{ --use-tabs \leaderfill -ut\ \ }
\line{ --verbose \leaderfill -v\ \ \ }
}
@end tex
@ifinfo
@example
--blank-lines-after-commas -bc
--blank-lines-after-declarations -bad
--blank-lines-after-procedures -bap
--blank-lines-before-block-comments -bbb
--braces-after-if-line -bl
--braces-after-func-def-line -blf
--brace-indent -bli
--braces-after-struct-decl-line -bls
--braces-on-if-line -br
--braces-on-func-def-line -brf
--braces-on-struct-decl-line -brs
--break-after-boolean-operator -nbbo
--break-before-boolean-operator -bbo
--break-function-decl-args -bfda
--break-function-decl-args-end -bfde
--case-indentation -cli@var{n}
--case-brace-indentation -cbi@var{n}
--comment-delimiters-on-blank-lines -cdb
--comment-indentation -c@var{n}
--continuation-indentation -ci@var{n}
--continue-at-parentheses -lp
--cuddle-do-while -cdw
--cuddle-else -ce
--declaration-comment-column -cd@var{n}
--declaration-indentation -di@var{n}
--dont-break-function-decl-args -nbfda
--dont-break-function-decl-args-end -nbfde
--dont-break-procedure-type -npsl
--dont-cuddle-do-while -ncdw
--dont-cuddle-else -nce
--dont-format-comments -nfca
--dont-format-first-column-comments -nfc1
--dont-line-up-parentheses -nlp
--dont-left-justify-declarations -ndj
--dont-space-special-semicolon -nss
--dont-star-comments -nsc
--else-endif-column -cp@var{n}
--format-all-comments -fca
--format-first-column-comments -fc1
--gnu-style -gnu
--honour-newlines -hnl
--ignore-newlines -nhnl
--ignore-profile -npro
--indent-label -il@var{n}
--indent-level -i@var{n}
--k-and-r-style -kr
--leave-optional-blank-lines -nsob
--leave-preprocessor-space -lps
--left-justify-declarations -dj
--line-comments-indentation -d@var{n}
--line-length -l@var{n}
--linux-style -linux
--no-blank-lines-after-commas -nbc
--no-blank-lines-after-declarations -nbad
--no-blank-lines-after-procedures -nbap
--no-blank-lines-before-block-comments -nbbb
--no-comment-delimiters-on-blank-lines -ncdb
--no-space-after-casts -ncs
--no-parameter-indentation -nip
--no-space-after-for -nsaf
--no-space-after-function-call-names -npcs
--no-space-after-if -nsai
--no-space-after-parentheses -nprs
--no-space-after-while -nsaw
--no-tabs -nut
--no-verbosity -nv
--original -orig
--parameter-indentation -ip@var{n}
--paren-indentation -pi@var{n}
--preserve-mtime -pmt
--preprocessor-indentation -ppi@var{n}
--procnames-start-lines -psl
--space-after-cast -cs
--space-after-for -saf
--space-after-if -sai
--space-after-parentheses -prs
--space-after-procedure-calls -pcs
--space-after-while -saw
--space-special-semicolon -ss
--standard-output -st
--start-left-side-of-comments -sc
--struct-brace-indentation -sbi@var{n}
--swallow-optional-blank-lines -sob
--tab-size -ts@var{n}
--use-tabs -ut
--verbose -v
@end example
@end ifinfo
@c !END CROSSREF
@node Index, , Option Summary, Top
@unnumbered Index
@printindex ky
@page
@contents
@bye
|