summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-leap-15-6/man1/indent.1
blob: 645d18b1c0cc4d06f9249ff62adde141062013fb (plain)
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
.TH INDENT 1L 
.SH "NAME"
indent \- changes the appearance of a C program by inserting or deleting whitespace.  
.SH "SYNOPSIS"
.B "indent "
[options] [input\-files]
.sp
.B "indent "
[options] [single\-input\-file] [\-o output\-file]
.sp
.B "indent "
\-\-version
.SH "DESCRIPTION"
This man page is generated from the file \fIindent.texinfo\fR.
This is Edition  of "The \fBindent\fR Manual",
for Indent Version , last updated .

The \fBindent\fR program
can be used to make code easier to read.  It can also convert from one
style of writing C to another.  

.B indent\fR 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.
.SH "OPTIONS"

.TP 4
.B -bad\fR, \fB--blank-lines-after-declarations\fR
Force blank lines after the declarations.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -bap\fR, \fB--blank-lines-after-procedures\fR
Force blank lines after procedure bodies.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -bbb\fR, \fB--blank-lines-before-block-comments\fR
Force blank lines before block comments.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -bbo\fR, \fB--break-before-boolean-operator\fR
Prefer to break long lines before boolean operators.
.br
See \fB\ BREAKING\ LONG\ LINES\fR.
.TP
.B -bc\fR, \fB--blank-lines-after-commas\fR
Force newline after comma in declaration.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -bl\fR, \fB--braces-after-if-line\fR
Put braces on line after \fBif\fR, etc.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -blf\fR, \fB--braces-after-func-def-line\fR
Put braces on line following function definition line.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -bli\fIn\fB\fR, \fB--brace-indent\fIn\fB\fR
Indent braces \fIn\fR spaces.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -bls\fR, \fB--braces-after-struct-decl-line\fR
Put braces on the line after \fBstruct\fR declaration lines.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -br\fR, \fB--braces-on-if-line\fR
Put braces on line with \fBif\fR, etc.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -brf\fR, \fB--braces-on-func-def-line\fR
Put braces on function definition line.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -brs\fR, \fB--braces-on-struct-decl-line\fR
Put braces on \fBstruct\fR declaration line.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -bs\fR, \fB--Bill-Shannon\fR, \fB--blank-before-sizeof\fR
Put a space between \fBsizeof\fR and its argument.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -c\fIn\fB\fR, \fB--comment-indentation\fIn\fB\fR
Put comments to the right of code in column \fIn\fR.
.br
See \fB\ COMMENTS\fR.
.TP
.B -cbi\fIn\fB\fR, \fB--case-brace-indentation\fIn\fB\fR
Indent braces after a case label N spaces.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -cd\fIn\fB\fR, \fB--declaration-comment-column\fIn\fB\fR
Put comments to the right of the declarations in column \fIn\fR.
.br
See \fB\ COMMENTS\fR.
.TP
.B -cdb\fR, \fB--comment-delimiters-on-blank-lines\fR
Put comment delimiters on blank lines.
.br
See \fB\ COMMENTS\fR.
.TP
.B -cdw\fR, \fB--cuddle-do-while\fR
Cuddle while of \fBdo {} while;\fR and preceding \(oq}\(cq.
.br
See \fB\ COMMENTS\fR.
.TP
.B -ce\fR, \fB--cuddle-else\fR
Cuddle else and preceding \(oq}\(cq.
.br
See \fB\ COMMENTS\fR.
.TP
.B -ci\fIn\fB\fR, \fB--continuation-indentation\fIn\fB\fR
Continuation indent of \fIn\fR spaces.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -cli\fIn\fB\fR, \fB--case-indentation\fIn\fB\fR
Case label indent of \fIn\fR spaces.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -cp\fIn\fB\fR, \fB--else-endif-column\fIn\fB\fR
Put comments to the right of \fB#else\fR and \fB
#endif\fR statements in column \fIn\fR.
.br
See \fB\ COMMENTS\fR.
.TP
.B -cs\fR, \fB--space-after-cast\fR
Put a space after a cast operator.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -d\fIn\fB\fR, \fB--line-comments-indentation\fIn\fB\fR
Set indentation of comments not to the right 
of code to \fIn\fR spaces.
.br
See \fB\ COMMENTS\fR.
.TP
.B -bfda\fR, \fB--break-function-decl-args\fR
Break the line before all arguments in a declaration.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -bfde\fR, \fB--break-function-decl-args-end\fR
Break the line after the last argument in a declaration.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -dj\fIn\fB\fR, \fB--left-justify-declarations\fR
If -cd 0 is used then comments after declarations are left justified
behind the declaration.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -di\fIn\fB\fR, \fB--declaration-indentation\fIn\fB\fR
Put variables in column \fIn\fR.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -fc1\fR, \fB--format-first-column-comments\fR
Format comments in the first column.
.br
See \fB\ COMMENTS\fR.
.TP
.B -fca\fR, \fB--format-all-comments\fR
Do not disable all formatting of comments.
.br
See \fB\ COMMENTS\fR.
.TP
.B -gnu\fR, \fB--gnu-style\fR
Use GNU coding style.  This is the default.
.br
See \fB\ COMMON\ STYLES\fR.
.TP
.B -hnl\fR, \fB--honour-newlines\fR
Prefer to break long lines at the position of newlines in the input.
.br
See \fB\ BREAKING\ LONG\ LINES\fR.
.TP
.B -i\fIn\fB\fR, \fB--indent-level\fIn\fB\fR
Set indentation level to \fIn\fR spaces.
.br
See \fB\ INDENTATION\fR.
.TP
.B -il\fIn\fB\fR, \fB--indent-label\fIn\fB\fR
Set offset for labels to column \fIn\fR.
.br
See \fB\ INDENTATION\fR.
.TP
.B -ip\fIn\fB\fR, \fB--parameter-indentation\fIn\fB\fR
Indent parameter types in old-style function 
definitions by \fIn\fR spaces.
.br
See \fB\ INDENTATION\fR.
.TP
.B -kr\fR, \fB--k-and-r-style\fR
Use Kernighan & Ritchie coding style.
.br
See \fB\ COMMON\ STYLES\fR.
.TP
.B -l\fIn\fB\fR, \fB--line-length\fIn\fB\fR
Set maximum line length for non-comment lines to \fIn\fR.
.br
See \fB\ BREAKING\ LONG\ LINES\fR.
.TP
.B -lc\fIn\fB\fR, \fB--comment-line-length\fIn\fB\fR
Set maximum line length for comment formatting to \fIn\fR.
.br
See \fB\ COMMENTS\fR.
.TP
.B -linux\fR, \fB--linux-style\fR
Use Linux coding style.
.br
See \fB\ COMMON\ STYLES\fR.
.TP
.B -lp\fR, \fB--continue-at-parentheses\fR
Line up continued lines at parentheses.
.br
See \fB\ INDENTATION\fR.
.TP
.B -lps\fR, \fB--leave-preprocessor-space\fR
Leave space between \(oq#\(cq and preprocessor directive.
.br
See \fB\ INDENTATION\fR.
.TP
.B -nlps\fR, \fB--remove-preprocessor-space\fR
Remove space between \(oq#\(cq and preprocessor directive.
.br
See \fB\ INDENTATION\fR.
.TP
.B -nbad\fR, \fB--no-blank-lines-after-declarations\fR
Do not force blank lines after declarations.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -nbap\fR, \fB--no-blank-lines-after-procedures\fR
Do not force blank lines after procedure bodies.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -nbbo\fR, \fB--break-after-boolean-operator\fR
Do not prefer to break long lines before boolean operators.
.br
See \fB\ BREAKING\ LONG\ LINES\fR.
.TP
.B -nbc\fR, \fB--no-blank-lines-after-commas\fR
Do not force newlines after commas in declarations.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -nbfda\fR, \fB--dont-break-function-decl-args\fR
Don\(cqt put each argument in a function declaration on a separate line.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -ncdb\fR, \fB--no-comment-delimiters-on-blank-lines\fR
Do not put comment delimiters on blank lines.
.br
See \fB\ COMMENTS\fR.
.TP
.B -ncdw\fR, \fB--dont-cuddle-do-while\fR
Do not cuddle \fB}\fR and the \fBwhile\fR of a \fBdo {} while;\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -nce\fR, \fB--dont-cuddle-else\fR
Do not cuddle \fB}\fR and \fBelse\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -ncs\fR, \fB--no-space-after-casts\fR
Do not put a space after cast operators.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -ndj\fIn\fB\fR, \fB--dont-left-justify-declarations\fR
Comments after declarations are treated the same as 
comments after other statements.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -nfc1\fR, \fB--dont-format-first-column-comments\fR
Do not format comments in the first column as normal.
.br
See \fB\ COMMENTS\fR.
.TP
.B -nfca\fR, \fB--dont-format-comments\fR
Do not format any comments.
.br
See \fB\ COMMENTS\fR.
.TP
.B -nhnl\fR, \fB--ignore-newlines\fR
Do not prefer to break long lines at the position of newlines in the input.
.br
See \fB\ BREAKING\ LONG\ LINES\fR.
.TP
.B -nip\fR, \fB--no-parameter-indentation\fR
Zero width indentation for parameters.
.br
See \fB\ INDENTATION\fR.
.TP
.B -nlp\fR, \fB--dont-line-up-parentheses\fR
Do not line up parentheses.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -npcs\fR, \fB--no-space-after-function-call-names\fR
Do not put space after the function in function calls.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -nprs\fR, \fB--no-space-after-parentheses\fR
Do not put a space after every \(cq(\(cq and before every \(cq)\(cq.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -npsl\fR, \fB--dont-break-procedure-type\fR
Put the type of a procedure on the same line as its name.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -nsaf\fR, \fB--no-space-after-for\fR
Do not put a space after every \fBfor\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -nsai\fR, \fB--no-space-after-if\fR
Do not put a space after every \fBif\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -nsaw\fR, \fB--no-space-after-while\fR
Do not put a space after every \fBwhile\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -nsc\fR, \fB--dont-star-comments\fR
Do not put the \(oq*\(cq character at the left of comments.
.br
See \fB\ COMMENTS\fR.
.TP
.B -nsob\fR, \fB--leave-optional-blank-lines\fR
Do not swallow optional blank lines.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -nss\fR, \fB--dont-space-special-semicolon\fR
Do not force a space before the semicolon after certain statements.
Disables \(oq-ss\(cq.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -nut\fR, \fB--no-tabs\fR
Use spaces instead of tabs.
.br
See \fB\ INDENTATION\fR.
.TP
.B -nv\fR, \fB--no-verbosity\fR
Disable verbose mode.
.br
See \fB\ MISCELLANEOUS\ OPTIONS\fR.
.TP
.B -orig\fR, \fB--original\fR
Use the original Berkeley coding style.
.br
See \fB\ COMMON\ STYLES\fR.
.TP
.B -npro\fR, \fB--ignore-profile\fR
Do not read \(oq.indent.pro\(cq files.
.br
See \fB\ INVOKING\ INDENT\fR.
.TP
.B -pcs\fR, \fB--space-after-procedure-calls\fR
Insert a space between the name of the 
procedure being called and the \(oq(\(cq.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -pi\fIn\fB\fR, \fB--paren-indentation\fIn\fB\fR
Specify the extra indentation per open parentheses \(cq(\(cq when a
statement is broken.See \fB\ STATEMENTS\fR.
.TP
.B -pmt\fR, \fB--preserve-mtime\fR
Preserve access and modification times on output files.See \fB\ MISCELLANEOUS\ OPTIONS\fR.
.TP
.B -ppi\fIn\fB\fR, \fB--preprocessor-indentation\fIn\fB\fR
Specify the indentation for preprocessor conditional statements.See \fB\ INDENTATION\fR.
.TP
.B -ppi\fIn\fB\fR, \fB--preprocessor-indentation\fIn\fB\fR
Request indentation of preprocessor conditional statements.
.br
See \fB\ INDENTATION\fR.
.TP
.B -prs\fR, \fB--space-after-parentheses\fR
Put a space after every \(cq(\(cq and before every \(cq)\(cq.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -psl\fR, \fB--procnames-start-lines\fR
Put the type of a procedure on the line before its name.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -saf\fR, \fB--space-after-for\fR
Put a space after each \fBfor\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -sai\fR, \fB--space-after-if\fR
Put a space after each \fBif\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -saw\fR, \fB--space-after-while\fR
Put a space after each \fBwhile\fR.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -sbi\fIn\fB\fR, \fB--struct-brace-indentation\fIn\fB\fR
Indent braces of a struct, union or enum N spaces.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -sc\fR, \fB--start-left-side-of-comments\fR
Put the \(oq*\(cq character at the left of comments.
.br
See \fB\ COMMENTS\fR.
.TP
.B -sob\fR, \fB--swallow-optional-blank-lines\fR
Swallow optional blank lines.
.br
See \fB\ BLANK\ LINES\fR.
.TP
.B -ss\fR, \fB--space-special-semicolon\fR
On one-line \fBfor\fR and \fBwhile\fR statements, 
force a blank before the semicolon.
.br
See \fB\ STATEMENTS\fR.
.TP
.B -st\fR, \fB--standard-output\fR
Write to standard output.
.br
See \fB\ INVOKING\ INDENT\fR.
.TP
.B -T\fR
Tell \fBindent\fR the name of typenames.
.br
See \fB\ DECLARATIONS\fR.
.TP
.B -ts\fIn\fB\fR, \fB--tab-size\fIn\fB\fR
Set tab size to \fIn\fR spaces.
.br
See \fB\ INDENTATION\fR.
.TP
.B -ut\fR, \fB--use-tabs\fR
Use tabs. This is the default.
.br
See \fB\ INDENTATION\fR.
.TP
.B -v\fR, \fB--verbose\fR
Enable verbose mode.
.br
See \fB\ MISCELLANEOUS\ OPTIONS\fR.
.TP
.B -version\fR
Output the version number of \fBindent\fR.
.br
See \fB\ MISCELLANEOUS\ OPTIONS\fR.

.SH "INVOKING INDENT"

As of version 1.3, the format of the \fBindent\fR command is:

.in +5
.nf
.na

indent [\fIoptions\fR] [\fIinput-files\fR]

indent [\fIoptions\fR] [\fIsingle-input-file\fR] [-o \fIoutput-file\fR]

.in -5
.ad
.fi

This format is different from earlier versions and other versions of
.B indent\fR.

In the first form, one or more input files are specified.  \fBindent\fR
makes a backup copy of each file, and the original file is replaced with
its indented version.  See \fBBACKUP\ FILES\fR, for an explanation of how
backups are made.

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 \(oq-o\(cq option.

To cause \fBindent\fR to write to standard output, use the \(oq-st\(cq
option.  This is only allowed when there is only one input file, or when
the standard input is used.

If no input files are named, the standard input is read for input.
Also, if a filename named \(oq-\(cq is specified, then the standard input
is read.

As an example, each of the following commands will input the program
\(oqslithy_toves.c\(cq and write its indented text to
\(oqslithy_toves.out\(cq:

.in +5
.nf
.na

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

.in -5
.ad
.fi

Most other options to \fBindent\fR control how programs are formatted.
As of version 1.2, \fBindent\fR also recognizes a long name for each
option name.  Long options are prefixed by either \(oq--\(cq or
\(oq+\(cq.
[ \(oq+\(cq is being superseded by \(oq--\(cq to
maintain consistency with the POSIX standard.]
 In most of this document,
the traditional, short names are used for the sake of brevity.
See \fBOPTION\ SUMMARY\fR, for a list of options, including both long and
short names.

Here is another example:

.in +5
.nf
.na
indent -br test/metabolism.c -l85
.in -5
.ad
.fi

This will indent the program \(oqtest/metabolism.c\(cq using the
\(oq-br\(cq and \(oq-l85\(cq options, write the output back to
\(oqtest/metabolism.c\(cq, and write the original contents of
\(oqtest/metabolism.c\(cq to a backup file in the directory \(oqtest\(cq.

Equivalent invocations using long option names for this example would
be:

.in +5
.nf
.na

indent --braces-on-if-line --line-length185 test/metabolism.c

indent +braces-on-if-line +line-length185 test/metabolism.c

.in -5
.ad
.fi

If you find that you often use \fBindent\fR with the same options, you
may put those options into a file named \(oq.indent.pro\(cq.
.B indent\fR will look for a profile file in three places. First it will check
the environment variable \fBINDENT_PROFILE\fR. 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 \(oq.indent.pro\(cq in the current directory
 and use that if found.  Finally \fBindent\fR will search
your home directory for \(oq.indent.pro\(cq and use that file if it is
found.  This behaviour is different from that of other versions of
.B indent\fR, which load both files if they both exist.

The format of \(oq.indent.pro\(cq 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 \(oq.indent.pro\(cq may be surrounded by C
or C++ comments, in which case they are ignored.

Command line switches are handled \fIafter\fR processing
\(oq .indent.pro\(cq.  Options specified later override arguments
specified earlier, with one exception: Explicitly specified options
always override background options (See \fBCOMMON\ STYLES\fR).  You can
prevent \fBindent\fR from reading an \(oq.indent.pro\(cq file by
specifying the \(oq-npro\(cq option.

.SH "BACKUP FILES"

As of version 1.3, GNU \fBindent\fR makes GNU-style backup files, the
same way GNU Emacs does.  This means that either \fIsimple\fR or
.I numbered\fR 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 \(oq~\(cq (tilde).  Thus, the backup file for
\(oqpython.c\(cq would be \(oqpython.c~\(cq.

Instead of the default, you may specify any string as a suffix by
setting the environment variable \fBSIMPLE_BACKUP_SUFFIX\fR to
your preferred suffix.

Numbered backup versions of a file \(oqmomeraths.c\(cq look like
\(oqmomeraths.c.~23~\(cq, where 23 is the version of this particular
backup.  When making a numbered backup of the file \(oqsrc/momeraths.c\(cq,
the backup file will be named \(oqsrc/momeraths.c.~\fIV\fR~\(cq, where
.I V\fR is one greater than the highest version currently existing in
the directory \(oqsrc\(cq.  The environment variable \fBVERSION_WIDTH\fR
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 \(oqmomeraths.c.~04~\(cq.

The type of backup file made is controlled by the value of the
environment variable \fBVERSION_CONTROL\fR.  If it is the string
\(oqsimple\(cq, then only simple backups will be made.  If its value is
the string \(oqnumbered\(cq, then numbered backups will be made.  If its
value is \(oqnumbered-existing\(cq, then numbered backups will be made if
there \fIalready exist\fR numbered backups for the file being indented;
otherwise, a simple backup is made.  If \fBVERSION_CONTROL\fR is not
set, then \fBindent\fR assumes the behaviour of
\(oqnumbered-existing\(cq.

Other versions of \fBindent\fR use the suffix \(oq.BAK\(cq in naming
backup files.  This behaviour can be emulated by setting
.B SIMPLE_BACKUP_SUFFIX\fR to \(oq.BAK\(cq.

Note also that other versions of \fBindent\fR make backups in the
current directory, rather than in the directory of the source file as
GNU \fBindent\fR now does.

.SH "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 \fIbackground\fR option, which specifies a set
of values for all other options.  However, explicitly specified options
always override options implied by a background option.

As of version 1.2, the default style of GNU \fBindent\fR is the GNU
style.  Thus, it is no longer necessary to specify the option
\(oq-gnu\(cq to obtain this format, although doing so will not cause an
error.  Option settings which correspond to the GNU style are:

.in +5
.nf
.na
-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
.in -5
.ad
.fi

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 "The GNU Coding Standards", which
also covers semantic and portability issues such as memory usage, the
size of integers, etc.)

The Kernighan & Ritchie style is used throughout their well-known book
"The C Programming Language".  It is enabled with the \(oq-kr\(cq
option.  The Kernighan & Ritchie style corresponds to the following set
of options:

.in +5
.nf
.na
-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
.in -5
.ad
.fi

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 \fBindent\fR has arbitrarily
chosen column 33.

The style of the original Berkeley \fBindent\fR may be obtained by
specifying \(oq-orig\(cq (or by specifying \(oq--original\(cq, using the
long option name).  This style is equivalent to the following settings:

.in +5
.nf
.na
-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
.in -5
.ad
.fi

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:

.in +5
.nf
.na
-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
.in -5
.ad
.fi

.SH "BLANK LINES"

Various programming styles use blank lines in different places.
.B indent\fR has a number of options to insert or delete blank lines in
specific places.

The \(oq-bad\(cq option causes \fBindent\fR to force a blank line after
every block of declarations.  The \(oq-nbad\(cq option causes
.B indent\fR not to force such blank lines.

The \(oq-bap\(cq option forces a blank line after every procedure body.
The \(oq-nbap\(cq option forces no such blank line.

The \(oq-bbb\(cq option forces a blank line before every boxed comment
(See \fBCOMMENTS\fR.)
The \(oq-nbbb\(cq option does not force such blank lines.

The \(oq-sob\(cq option causes \fBindent\fR to swallow optional blank
lines (that is, any optional blank lines present in the input will be
removed from the output).  If the \(oq-nsob\(cq is specified, any blank
lines present in the input file will be copied to the output file.


.SH "--blank-lines-after-declarations"

The \(oq-bad\(cq option forces a blank line after every block of
declarations.  The \(oq-nbad\(cq option does not add any such blank
lines.

For example, given the input
.in +5
.nf
.na
char *foo;
char *bar;
/* This separates blocks of declarations.  */
int baz;
.in -5
.ad
.fi

.B indent -bad\fR produces

.in +5
.nf
.na
char *foo;
char *bar;

/* This separates blocks of declarations.  */
int baz;
.in -5
.ad
.fi

and \fBindent -nbad\fR produces

.in +5
.nf
.na
char *foo;
char *bar;
/* This separates blocks of declarations.  */
int baz;
.in -5
.ad
.fi

.SH "--blank-lines-after-procedures"

The \(oq-bap\(cq option forces a blank line after every procedure body.

For example, given the input

.in +5
.nf
.na
int
foo ()
{
  puts("Hi");
}
/* The procedure bar is even less interesting.  */
char *
bar ()
{
  puts("Hello");
}
.in -5
.ad
.fi

.B indent -bap\fR produces

.in +5
.nf
.na
int
foo ()
{
  puts ("Hi");
}

/* The procedure bar is even less interesting.  */
char *
bar ()
{
  puts ("Hello");
}
.in -5
.ad
.fi

and \fBindent -nbap\fR produces

.in +5
.nf
.na
int
foo ()
{
  puts ("Hi");
}
/* The procedure bar is even less interesting.  */
char *
bar ()
{
  puts ("Hello");
}
.in -5
.ad
.fi

No blank line will be added after the procedure \fBfoo\fR.

.SH "COMMENTS"

.B indent\fR formats both C and C++ comments. C comments are begun with
\(oq/*\(cq, terminated with \(oq*/\(cq and may contain newline characters.
C++ comments begin with the delimiter \(oq//\(cq and end at the newline.

.B indent\fR handles comments differently depending upon their context.
.B indent\fR 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).

.B indent\fR 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.

.B indent\fR attempts to leave \fIboxed comments\fR unmodified.  The
general idea of such a comment is that it is enclosed in a rectangle or
\(oq\(oqbox\(cq\(cq of stars or dashes to visually set it apart.  More precisely,
boxed comments are defined as those in which the initial \(oq/*\(cq is
followed immediately by the character \(oq*\(cq, \(oq=\(cq, \(oq_\(cq, or
\(oq-\(cq, or those in which the beginning comment delimiter (\(oq/*\(cq)
is on a line by itself, and the following line begins with a \(oq*\(cq in
the same column as the star of the opening delimiter.

Examples of boxed comments are:

.in +5
.nf
.na
/**********************
 * Comment in a box!! *
 **********************/

       /*
        * A different kind of scent,
        * for a different kind of comment.
        */
.in -5
.ad
.fi

.B indent\fR 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 \(oq-bbb\(cq option is specified, all such boxed comments will be
preceded by a blank line, unless such a comment is preceded by code.

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 \(oq-fca\(cq option.  To format those beginning in column one,
specify \(oq-fc1\(cq.  Such formatting is disabled by default.

The right margin for formatting defaults to 78, but may be changed with
the \(oq-lc\(cq 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.

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 \(oq-d\(cq
option, which specifies an amount by which such comments are moved to
the \fIleft\fR, or unindented.  For example, \(oq-d2\(cq 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 \(oq-fc1\(cq.

Comments to the right of code will appear by default in column 33.
This may be changed with one of three options.  \(oq-c\(cq will specify
the column for comments following code, \(oq-cd\(cq specifies the
column for comments following declarations, and \(oq-cp\(cq specifies
the column for comments following preprocessor directives \fB#else\fR
and \fB#endif\fR. \(oq-dj\(cq together with \(oq-cd0\(cq 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 \(oq-cd0\(cq
causes \(oq-c\(cq 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.

The \(oq-cdb\(cq option places the comment delimiters on blank lines.
Thus, a single line comment like \fB/* Loving hug */\fR can be
transformed into:

.in +5
.nf
.na
/*
   Loving hug
 */
.in -5
.ad
.fi

Stars can be placed at the beginning of multi-line comments with the
\(oq-sc\(cq option.  Thus, the single-line comment above can be
transformed (with \(oq-cdb -sc\(cq) into:

.in +5
.nf
.na
/*
 * Loving hug
 */
.in -5
.ad
.fi

.SH "STATEMENTS"

The \(oq-br\(cq or \(oq-bl\(cq option specifies how to format braces.

The \(oq-br\(cq option formats statement braces like this:

.in +5
.nf
.na
if (x > 0) {
  x--;
}
.in -5
.ad
.fi

The \(oq-bl\(cq option formats them like this:

.in +5
.nf
.na
if (x > 0)
  {
    x--;
  }
.in -5
.ad
.fi

If you use the \(oq-bl\(cq option, you may also want to specify the
\(oq-bli\(cq option.  This option specifies the number of spaces by
which braces are indented.  \(oq-bli2\(cq, the default, gives the
result shown above.  \(oq-bli0\(cq results in the following:

.in +5
.nf
.na
if (x > 0)
{
  x--;
}
.in -5
.ad
.fi

If you are using the \(oq-br\(cq option, you probably want to also use
the \(oq-ce\(cq option.  This causes the \fBelse\fR in an if-then-else
construct to cuddle up to the immediately preceding \(oq}\(cq.  For
example, with \(oq-br -ce\(cq you get the following:

.in +5
.nf
.na
if (x > 0) {
  x--;
} else {
  fprintf (stderr, "...something wrong?\\n");
}
.in -5
.ad
.fi

With \(oq-br -nce\(cq that code would appear as

.in +5
.nf
.na
if (x > 0) {
  x--;
}
else {
  fprintf (stderr, "...something wrong?\\n");
}
.in -5
.ad
.fi

This causes the \fBwhile\fR in a do-while
loop to cuddle up to the immediately preceding \(oq}\(cq.  For
example, with \(oq-cdw\(cq you get the following:

.in +5
.nf
.na
do {
  x--;
} while (x);
.in -5
.ad
.fi

With \(oq-ncdw\(cq that code would appear as

.in +5
.nf
.na
do {
  x--;
}
while (x);
.in -5
.ad
.fi

The \(oq-cli\(cq option specifies the number of spaces that case labels
should be indented to the right of the containing \fBswitch\fR
statement.

The default gives code like:

.in +5
.nf
.na
switch (i)
  {
  case 0:
    break;
  case 1:
    {
      ++i;
    }
  default:
    break;
  }
.in -5
.ad
.fi

Using the \(oq-cli2\(cq that would become:

.in +5
.nf
.na
switch (i)
  {
    case 0:
      break;
    case 1:
      {
        ++i;
      }
    default:
      break;
  }
.in -5
.ad
.fi

The indentation of the braces below a case statement can be
controlled with the \(oq-cbi\fIn\fR\(cq option.  For example,
using \(oq-cli2 -cbi0\(cq results in:

.in +5
.nf
.na
switch (i)
  {
    case 0:
      break;
    case 1:
    {
      ++i;
    }
    default:
      break;
  }
.in -5
.ad
.fi

If a semicolon is on the same line as a \fBfor\fR or \fBwhile\fR
statement, the \(oq-ss\(cq option will cause a space to be placed before
the semicolon.  This emphasizes the semicolon, making it clear that the
body of the \fBfor\fR or \fBwhile\fR statement is an empty statement.
\(oq-nss\(cq disables this feature.

The \(oq-pcs\(cq option causes a space to be placed between the name of
the procedure being called and the \(oq(\(cq (for example, \fBputs\ ("Hi");\fR.  The \(oq-npcs\(cq option would give \fBputs("Hi");\fR).


If the \(oq-cs\(cq option is specified, \fBindent\fR puts a space between
a cast operator and the object to be cast. The \(oq-ncs\(cq ensures that there 
is no space between the cast operator and the object. Remember that \fBindent\fR
only knows about the standard C data types and so cannot recognise user-defined types
in casts. Thus \fB(mytype)thing\fR is not treated as a cast.

The \(oq-bs\(cq option ensures that there is a space between the
keyword \fBsizeof\fR and its argument.  In some versions, this is
known as the \(oqBill_Shannon\(cq option.

The \(oq-saf\(cq option forces a space between a \fBfor\fR
and the following parenthesis.  This is the default.

The \(oq-sai\(cq option forces a space between a \fBif\fR
and the following parenthesis.  This is the default.

The \(oq-saw\(cq option forces a space between a \fBwhile\fR
and the following parenthesis.  This is the default.

The \(oq-prs\(cq option causes all parentheses to be separated with
a space from whatever is between them.  For example, using \(oq-prs\(cq
results in code like:

.in +5
.nf
.na
  while ( ( e_code - s_code ) < ( dec_ind - 1 ) )
    {
      set_buf_break ( bb_dec_ind );
      *e_code++ = \(cq \(cq;
    }
.in -5
.ad
.fi

.SH "DECLARATIONS"

By default \fBindent\fR will line up identifiers, in the column
specified by the \(oq-di\(cq option.  For example, \(oq-di16\(cq makes
things look like:

.in +5
.nf
.na
int             foo;
char           *bar;
.in -5
.ad
.fi

Using a small value (such as one or two) for the \(oq-di\(cq option can
be used to cause the identifiers to be placed in the first available
position; for example:

.in +5
.nf
.na
int foo;
char *bar;
.in -5
.ad
.fi

The value given to the \(oq-di\(cq option will still affect variables
which are put on separate lines from their types, for example
\(oq-di2\(cq will lead to:

.in +5
.nf
.na
int
  foo;
.in -5
.ad
.fi

If the \(oq-bc\(cq option is specified, a newline is forced after each
comma in a declaration.  For example,

.in +5
.nf
.na
int a,
  b,
  c;
.in -5
.ad
.fi

With the \(oq-nbc\(cq option this would look like

.in +5
.nf
.na
int a, b, c;
.in -5
.ad
.fi

The \(oq-bfda\(cq 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 \(oq-bfde\(cq causes a newline to be forced before the closing 
bracket of the function declaration. For both options the \(cqn\(cq setting is the default:
-nbdfa and -nbdfe.


For 
example,

.in +5
.nf
.na
void foo (int arg1, char arg2, int *arg3, long arg4, char arg5);
.in -5
.ad
.fi
With the \(oq-bfda\(cq option this would look like

.in +5
.nf
.na
void foo (
    int arg1,
    char arg2,
    int *arg3,
    long arg4,
    char arg5);
.in -5
.ad
.fi

With, in addition, the \(oq-bfde\(cq option this would look like

.in +5
.nf
.na
void foo (
    int arg1,
    char arg2,
    int *arg3,
    long arg4,
    char arg5
    );
.in -5
.ad
.fi

The \(oq-psl\(cq 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 \fBetags\fR program to work correctly, as well as some
of the \fBc-mode\fR functions of Emacs.

You must use the \(oq-T\(cq
option to tell \fBindent\fR the name of all the typenames in your
program that are defined by \fBtypedef\fR.  \(oq-T\(cq can be specified
more than once, and all names specified are used.  For example, if your
program contains

.in +5
.nf
.na
typedef unsigned long CODE_ADDR;
typedef enum {red, blue, green} COLOR;
.in -5
.ad
.fi

you would use the options \(oq-T CODE_ADDR -T COLOR\(cq.


The \(oq-brs\(cq or \(oq-bls\(cq option specifies how to format braces
in struct declarations.  The \(oq-brs\(cq option formats braces like
this:

.in +5
.nf
.na
struct foo {
  int x;
};
.in -5
.ad
.fi

The \(oq-bls\(cq option formats them like this:

.in +5
.nf
.na
struct foo
{
  int x;
};
.in -5
.ad
.fi


Similarly to the structure brace \(oq-brs\(cq and \(oq-bls\(cq options,
 the function brace options \(oq-brf\(cq or \(oq-blf\(cq specify how to format the braces
in function definitions.  The \(oq-brf\(cq option formats braces like
this:

.in +5
.nf
.na
int one(void) {
  return 1;
};
.in -5
.ad
.fi

The \(oq-blf\(cq option formats them like this:

.in +5
.nf
.na
int one(void)
{
  return 1;
};
.in -5
.ad
.fi

.SH "INDENTATION"

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 \fBif\fR or \fBfor\fR is encountered, the indentation level is
increased by the value specified by the \(oq-i\(cq option.  For example,
use \(oq-i8\(cq 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 \(oq-ci\(cq
option.  \(oq-ci\(cq defaults to 0.  However, if the \(oq-lp\(cq 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 \(oq[\(cq and applies to \(oq{\(cq when it occurs in initialization
lists.  For example, a piece of continued code might look like this with
\(oq-nlp -ci3\(cq in effect:

.in +5
.nf
.na
  p1 = first_procedure (second_procedure (p2, p3),
     third_procedure (p4, p5));
.in -5
.ad
.fi

With \(oq-lp\(cq in effect the code looks somewhat clearer:

.in +5
.nf
.na
  p1 = first_procedure (second_procedure (p2, p3),
                        third_procedure (p4, p5));
.in -5
.ad
.fi

When a statement is broken in between two or more paren pairs (...),
each extra pair causes the indentation level extra indentation:

.in +5
.nf
.na
if ((((i < 2 &&
        k > 0) || p == 0) &&
    q == 1) ||
  n = 0)
.in -5
.ad
.fi

The option \(oq-ip\fIN\fR\(cq can be used to set the extra offset per paren.
For instance, \(oq-ip0\(cq would format the above as:

.in +5
.nf
.na
if ((((i < 2 &&
  k > 0) || p == 0) &&
  q == 1) ||
  n = 0)
.in -5
.ad
.fi

.B indent\fR 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 \(oq-ts\(cq
option.  Tabs are treated as the equivalent number of spaces.

The indentation of type declarations in old-style function definitions
is controlled by the \(oq-ip\(cq parameter.  This is a numeric parameter
specifying how many spaces to indent type declarations.  For example,
the default \(oq-ip5\(cq makes definitions look like this:

.in +5
.nf
.na
char *
create_world (x, y, scale)
     int x;
     int y;
     float scale;
{
  . . .
}
.in -5
.ad
.fi

For compatibility with other versions of indent, the option \(oq-nip\(cq
is provided, which is equivalent to \(oq-ip0\(cq.

ANSI C allows white space to be placed on preprocessor command lines
between the character \(oq#\(cq and the command name.  By default,
.B indent\fR removes this space, but specifying the \(oq-lps\(cq option
directs \fBindent\fR to leave this space unmodified. The option \(oq-ppi\(cq 
overrides  \(oq-nlps\(cq and  \(oq-lps\(cq.

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 \(oq-ppi 3\(cq

.in +5
.nf
.na
#if X
#if Y
#define Z 1
#else
#define Z 0
#endif
#endif
.in -5
.ad
.fi
becomes
.in +5
.nf
.na
#if X
#   if Y
#      define Z 1
#   else
#      define Z 0
#   endif
#endif
.in -5
.ad
.fi

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
\(oq-cli\(cq parameter for that. For example with the option \(oq-il 1\(cq

.in +5
.nf
.na
group
function()
{
    if (do_stuff1() == ERROR)
        goto cleanup1;

    if (do_stuff2() == ERROR)
        goto cleanup2;

    return SUCCESS;

  cleanup2:
    do_cleanup2();

  cleanup1:
    do_cleanup1();

    return ERROR;
}
.in -5
.ad
.fi
becomes
.in +5
.nf
.na
group
function()
{
    if (do_stuff1() == ERROR)
        goto cleanup1;

    if (do_stuff2() == ERROR)
        goto cleanup2;

    return SUCCESS;

 cleanup2:
    do_cleanup2();

 cleanup1:
    do_cleanup1();

    return ERROR;
}
.in -5
.ad
.fi

.SH "BREAKING LONG LINES"

With the option \(oq-l\fIn\fR\(cq, or \(oq--line-length\fIn\fR\(cq, 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 \fBindent\fR
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.

Currently there are two options that allow one to interfere with the
algorithm that determines where to break a line.

The \(oq-bbo\(cq option causes GNU \fBindent\fR to prefer to break
long lines before the boolean operators \fB&&\fR and \fB||\fR.  The
\(oq-nbbo\(cq option causes GNU \fBindent\fR not have that
preference.  For example, the default option \(oq-bbo\(cq (together
with \(oq--line-length60\(cq and \(oq--ignore-newlines\(cq) makes code
look like this:

.in +5
.nf
.na
  if (mask
      && ((mask[0] == \(cq\\0\(cq)
          || (mask[1] == \(cq\\0\(cq
              && ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq)))))
.in -5
.ad
.fi

Using the option \(oq-nbbo\(cq will make it look like this:

.in +5
.nf
.na
  if (mask &&
      ((mask[0] == \(cq\\0\(cq) ||
       (mask[1] == \(cq\\0\(cq &&
        ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq)))))
.in -5
.ad
.fi

The default \(oq-hnl\(cq, 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:

.in +5
.nf
.na
  if (mask
      && ((mask[0] == \(cq\\0\(cq)
      || (mask[1] == \(cq\\0\(cq && ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq)))))
.in -5
.ad
.fi

then using the option \(oq-hnl\(cq, or \(oq--honour-newlines\(cq,
together with the previously mentioned \(oq-nbbo\(cq and
\(oq--line-length60\(cq, 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:

.in +5
.nf
.na
  if (mask
      && ((mask[0] == \(cq\\0\(cq)
          || (mask[1] == \(cq\\0\(cq &&
              ((mask[0] == \(cq0\(cq) || (mask[0] == \(cq*\(cq)))))
.in -5
.ad
.fi

The idea behind this option is that lines which are too long, but are already
broken up, will not be touched by GNU \fBindent\fR.  Really messy code
should be run through \fBindent\fR at least once using the
\(oq--ignore-newlines\(cq option though.

.SH "DISABLING FORMATTING"

Formatting of C code may be disabled for portions of a program by
embedding special \fIcontrol comments\fR in the program.  To turn off
formatting for a section of a program, place the disabling control
comment \fB/* *INDENT-OFF* */\fR 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 \fB/* *INDENT-ON* */\fR, 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, \fBindent\fR does not attempt to verify the closing
delimiter (\fB*/\fR) for these C comments, and any whitespace on the
line is totally transparent.

These control comments also function in their C++ formats, namely
.B // *INDENT-OFF*\fR and \fB// *INDENT-ON*\fR.

It should be noted that the internal state of \fBindent\fR 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 \fBindent\fR produced
error messages beginning with \fB*INDENT**\fR.  These versions of
.B indent\fR were written to ignore any input text lines which began
with such error messages.  I have removed this incestuous feature from
GNU \fBindent\fR.

.SH "MISCELLANEOUS OPTIONS"

To find out what version of \fBindent\fR you have, use the command
.B indent -version\fR.  This will report the version number of
.B indent\fR, without doing any of the normal processing.

The \(oq-v\(cq option can be used to turn on verbose mode.  When in
verbose mode, \fBindent\fR reports when it splits one line of input
into two more more lines of output, and gives some size statistics at
completion. 

The \(oq-pmt\(cq option causes \fBindent\fR 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\(cqt cause \fBmake\fR to rebuild all targets.
This option is only available on Operating Systems that have the
POSIX \fButime(2)\fR function.

.SH "BUGS"

Please report any bugs to bug-indent@gnu.org.

When \fBindent\fR is run twice on a file, with the same profile,
it should \fInever\fR change that file the second time.  With the
current design of \fBindent\fR, this can not be guaranteed,
and it has not been extensively tested.

.B indent\fR does not understand C.  In some cases this leads to
the inability to join lines.  The result is that running a file
through \fBindent\fR is \fIirreversible\fR, even if the used input
file was the result of running \fBindent\fR with a given profile
(\(oq.indent.pro\(cq).

While an attempt was made to get \fBindent\fR working for C++, it
will not do a good job on any C++ source except the very simplest.

.B indent\fR does not look at the given \(oq--line-length\(cq option
when writing comments to the output file.  This results often in comments
being put far to the right.  In order to prohibit \fBindent\fR 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.

.B indent\fR does not count lines and comments (see the \(oq-v\(cq
option) when \fBindent\fR is turned off with 
.B /* *INDENT-OFF* */\fR.

Comments of the form \fB/*UPPERCASE*/\fR 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.

.SH "COPYRIGHT"

The following copyright notice applies to the \fBindent\fR program.
The copyright and copying permissions for this manual appear near the
beginning of \(oqindent.texinfo\(cq and \(oqindent.info\(cq, and near the
end of \(oqindent.1\(cq.

.nf
.na
Copyright (c) 2001 David Ingamells.
Copyright (c) 1999 Carlo Wood.
Copyright (c) 1995, 1996 Joseph Arceneaux.
Copyright (c) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation
Copyright (c) 1985 Sun Microsystems, Inc.
Copyright (c) 1980 The Regents of the University of California.
Copyright (c) 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 \(oq\(oqAS IS\(cq\(cq AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
.ad
.fi

.SH "Options\(cq Cross Key"

Here is a list of options alphabetized by long option, to help you find
the corresponding short option.


.in +5
.nf
.na
--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\fIn\fR     
--case-brace-indentation                        -cbi\fIn\fR
--comment-delimiters-on-blank-lines             -cdb            
--comment-indentation                           -c\fIn\fR       
--continuation-indentation                      -ci\fIn\fR      
--continue-at-parentheses                       -lp             
--cuddle-do-while                               -cdw
--cuddle-else                                   -ce             
--declaration-comment-column                    -cd\fIn\fR      
--declaration-indentation                       -di\fIn\fR      
--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\fIn\fR
--format-all-comments                           -fca            
--format-first-column-comments                  -fc1            
--gnu-style                                     -gnu            
--honour-newlines                               -hnl
--ignore-newlines                               -nhnl
--ignore-profile                                -npro           
--indent-label                                  -il\fIn\fR       
--indent-level                                  -i\fIn\fR       
--k-and-r-style                                 -kr             
--leave-optional-blank-lines                    -nsob           
--leave-preprocessor-space                      -lps
--left-justify-declarations                     -dj 
--line-comments-indentation                     -d\fIn\fR       
--line-length                                   -l\fIn\fR       
--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\fIn\fR      
--paren-indentation                             -pi\fIn\fR
--preserve-mtime				-pmt
--preprocessor-indentation                      -ppi\fIn\fR
--procnames-start-lines                         -psl            
--remove-preprocessor-space                     -nlps
--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\fIn\fR
--swallow-optional-blank-lines                  -sob            
--tab-size                                      -ts\fIn\fR      
--use-tabs                                      -ut
--verbose                                       -v              
.in -5
.ad
.fi

.SH "RETURN VALUE"
Unknown
.SH FILES
.br
.nf
.\" set tabstop to longest possible filename, plus a wee bit
.ta \w'$HOME/.indent.pro   'u
\fI$HOME/.indent.pro\fR	holds default options for indent.
.SH "AUTHORS"
.br
Carlo Wood
.br
Joseph Arceneaux
.br
Jim Kingdon
.br
David Ingamells
.SH "HISTORY"
Derived from the UCB program "indent".
.SH "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.