comparison doc/standards.texi @ 5301:7ba7e591498e

update
author Karl Berry <karl@freefriends.org>
date Sun, 03 Oct 2004 13:04:51 +0000
parents 93b3f9c4c71e
children 5fe0551f4ec2
comparison
equal deleted inserted replaced
5300:49b2d6023fcb 5301:7ba7e591498e
1 \input texinfo @c -*-texinfo-*- 1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header 2 @c %**start of header
3 @setfilename standards.info 3 @setfilename standards.info
4 @settitle GNU Coding Standards 4 @settitle GNU Coding Standards
5 @c This date is automagically updated when you save this file: 5 @c This date is automagically updated when you save this file:
6 @set lastupdate February 20, 2004 6 @set lastupdate October 1, 2004
7 @c %**end of header 7 @c %**end of header
8 8
9 @dircategory GNU organization 9 @dircategory GNU organization
10 @direntry 10 @direntry
11 * Standards: (standards). GNU coding standards. 11 * Standards: (standards). GNU coding standards.
92 92
93 @cindex where to obtain @code{standards.texi} 93 @cindex where to obtain @code{standards.texi}
94 @cindex downloading this manual 94 @cindex downloading this manual
95 If you did not obtain this file directly from the GNU project and 95 If you did not obtain this file directly from the GNU project and
96 recently, please check for a newer version. You can get the GNU 96 recently, please check for a newer version. You can get the GNU
97 Coding Standards from the GNU World Wide Web server host in several 97 Coding Standards from the GNU web server in many
98 different formats: @uref{http://www.gnu.org/prep/standards.text}, 98 different formats, including the Texinfo source, PDF, HTML, DVI, plain
99 @uref{http://www.gnu.org/prep/standards.info}, and 99 text, and more, at: @uref{http://www.gnu.org/prep/standards/}.
100 @uref{http://www.gnu.org/prep/standards.dvi}, as well as the
101 Texinfo ``source'' which is divided in two files:
102 @uref{http://www.gnu.org/prep/standards.texi} and
103 @uref{http://www.gnu.org/prep/make-stds.texi}. The GNU Coding
104 Standards are also available in HTML format starting at
105 @uref{http://www.gnu.org/prep/standards_toc.html}.
106 100
107 Corrections or suggestions for this document should be sent to 101 Corrections or suggestions for this document should be sent to
108 @email{bug-standards@@gnu.org}. If you make a suggestion, please include a 102 @email{bug-standards@@gnu.org}. If you make a suggestion, please include a
109 suggested new wording for it; our time is limited. We prefer a context 103 suggested new wording for it; our time is limited. We prefer a context
110 diff to the @file{standards.texi} or @file{make-stds.texi} files, but if 104 diff to the @file{standards.texi} or @file{make-stds.texi} files, but if
128 122
129 @node Legal Issues 123 @node Legal Issues
130 @chapter Keeping Free Software Free 124 @chapter Keeping Free Software Free
131 @cindex legal aspects 125 @cindex legal aspects
132 126
133 This @value{CHAPTER} discusses how you can make sure that GNU software 127 This chapter discusses how you can make sure that GNU software
134 avoids legal difficulties, and other related issues. 128 avoids legal difficulties, and other related issues.
135 129
136 @menu 130 @menu
137 * Reading Non-Free Code:: Referring to Proprietary Programs 131 * Reading Non-Free Code:: Referring to Proprietary Programs
138 * Contributions:: Accepting Contributions 132 * Contributions:: Accepting Contributions
206 You might have to take that code out again! 200 You might have to take that code out again!
207 201
208 You don't need papers for changes of a few lines here or there, since 202 You don't need papers for changes of a few lines here or there, since
209 they are not significant for copyright purposes. Also, you don't need 203 they are not significant for copyright purposes. Also, you don't need
210 papers if all you get from the suggestion is some ideas, not actual code 204 papers if all you get from the suggestion is some ideas, not actual code
211 which you use. For example, if someone send you one implementation, but 205 which you use. For example, if someone sent you one implementation, but
212 you write a different implementation of the same idea, you don't need to 206 you write a different implementation of the same idea, you don't need to
213 get papers. 207 get papers.
214 208
215 The very worst thing is if you forget to tell us about the other 209 The very worst thing is if you forget to tell us about the other
216 contributor. We could be very embarrassed in court some day as a 210 contributor. We could be very embarrassed in court some day as a
217 result. 211 result.
218 212
219 We have more detailed advice for maintainers of programs; if you have 213 We have more detailed advice for maintainers of programs; if you have
220 reached the stage of actually maintaining a program for GNU (whether 214 reached the stage of actually maintaining a program for GNU (whether
221 released or not), please ask us for a copy. 215 released or not), please ask us for a copy. It is also available
216 online for your perusal: @uref{http://www.gnu.org/prep/maintain/}.
222 217
223 @node Trademarks 218 @node Trademarks
224 @section Trademarks 219 @section Trademarks
225 @cindex trademarks 220 @cindex trademarks
226 221
253 248
254 @node Design Advice 249 @node Design Advice
255 @chapter General Program Design 250 @chapter General Program Design
256 @cindex program design 251 @cindex program design
257 252
258 This @value{CHAPTER} discusses some of the issues you should take into 253 This chapter discusses some of the issues you should take into
259 account when designing your program. 254 account when designing your program.
260 255
261 @c Standard or ANSI C 256 @c Standard or ANSI C
262 @c 257 @c
263 @c In 1989 the American National Standards Institute (ANSI) standardized 258 @c In 1989 the American National Standards Institute (ANSI) standardized
516 @end smallexample 511 @end smallexample
517 512
518 @node Program Behavior 513 @node Program Behavior
519 @chapter Program Behavior for All Programs 514 @chapter Program Behavior for All Programs
520 515
521 This @value{CHAPTER} describes conventions for writing robust 516 This chapter describes conventions for writing robust
522 software. It also describes general standards for error messages, the 517 software. It also describes general standards for error messages, the
523 command line interface, and how libraries should behave. 518 command line interface, and how libraries should behave.
524 519
525 @menu 520 @menu
526 * Semantics:: Writing robust programs 521 * Semantics:: Writing robust programs
2135 directory. 2130 directory.
2136 2131
2137 @node Writing C 2132 @node Writing C
2138 @chapter Making The Best Use of C 2133 @chapter Making The Best Use of C
2139 2134
2140 This @value{CHAPTER} provides advice on how best to use the C language 2135 This chapter provides advice on how best to use the C language
2141 when writing GNU software. 2136 when writing GNU software.
2142 2137
2143 @menu 2138 @menu
2144 * Formatting:: Formatting Your Source Code 2139 * Formatting:: Formatting Your Source Code
2145 * Comments:: Commenting Your Work 2140 * Comments:: Commenting Your Work
3141 3136
3142 Each program documented in the manual should have a node named 3137 Each program documented in the manual should have a node named
3143 @samp{@var{program} Invocation} or @samp{Invoking @var{program}}. This 3138 @samp{@var{program} Invocation} or @samp{Invoking @var{program}}. This
3144 node (together with its subnodes, if any) should describe the program's 3139 node (together with its subnodes, if any) should describe the program's
3145 command line arguments and how to run it (the sort of information people 3140 command line arguments and how to run it (the sort of information people
3146 would look in a man page for). Start with an @samp{@@example} 3141 would look for in a man page). Start with an @samp{@@example}
3147 containing a template for all the options and arguments that the program 3142 containing a template for all the options and arguments that the program
3148 uses. 3143 uses.
3149 3144
3150 Alternatively, put a menu item in some menu whose item name fits one of 3145 Alternatively, put a menu item in some menu whose item name fits one of
3151 the above patterns. This identifies the node which that item points to 3146 the above patterns. This identifies the node which that item points to
3466 discrepancies are small enough that the man page remains useful without 3461 discrepancies are small enough that the man page remains useful without
3467 updating. If so, put a prominent note near the beginning of the man 3462 updating. If so, put a prominent note near the beginning of the man
3468 page explaining that you don't maintain it and that the Texinfo manual 3463 page explaining that you don't maintain it and that the Texinfo manual
3469 is more authoritative. The note should say how to access the Texinfo 3464 is more authoritative. The note should say how to access the Texinfo
3470 documentation. 3465 documentation.
3466
3467 Finally, the GNU help2man program
3468 (@uref{http://www.gnu.org/software/help2man/}) is one way to automate
3469 generation of a man page, in this case from @option{--help} output.
3470 This is sufficient in many cases.
3471 3471
3472 @node Reading other Manuals 3472 @node Reading other Manuals
3473 @section Reading other Manuals 3473 @section Reading other Manuals
3474 3474
3475 There may be non-free books or documentation files that describe the 3475 There may be non-free books or documentation files that describe the