In [1]:
from random import randint
In [2]:
from collections import namedtuple
In [3]:
data = [randint(-10,10) for _ in range(10)]; print(data)
[9, 0, 1, -7, -4, 1, 8, -9, 0, 4]
In [4]:
f1=filter(lambda x:x>=0,data); print(*f1)
9 0 1 1 8 0 4
In [5]:
%timeit f1
The slowest run took 103.16 times longer than the fastest. This could mean that an intermediate result is being cached.
100000000 loops, best of 3: 19.6 ns per loop
In [6]:
f2=[x for x in data if x>=0]; print(f2)
[9, 0, 1, 1, 8, 0, 4]
In [7]:
%timeit f2
The slowest run took 84.14 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 24.4 ns per loop
In [8]:
d = {x:randint(60,100) for x in range(20)}
In [9]:
d_ans={k:v for k,v in d.items() if v>90}; print(d_ans)
{11: 94, 1: 93, 3: 99, 12: 94, 14: 92}
In [10]:
s=set(data);print(s)
{0, 1, 4, 8, 9, -9, -7, -4}
In [11]:
s_ans={x for x in s if x%3==0}; print(s_ans)
{0, 9, -9}
In [23]:
data=[randint(0,20) for _ in range(20)]
In [24]:
data
Out[24]:
[13, 0, 20, 16, 7, 8, 7, 2, 8, 16, 17, 11, 9, 5, 6, 15, 13, 20, 15, 11]
In [25]:
c=dict.fromkeys(data,0)
In [26]:
c
Out[26]:
{0: 0,
2: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
11: 0,
13: 0,
15: 0,
16: 0,
17: 0,
20: 0}
In [27]:
for x in data:
c[x] += 1
In [28]:
c
Out[28]:
{0: 1,
2: 1,
5: 1,
6: 1,
7: 2,
8: 2,
9: 1,
11: 2,
13: 2,
15: 2,
16: 2,
17: 1,
20: 2}
In [29]:
from operator import itemgetter
In [40]:
sorted(c.items(),key=itemgetter(1))
Out[40]:
[(0, 1),
(2, 1),
(5, 1),
(6, 1),
(9, 1),
(17, 1),
(7, 2),
(8, 2),
(11, 2),
(13, 2),
(15, 2),
(16, 2),
(20, 2)]
In [41]:
from collections import Counter
In [42]:
data
Out[42]:
[13, 0, 20, 16, 7, 8, 7, 2, 8, 16, 17, 11, 9, 5, 6, 15, 13, 20, 15, 11]
In [43]:
c2=Counter(data)
In [44]:
c2
Out[44]:
Counter({0: 1,
2: 1,
5: 1,
6: 1,
7: 2,
8: 2,
9: 1,
11: 2,
13: 2,
15: 2,
16: 2,
17: 1,
20: 2})
In [45]:
c2[7]
Out[45]:
2
In [46]:
c2[9]
Out[46]:
1
In [48]:
c2.most_common()
Out[48]:
[(7, 2),
(8, 2),
(11, 2),
(13, 2),
(15, 2),
(16, 2),
(20, 2),
(0, 1),
(2, 1),
(5, 1),
(6, 1),
(9, 1),
(17, 1)]
In [51]:
txt=open('standards.txt').read()
In [52]:
txt
Out[52]:
'GNU Coding Standards\n1 About the GNU Coding Standards\n2 Keeping Free Software Free\n 2.1 Referring to Proprietary Programs\n 2.2 Accepting Contributions\n 2.3 Trademarks\n3 General Program Design\n 3.1 Which Languages to Use\n 3.2 Compatibility with Other Implementations\n 3.3 Using Non-standard Features\n 3.4 Standard C and Pre-Standard C\n 3.5 Conditional Compilation\n4 Program Behavior for All Programs\n 4.1 Non-GNU Standards\n 4.2 Writing Robust Programs\n 4.3 Library Behavior\n 4.4 Formatting Error Messages\n 4.5 Standards for Interfaces Generally\n 4.6 Standards for Graphical Interfaces\n 4.7 Standards for Command Line Interfaces\n 4.7.1 \'--version\'\n 4.7.2 \'--help\'\n 4.8 Standards for Dynamic Plug-in Interfaces\n 4.9 Table of Long Options\n 4.10 OID Allocations\n 4.11 Memory Usage\n 4.12 File Usage\n5 Making The Best Use of C\n 5.1 Formatting Your Source Code\n 5.2 Commenting Your Work\n 5.3 Clean Use of C Constructs\n 5.4 Naming Variables, Functions, and Files\n 5.5 Portability between System Types\n 5.6 Portability between CPUs\n 5.7 Calling System Functions\n 5.8 Internationalization\n 5.9 Character Set\n 5.10 Quote Characters\n 5.11 Mmap\n6 Documenting Programs\n 6.1 GNU Manuals\n 6.2 Doc Strings and Manuals\n 6.3 Manual Structure Details\n 6.4 License for Manuals\n 6.5 Manual Credits\n 6.6 Printed Manuals\n 6.7 The NEWS File\n 6.8 Change Logs\n 6.8.1 Change Log Concepts\n 6.8.2 Style of Change Logs\n 6.8.3 Simple Changes\n 6.8.4 Conditional Changes\n 6.8.5 Indicating the Part Changed\n 6.9 Man Pages\n 6.10 Reading other Manuals\n7 The Release Process\n 7.1 How Configuration Should Work\n 7.2 Makefile Conventions\n 7.2.1 General Conventions for Makefiles\n 7.2.2 Utilities in Makefiles\n 7.2.3 Variables for Specifying Commands\n 7.2.4 \'DESTDIR\': Support for Staged Installs\n 7.2.5 Variables for Installation Directories\n 7.2.6 Standard Targets for Users\n 7.2.7 Install Command Categories\n 7.3 Making Releases\n8 References to Non-Free Software and Documentation\nAppendix A GNU Free Documentation License\nIndex\nGNU Coding Standards\n********************\n\nThe GNU coding standards, last updated July 25, 2016.\n\n Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,\n2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,\n2013, 2014, 2015, 2016 Free Software Foundation, Inc.\n\n Permission is granted to copy, distribute and/or modify this document\nunder the terms of the GNU Free Documentation License, Version 1.3 or\nany later version published by the Free Software Foundation; with no\nInvariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A\ncopy of the license is included in the section entitled "GNU Free\nDocumentation License".\n\n1 About the GNU Coding Standards\n********************************\n\nThe GNU Coding Standards were written by Richard Stallman and other GNU\nProject volunteers. Their purpose is to make the GNU system clean,\nconsistent, and easy to install. This document can also be read as a\nguide to writing portable, robust and reliable programs. It focuses on\nprograms written in C, but many of the rules and principles are useful\neven if you write in another programming language. The rules often\nstate reasons for writing in a certain way.\n\n If you did not obtain this file directly from the GNU project and\nrecently, please check for a newer version. You can get the GNU Coding\nStandards from the GNU web server in many different formats, including\nthe Texinfo source, PDF, HTML, DVI, plain text, and more, at:\n<http://www.gnu.org/prep/standards/>.\n\n If you are maintaining an official GNU package, in addition to this\ndocument, please read and follow the GNU maintainer information (*note\nContents: (maintain)Top.).\n\n If you want to receive diffs for every change to these GNU documents,\njoin the mailing list \'gnustandards-commit@gnu.org\', via the web\ninterface at\n<http://lists.gnu.org/mailman/listinfo/gnustandards-commit>. Archives\nare also available there.\n\n Please send corrections or suggestions for this document to\n<bug-standards@gnu.org>. If you make a suggestion, please include a\nsuggested new wording for it, to help us consider the suggestion\nefficiently. We prefer a context diff to the Texinfo source, but if\nthat\'s difficult for you, you can make a context diff for some other\nversion of this document, or propose it in any way that makes it clear.\nThe source repository for this document can be found at\n<http://savannah.gnu.org/projects/gnustandards>.\n\n These standards cover the minimum of what is important when writing a\nGNU package. Likely, the need for additional standards will come up.\nSometimes, you might suggest that such standards be added to this\ndocument. If you think your standards would be generally useful, please\ndo suggest them.\n\n You should also set standards for your package on many questions not\naddressed or not firmly specified here. The most important point is to\nbe self-consistent--try to stick to the conventions you pick, and try to\ndocument them as much as possible. That way, your program will be more\nmaintainable by others.\n\n The GNU Hello program serves as an example of how to follow the GNU\ncoding standards for a trivial program.\n<http://www.gnu.org/software/hello/hello.html>.\n\n This release of the GNU Coding Standards was last updated July 25,\n2016.\n\n2 Keeping Free Software Free\n****************************\n\nThis chapter discusses how you can make sure that GNU software avoids\nlegal difficulties, and other related issues.\n\n2.1 Referring to Proprietary Programs\n=====================================\n\nDon\'t in any circumstances refer to Unix source code for or during your\nwork on GNU! (Or to any other proprietary programs.)\n\n If you have a vague recollection of the internals of a Unix program,\nthis does not absolutely mean you can\'t write an imitation of it, but do\ntry to organize the imitation internally along different lines, because\nthis is likely to make the details of the Unix version irrelevant and\ndissimilar to your results.\n\n For example, Unix utilities were generally optimized to minimize\nmemory use; if you go for speed instead, your program will be very\ndifferent. You could keep the entire input file in memory and scan it\nthere instead of using stdio. Use a smarter algorithm discovered more\nrecently than the Unix program. Eliminate use of temporary files. Do\nit in one pass instead of two (we did this in the assembler).\n\n Or, on the contrary, emphasize simplicity instead of speed. For some\napplications, the speed of today\'s computers makes simpler algorithms\nadequate.\n\n Or go for generality. For example, Unix programs often have static\ntables or fixed-size strings, which make for arbitrary limits; use\ndynamic allocation instead. Make sure your program handles NULs and\nother funny characters in the input files. Add a programming language\nfor extensibility and write part of the program in that language.\n\n Or turn some parts of the program into independently usable\nlibraries. Or use a simple garbage collector instead of tracking\nprecisely when to free memory, or use a new GNU facility such as\nobstacks.\n\n2.2 Accepting Contributions\n===========================\n\nIf the program you are working on is copyrighted by the Free Software\nFoundation, then when someone else sends you a piece of code to add to\nthe program, we need legal papers to use it--just as we asked you to\nsign papers initially. _Each_ person who makes a nontrivial\ncontribution to a program must sign some sort of legal papers in order\nfor us to have clear title to the program; the main author alone is not\nenough.\n\n So, before adding in any contributions from other people, please tell\nus, so we can arrange to get the papers. Then wait until we tell you\nthat we have received the signed papers, before you actually use the\ncontribution.\n\n This applies both before you release the program and afterward. If\nyou receive diffs to fix a bug, and they make significant changes, we\nneed legal papers for that change.\n\n This also applies to comments and documentation files. For copyright\nlaw, comments and code are just text. Copyright applies to all kinds of\ntext, so we need legal papers for all kinds.\n\n We know it is frustrating to ask for legal papers; it\'s frustrating\nfor us as well. But if you don\'t wait, you are going out on a limb--for\nexample, what if the contributor\'s employer won\'t sign a disclaimer?\nYou might have to take that code out again!\n\n You don\'t need papers for changes of a few lines here or there, since\nthey are not significant for copyright purposes. Also, you don\'t need\npapers if all you get from the suggestion is some ideas, not actual code\nwhich you use. For example, if someone sent you one implementation, but\nyou write a different implementation of the same idea, you don\'t need to\nget papers.\n\n The very worst thing is if you forget to tell us about the other\ncontributor. We could be very embarrassed in court some day as a\nresult.\n\n We have more detailed advice for maintainers of GNU packages. If you\nhave reached the stage of maintaining a GNU program (whether released or\nnot), please take a look: *note (maintain)Legal Matters::.\n\n2.3 Trademarks\n==============\n\nPlease do not include any trademark acknowledgements in GNU software\npackages or documentation.\n\n Trademark acknowledgements are the statements that such-and-such is a\ntrademark of so-and-so. The GNU Project has no objection to the basic\nidea of trademarks, but these acknowledgements feel like kowtowing, and\nthere is no legal requirement for them, so we don\'t use them.\n\n What is legally required, as regards other people\'s trademarks, is to\navoid using them in ways which a reader might reasonably understand as\nnaming or labeling our own programs or activities. For example, since\n"Objective C" is (or at least was) a trademark, we made sure to say that\nwe provide a "compiler for the Objective C language" rather than an\n"Objective C compiler". The latter would have been meant as a shorter\nway of saying the former, but it does not explicitly state the\nrelationship, so it could be misinterpreted as using "Objective C" as a\nlabel for the compiler rather than for the language.\n\n Please don\'t use "win" as an abbreviation for Microsoft Windows in\nGNU software or documentation. In hacker terminology, calling something\na "win" is a form of praise. If you wish to praise Microsoft Windows\nwhen speaking on your own, by all means do so, but not in GNU software.\nUsually we write the name "Windows" in full, but when brevity is very\nimportant (as in file names and sometimes symbol names), we abbreviate\nit to "w". For instance, the files and functions in Emacs that deal\nwith Windows start with \'w32\'.\n\n3 General Program Design\n************************\n\nThis chapter discusses some of the issues you should take into account\nwhen designing your program.\n\n3.1 Which Languages to Use\n==========================\n\nWhen you want to use a language that gets compiled and runs at high\nspeed, the best language to use is C. C++ is ok too, but please don\'t\nmake heavy use of templates. So is Java, if you compile it.\n\n When highest efficiency is not required, other languages commonly\nused in the free software community, such as Lisp, Scheme, Python, Ruby,\nand Java, are OK too. Scheme, as implemented by GNU Guile, plays a\nparticular role in the GNU System: it is the preferred language to\nextend programs written in C/C++, and also a fine language for a wide\nrange of applications. The more GNU components use Guile and Scheme,\nthe more users are able to extend and combine them (*note (guile)The\nEmacs Thesis::).\n\n Many programs are designed to be extensible: they include an\ninterpreter for a language that is higher level than C. Often much of\nthe program is written in that language, too. The Emacs editor\npioneered this technique.\n\n The standard extensibility interpreter for GNU software is Guile\n(<http://www.gnu.org/software/guile/>), which implements the language\nScheme (an especially clean and simple dialect of Lisp). Guile also\nincludes bindings for GTK+/GNOME, making it practical to write modern\nGUI functionality within Guile. We don\'t reject programs written in\nother "scripting languages" such as Perl and Python, but using Guile is\nthe path that will lead to overall consistency of the GNU system.\n\n3.2 Compatibility with Other Implementations\n============================================\n\nWith occasional exceptions, utility programs and libraries for GNU\nshould be upward compatible with those in Berkeley Unix, and upward\ncompatible with Standard C if Standard C specifies their behavior, and\nupward compatible with POSIX if POSIX specifies their behavior.\n\n When these standards conflict, it is useful to offer compatibility\nmodes for each of them.\n\n Standard C and POSIX prohibit many kinds of extensions. Feel free to\nmake the extensions anyway, and include a \'--ansi\', \'--posix\', or\n\'--compatible\' option to turn them off. However, if the extension has a\nsignificant chance of breaking any real programs or scripts, then it is\nnot really upward compatible. So you should try to redesign its\ninterface to make it upward compatible.\n\n Many GNU programs suppress extensions that conflict with POSIX if the\nenvironment variable \'POSIXLY_CORRECT\' is defined (even if it is defined\nwith a null value). Please make your program recognize this variable if\nappropriate.\n\n When a feature is used only by users (not by programs or command\nfiles), and it is done poorly in Unix, feel free to replace it\ncompletely with something totally different and better. (For example,\n\'vi\' is replaced with Emacs.) But it is nice to offer a compatible\nfeature as well. (There is a free \'vi\' clone, so we offer it.)\n\n Additional useful features are welcome regardless of whether there is\nany precedent for them.\n\n3.3 Using Non-standard Features\n===============================\n\nMany GNU facilities that already exist support a number of convenient\nextensions over the comparable Unix facilities. Whether to use these\nextensions in implementing your program is a difficult question.\n\n On the one hand, using the extensions can make a cleaner program. On\nthe other hand, people will not be able to build the program unless the\nother GNU tools are available. This might cause the program to work on\nfewer kinds of machines.\n\n With some extensions, it might be easy to provide both alternatives.\nFor example, you can define functions with a "keyword" \'INLINE\' and\ndefine that as a macro to expand into either \'inline\' or nothing,\ndepending on the compiler.\n\n In general, perhaps it is best not to use the extensions if you can\nstraightforwardly do without them, but to use the extensions if they are\na big improvement.\n\n An exception to this rule are the large, established programs (such\nas Emacs) which run on a great variety of systems. Using GNU extensions\nin such programs would make many users unhappy, so we don\'t do that.\n\n Another exception is for programs that are used as part of\ncompilation: anything that must be compiled with other compilers in\norder to bootstrap the GNU compilation facilities. If these require the\nGNU compiler, then no one can compile them without having them installed\nalready. That would be extremely troublesome in certain cases.\n\n3.4 Standard C and Pre-Standard C\n=================================\n\n1989 Standard C is widespread enough now that it is ok to use its\nfeatures in programs. There is one exception: do not ever use the\n"trigraph" feature of Standard C.\n\n The 1999 and 2011 editions of Standard C are not fully supported on\nall platforms. If you aim to support compilation by compilers other\nthan GCC, you should not require these C features in your programs. It\nis ok to use these features conditionally when the compiler supports\nthem.\n\n If your program is only meant to compile with GCC, then you can use\nthese features if GCC supports them, when they give substantial benefit.\n\n However, it is easy to support pre-standard compilers in most\nprograms, so if you know how to do that, feel free.\n\n To support pre-standard C, instead of writing function definitions in\nstandard prototype form,\n\n int\n foo (int x, int y)\n ...\n\nwrite the definition in pre-standard style like this,\n\n int\n foo (x, y)\n int x, y;\n ...\n\nand use a separate declaration to specify the argument prototype:\n\n int foo (int, int);\n\n You need such a declaration anyway, in a header file, to get the\nbenefit of prototypes in all the files where the function is called.\nAnd once you have the declaration, you normally lose nothing by writing\nthe function definition in the pre-standard style.\n\n This technique does not work for integer types narrower than \'int\'.\nIf you think of an argument as being of a type narrower than \'int\',\ndeclare it as \'int\' instead.\n\n There are a few special cases where this technique is hard to use.\nFor example, if a function argument needs to hold the system type\n\'dev_t\', you run into trouble, because \'dev_t\' is shorter than \'int\' on\nsome machines; but you cannot use \'int\' instead, because \'dev_t\' is\nwider than \'int\' on some machines. There is no type you can safely use\non all machines in a non-standard definition. The only way to support\nnon-standard C and pass such an argument is to check the width of\n\'dev_t\' using Autoconf and choose the argument type accordingly. This\nmay not be worth the trouble.\n\n In order to support pre-standard compilers that do not recognize\nprototypes, you may want to use a preprocessor macro like this:\n\n /* Declare the prototype for a general external function. */\n #if defined (__STDC__) || defined (WINDOWSNT)\n #define P_(proto) proto\n #else\n #define P_(proto) ()\n #endif\n\n3.5 Conditional Compilation\n===========================\n\nWhen supporting configuration options already known when building your\nprogram we prefer using \'if (... )\' over conditional compilation, as in\nthe former case the compiler is able to perform more extensive checking\nof all possible code paths.\n\n For example, please write\n\n if (HAS_FOO)\n ...\n else\n ...\n\ninstead of:\n\n #ifdef HAS_FOO\n ...\n #else\n ...\n #endif\n\n A modern compiler such as GCC will generate exactly the same code in\nboth cases, and we have been using similar techniques with good success\nin several projects. Of course, the former method assumes that\n\'HAS_FOO\' is defined as either 0 or 1.\n\n While this is not a silver bullet solving all portability problems,\nand is not always appropriate, following this policy would have saved\nGCC developers many hours, or even days, per year.\n\n In the case of function-like macros like \'REVERSIBLE_CC_MODE\' in GCC\nwhich cannot be simply used in \'if (...)\' statements, there is an easy\nworkaround. Simply introduce another macro \'HAS_REVERSIBLE_CC_MODE\' as\nin the following example:\n\n #ifdef REVERSIBLE_CC_MODE\n #define HAS_REVERSIBLE_CC_MODE 1\n #else\n #define HAS_REVERSIBLE_CC_MODE 0\n #endif\n\n4 Program Behavior for All Programs\n***********************************\n\nThis chapter describes conventions for writing robust software. It also\ndescribes general standards for error messages, the command line\ninterface, and how libraries should behave.\n\n4.1 Non-GNU Standards\n=====================\n\nThe GNU Project regards standards published by other organizations as\nsuggestions, not orders. We consider those standards, but we do not\n"obey" them. In developing a GNU program, you should implement an\noutside standard\'s specifications when that makes the GNU system better\noverall in an objective sense. When it doesn\'t, you shouldn\'t.\n\n In most cases, following published standards is convenient for\nusers--it means that their programs or scripts will work more portably.\nFor instance, GCC implements nearly all the features of Standard C as\nspecified by that standard. C program developers would be unhappy if it\ndid not. And GNU utilities mostly follow specifications of POSIX.2;\nshell script writers and users would be unhappy if our programs were\nincompatible.\n\n But we do not follow either of these specifications rigidly, and\nthere are specific points on which we decided not to follow them, so as\nto make the GNU system better for users.\n\n For instance, Standard C says that nearly all extensions to C are\nprohibited. How silly! GCC implements many extensions, some of which\nwere later adopted as part of the standard. If you want these\nconstructs to give an error message as "required" by the standard, you\nmust specify \'--pedantic\', which was implemented only so that we can say\n"GCC is a 100% implementation of the standard", not because there is any\nreason to actually use it.\n\n POSIX.2 specifies that \'df\' and \'du\' must output sizes by default in\nunits of 512 bytes. What users want is units of 1k, so that is what we\ndo by default. If you want the ridiculous behavior "required" by POSIX,\nyou must set the environment variable \'POSIXLY_CORRECT\' (which was\noriginally going to be named \'POSIX_ME_HARDER\').\n\n GNU utilities also depart from the letter of the POSIX.2\nspecification when they support long-named command-line options, and\nintermixing options with ordinary arguments. This minor incompatibility\nwith POSIX is never a problem in practice, and it is very useful.\n\n In particular, don\'t reject a new feature, or remove an old one,\nmerely because a standard says it is "forbidden" or "deprecated".\n\n4.2 Writing Robust Programs\n===========================\n\nAvoid arbitrary limits on the length or number of _any_ data structure,\nincluding file names, lines, files, and symbols, by allocating all data\nstructures dynamically. In most Unix utilities, "long lines are\nsilently truncated". This is not acceptable in a GNU utility.\n\n Utilities reading files should not drop NUL characters, or any other\nnonprinting characters. Programs should work properly with multibyte\ncharacter encodings, such as UTF-8. You can use libiconv to deal with a\nrange of encodings.\n\n Check every system call for an error return, unless you know you wish\nto ignore errors. Include the system error text (from \'strerror\', or\nequivalent) in _every_ error message resulting from a failing system\ncall, as well as the name of the file if any and the name of the\nutility. Just "cannot open foo.c" or "stat failed" is not sufficient.\n\n Check every call to \'malloc\' or \'realloc\' to see if it returned\n\'NULL\'. Check \'realloc\' even if you are making the block smaller; in a\nsystem that rounds block sizes to a power of 2, \'realloc\' may get a\ndifferent block if you ask for less space.\n\n You must expect \'free\' to alter the contents of the block that was\nfreed. Anything you want to fetch from the block, you must fetch before\ncalling \'free\'.\n\n If \'malloc\' fails in a noninteractive program, make that a fatal\nerror. In an interactive program (one that reads commands from the\nuser), it is better to abort the command and return to the command\nreader loop. This allows the user to kill other processes to free up\nvirtual memory, and then try the command again.\n\n Use \'getopt_long\' to decode arguments, unless the argument syntax\nmakes this unreasonable.\n\n When static storage is to be written in during program execution, use\nexplicit C code to initialize it. This way, restarting the program\n(without reloading it), or part of it, will reinitialize those\nvariables. Reserve C initialized declarations for data that will not be\nchanged.\n\n Try to avoid low-level interfaces to obscure Unix data structures\n(such as file directories, utmp, or the layout of kernel memory), since\nthese are less likely to work compatibly. If you need to find all the\nfiles in a directory, use \'readdir\' or some other high-level interface.\nThese are supported compatibly by GNU.\n\n The preferred signal handling facilities are the BSD variant of\n\'signal\', and the POSIX \'sigaction\' function; the alternative USG\n\'signal\' interface is an inferior design.\n\n Nowadays, using the POSIX signal functions may be the easiest way to\nmake a program portable. If you use \'signal\', then on GNU/Linux systems\nrunning GNU libc version 1, you should include \'bsd/signal.h\' instead of\n\'signal.h\', so as to get BSD behavior. It is up to you whether to\nsupport systems where \'signal\' has only the USG behavior, or give up on\nthem.\n\n In error checks that detect "impossible" conditions, just abort.\nThere is usually no point in printing any message. These checks\nindicate the existence of bugs. Whoever wants to fix the bugs will have\nto read the source code and run a debugger. So explain the problem with\ncomments in the source. The relevant data will be in variables, which\nare easy to examine with the debugger, so there is no point moving them\nelsewhere.\n\n Do not use a count of errors as the exit status for a program. _That\ndoes not work_, because exit status values are limited to 8 bits (0\nthrough 255). A single run of the program might have 256 errors; if you\ntry to return 256 as the exit status, the parent process will see 0 as\nthe status, and it will appear that the program succeeded.\n\n If you make temporary files, check the \'TMPDIR\' environment variable;\nif that variable is defined, use the specified directory instead of\n\'/tmp\'.\n\n In addition, be aware that there is a possible security problem when\ncreating temporary files in world-writable directories. In C, you can\navoid this problem by creating temporary files in this manner:\n\n fd = open (filename, O_WRONLY | O_CREAT | O_EXCL, 0600);\n\nor by using the \'mkstemps\' function from Gnulib (*note\n(gnulib)mkstemps::).\n\n In bash, use \'set -C\' (long name \'noclobber\') to avoid this problem.\nIn addition, the \'mktemp\' utility is a more general solution for\ncreating temporary files from shell scripts (*note (coreutils)mktemp\ninvocation::).\n\n4.3 Library Behavior\n====================\n\nTry to make library functions reentrant. If they need to do dynamic\nstorage allocation, at least try to avoid any nonreentrancy aside from\nthat of \'malloc\' itself.\n\n Here are certain name conventions for libraries, to avoid name\nconflicts.\n\n Choose a name prefix for the library, more than two characters long.\nAll external function and variable names should start with this prefix.\nIn addition, there should only be one of these in any given library\nmember. This usually means putting each one in a separate source file.\n\n An exception can be made when two external symbols are always used\ntogether, so that no reasonable program could use one without the other;\nthen they can both go in the same file.\n\n External symbols that are not documented entry points for the user\nshould have names beginning with \'_\'. The \'_\' should be followed by the\nchosen name prefix for the library, to prevent collisions with other\nlibraries. These can go in the same files with user entry points if you\nlike.\n\n Static functions and variables can be used as you like and need not\nfit any naming convention.\n\n4.4 Formatting Error Messages\n=============================\n\nError messages from compilers should look like this:\n\n SOURCEFILE:LINENO: MESSAGE\n\nIf you want to mention the column number, use one of these formats:\n\n SOURCEFILE:LINENO:COLUMN: MESSAGE\n SOURCEFILE:LINENO.COLUMN: MESSAGE\n\n\nLine numbers should start from 1 at the beginning of the file, and\ncolumn numbers should start from 1 at the beginning of the line. (Both\nof these conventions are chosen for compatibility.) Calculate column\nnumbers assuming that space and all ASCII printing characters have equal\nwidth, and assuming tab stops every 8 columns. For non-ASCII\ncharacters, Unicode character widths should be used when in a UTF-8\nlocale; GNU libc and GNU gnulib provide suitable \'wcwidth\' functions.\n\n The error message can also give both the starting and ending\npositions of the erroneous text. There are several formats so that you\ncan avoid redundant information such as a duplicate line number. Here\nare the possible formats:\n\n SOURCEFILE:LINE1.COLUMN1-LINE2.COLUMN2: MESSAGE\n SOURCEFILE:LINE1.COLUMN1-COLUMN2: MESSAGE\n SOURCEFILE:LINE1-LINE2: MESSAGE\n\nWhen an error is spread over several files, you can use this format:\n\n FILE1:LINE1.COLUMN1-FILE2:LINE2.COLUMN2: MESSAGE\n\n Error messages from other noninteractive programs should look like\nthis:\n\n PROGRAM:SOURCEFILE:LINENO: MESSAGE\n\nwhen there is an appropriate source file, or like this:\n\n PROGRAM: MESSAGE\n\nwhen there is no relevant source file.\n\n If you want to mention the column number, use this format:\n\n PROGRAM:SOURCEFILE:LINENO:COLUMN: MESSAGE\n\n In an interactive program (one that is reading commands from a\nterminal), it is better not to include the program name in an error\nmessage. The place to indicate which program is running is in the\nprompt or with the screen layout. (When the same program runs with\ninput from a source other than a terminal, it is not interactive and\nwould do best to print error messages using the noninteractive style.)\n\n The string MESSAGE should not begin with a capital letter when it\nfollows a program name and/or file name, because that isn\'t the\nbeginning of a sentence. (The sentence conceptually starts at the\nbeginning of the line.) Also, it should not end with a period.\n\n Error messages from interactive programs, and other messages such as\nusage messages, should start with a capital letter. But they should not\nend with a period.\n\n4.5 Standards for Interfaces Generally\n======================================\n\nPlease don\'t make the behavior of a utility depend on the name used to\ninvoke it. It is useful sometimes to make a link to a utility with a\ndifferent name, and that should not change what it does.\n\n Instead, use a run time option or a compilation switch or both to\nselect among the alternate behaviors. You can also build two versions\nof the program, with different names and different default behaviors.\n\n Likewise, please don\'t make the behavior of a command-line program\ndepend on the type of output device it gets as standard output or\nstandard input. Device independence is an important principle of the\nsystem\'s design; do not compromise it merely to save someone from typing\nan option now and then. (Variation in error message syntax when using a\nterminal is ok, because that is a side issue that people do not depend\non.)\n\n If you think one behavior is most useful when the output is to a\nterminal, and another is most useful when the output is a file or a\npipe, then it is usually best to make the default behavior the one that\nis useful with output to a terminal, and have an option for the other\nbehavior. You can also build two different versions of the program with\ndifferent names.\n\n There is an exception for programs whose output in certain cases is\nbinary data. Sending such output to a terminal is useless and can cause\ntrouble. If such a program normally sends its output to stdout, it\nshould detect, in these cases, when the output is a terminal and give an\nerror message instead. The \'-f\' option should override this exception,\nthus permitting the output to go to the terminal.\n\n Compatibility requires certain programs to depend on the type of\noutput device. It would be disastrous if \'ls\' or \'sh\' did not do so in\nthe way all users expect. In some of these cases, we supplement the\nprogram with a preferred alternate version that does not depend on the\noutput device type. For example, we provide a \'dir\' program much like\n\'ls\' except that its default output format is always multi-column\nformat.\n\n4.6 Standards for Graphical Interfaces\n======================================\n\nWhen you write a program that provides a graphical user interface,\nplease make it work with the X Window System, using the GTK+ toolkit or\nthe GNUstep toolkit, unless the functionality specifically requires some\nalternative (for example, "displaying jpeg images while in console\nmode").\n\n In addition, please provide a command-line interface to control the\nfunctionality. (In many cases, the graphical user interface can be a\nseparate program which invokes the command-line program.) This is so\nthat the same jobs can be done from scripts.\n\n Please also consider providing a D-bus interface for use from other\nrunning programs, such as within GNOME. (GNOME used to use CORBA for\nthis, but that is being phased out.) In addition, consider providing a\nlibrary interface (for use from C), and perhaps a keyboard-driven\nconsole interface (for use by users from console mode). Once you are\ndoing the work to provide the functionality and the graphical interface,\nthese won\'t be much extra work.\n\n Please make your program interoperate with access technology such as\nscreen readers (see\n<http://www.gnu.org/accessibility/accessibility.html>). This should be\nautomatic if you use GTK+.\n\n4.7 Standards for Command Line Interfaces\n=========================================\n\nIt is a good idea to follow the POSIX guidelines for the command-line\noptions of a program. The easiest way to do this is to use \'getopt\' to\nparse them. Note that the GNU version of \'getopt\' will normally permit\noptions anywhere among the arguments unless the special argument \'--\' is\nused. This is not what POSIX specifies; it is a GNU extension.\n\n Please define long-named options that are equivalent to the\nsingle-letter Unix-style options. We hope to make GNU more user\nfriendly this way. This is easy to do with the GNU function\n\'getopt_long\'.\n\n One of the advantages of long-named options is that they can be\nconsistent from program to program. For example, users should be able\nto expect the "verbose" option of any GNU program which has one, to be\nspelled precisely \'--verbose\'. To achieve this uniformity, look at the\ntable of common long-option names when you choose the option names for\nyour program (*note Option Table::).\n\n It is usually a good idea for file names given as ordinary arguments\nto be input files only; any output files would be specified using\noptions (preferably \'-o\' or \'--output\'). Even if you allow an output\nfile name as an ordinary argument for compatibility, try to provide an\noption as another way to specify it. This will lead to more consistency\namong GNU utilities, and fewer idiosyncrasies for users to remember.\n\n All programs should support two standard options: \'--version\' and\n\'--help\'. CGI programs should accept these as command-line options, and\nalso if given as the \'PATH_INFO\'; for instance, visiting\n\'http://example.org/p.cgi/--help\' in a browser should output the same\ninformation as invoking \'p.cgi --help\' from the command line.\n\n4.7.1 \'--version\'\n-----------------\n\nThe standard \'--version\' option should direct the program to print\ninformation about its name, version, origin and legal status, all on\nstandard output, and then exit successfully. Other options and\narguments should be ignored once this is seen, and the program should\nnot perform its normal function.\n\n The first line is meant to be easy for a program to parse; the\nversion number proper starts after the last space. In addition, it\ncontains the canonical name for this program, in this format:\n\n GNU Emacs 19.30\n\nThe program\'s name should be a constant string; _don\'t_ compute it from\n\'argv[0]\'. The idea is to state the standard or canonical name for the\nprogram, not its file name. There are other ways to find out the\nprecise file name where a command is found in \'PATH\'.\n\n If the program is a subsidiary part of a larger package, mention the\npackage name in parentheses, like this:\n\n emacsserver (GNU Emacs) 19.30\n\nIf the package has a version number which is different from this\nprogram\'s version number, you can mention the package version number\njust before the close-parenthesis.\n\n If you _need_ to mention the version numbers of libraries which are\ndistributed separately from the package which contains this program, you\ncan do so by printing an additional line of version info for each\nlibrary you want to mention. Use the same format for these lines as for\nthe first line.\n\n Please do not mention all of the libraries that the program uses\n"just for completeness"--that would produce a lot of unhelpful clutter.\nPlease mention library version numbers only if you find in practice that\nthey are very important to you in debugging.\n\n The following line, after the version number line or lines, should be\na copyright notice. If more than one copyright notice is called for,\nput each on a separate line.\n\n Next should follow a line stating the license, preferably using one\nof abbreviations below, and a brief statement that the program is free\nsoftware, and that users are free to copy and change it. Also mention\nthat there is no warranty, to the extent permitted by law. See\nrecommended wording below.\n\n It is ok to finish the output with a list of the major authors of the\nprogram, as a way of giving credit.\n\n Here\'s an example of output that follows these rules:\n\n GNU hello 2.3\n Copyright (C) 2007 Free Software Foundation, Inc.\n License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n This is free software: you are free to change and redistribute it.\n There is NO WARRANTY, to the extent permitted by law.\n\n You should adapt this to your program, of course, filling in the\nproper year, copyright holder, name of program, and the references to\ndistribution terms, and changing the rest of the wording as necessary.\n\n This copyright notice only needs to mention the most recent year in\nwhich changes were made--there\'s no need to list the years for previous\nversions\' changes. You don\'t have to mention the name of the program in\nthese notices, if that is inconvenient, since it appeared in the first\nline. (The rules are different for copyright notices in source files;\n*note (maintain)Copyright Notices::.)\n\n Translations of the above lines must preserve the validity of the\ncopyright notices (*note Internationalization::). If the translation\'s\ncharacter set supports it, the \'(C)\' should be replaced with the\ncopyright symbol, as follows:\n\n (the official copyright symbol, which is the letter C in a circle);\n\n Write the word "Copyright" exactly like that, in English. Do not\ntranslate it into another language. International treaties recognize\nthe English word "Copyright"; translations into other languages do not\nhave legal significance.\n\n Finally, here is the table of our suggested license abbreviations.\nAny abbreviation can be followed by \'vVERSION[+]\', meaning that\nparticular version, or later versions with the \'+\', as shown above. In\nthe case of a GNU license, _always_ indicate the permitted versions in\nthis way.\n\n In the case of exceptions for extra permissions with the GPL, we use\n\'/\' for a separator; the version number can follow the license\nabbreviation as usual, as in the examples below.\n\nGPL\n GNU General Public License, <http://www.gnu.org/licenses/gpl.html>.\n\nLGPL\n GNU Lesser General Public License,\n <http://www.gnu.org/licenses/lgpl.html>.\n\nGPL/Ada\n GNU GPL with the exception for Ada.\n\nApache\n The Apache Software Foundation license,\n <http://www.apache.org/licenses>.\n\nArtistic\n The Artistic license used for Perl,\n <http://dev.perl.org/licenses/artistic.html>.\n\nExpat\n The Expat license, <http://www.jclark.com/xml/copying.txt>.\n\nMPL\n The Mozilla Public License, <http://www.mozilla.org/MPL/>.\n\nOBSD\n The original (4-clause) BSD license, incompatible with the GNU GPL\n <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6>.\n\nPHP\n The license used for PHP, <http://www.php.net/license/>.\n\npublic domain\n The non-license that is being in the public domain,\n <http://www.gnu.org/licenses/license-list.html#PublicDomain>.\n\nPython\n The license for Python,\n <http://directory.fsf.org/wiki?title=License:Python2.0.1>.\n\nRBSD\n The revised (3-clause) BSD, compatible with the GNU GPL,\n <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.\n\nX11\n The simple non-copyleft license used for most versions of the X\n Window System, <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3>.\n\nZlib\n The license for Zlib, <http://www.gzip.org/zlib/zlib_license.html>.\n\n More information about these licenses and many more are on the GNU\nlicensing web pages, <http://www.gnu.org/licenses/license-list.html>.\n\n4.7.2 \'--help\'\n--------------\n\nThe standard \'--help\' option should output brief documentation for how\nto invoke the program, on standard output, then exit successfully.\nOther options and arguments should be ignored once this is seen, and the\nprogram should not perform its normal function.\n\n Near the end of the \'--help\' option\'s output, please place lines\ngiving the email address for bug reports, the package\'s home page\n(normally \'http://www.gnu.org/software/PKG\', and the general page for\nhelp using GNU programs. The format should be like this:\n\n Report bugs to: MAILING-ADDRESS\n PKG home page: <http://www.gnu.org/software/PKG/>\n General help using GNU software: <http://www.gnu.org/gethelp/>\n\n It is ok to mention other appropriate mailing lists and web pages.\n\n4.8 Standards for Dynamic Plug-in Interfaces\n============================================\n\nAnother aspect of keeping free programs free is encouraging development\nof free plug-ins, and discouraging development of proprietary plug-ins.\nMany GNU programs will not have anything like plug-ins at all, but those\nthat do should follow these practices.\n\n First, the general plug-in architecture design should closely tie the\nplug-in to the original code, such that the plug-in and the base program\nare parts of one extended program. For GCC, for example, plug-ins\nreceive and modify GCC\'s internal data structures, and so clearly form\nan extended program with the base GCC.\n\n Second, you should require plug-in developers to affirm that their\nplug-ins are released under an appropriate license. This should be\nenforced with a simple programmatic check. For GCC, again for example,\na plug-in must define the global symbol \'plugin_is_GPL_compatible\', thus\nasserting that the plug-in is released under a GPL-compatible license\n(*note Plugins: (gccint)Plugins.).\n\n By adding this check to your program you are not creating a new legal\nrequirement. The GPL itself requires plug-ins to be free software,\nlicensed compatibly. As long as you have followed the first rule above\nto keep plug-ins closely tied to your original program, the GPL and AGPL\nalready require those plug-ins to be released under a compatible\nlicense. The symbol definition in the plug-in--or whatever equivalent\nworks best in your program--makes it harder for anyone who might\ndistribute proprietary plug-ins to legally defend themselves. If a case\nabout this got to court, we can point to that symbol as evidence that\nthe plug-in developer understood that the license had this requirement.\n\n4.9 Table of Long Options\n=========================\n\nHere is a table of long options used by GNU programs. It is surely\nincomplete, but we aim to list all the options that a new program might\nwant to be compatible with. If you use names not already in the table,\nplease send <bug-standards@gnu.org> a list of them, with their meanings,\nso we can update the table.\n\n\'after-date\'\n \'-N\' in \'tar\'.\n\n\'all\'\n \'-a\' in \'du\', \'ls\', \'nm\', \'stty\', \'uname\', and \'unexpand\'.\n\n\'all-text\'\n \'-a\' in \'diff\'.\n\n\'almost-all\'\n \'-A\' in \'ls\'.\n\n\'append\'\n \'-a\' in \'etags\', \'tee\', \'time\'; \'-r\' in \'tar\'.\n\n\'archive\'\n \'-a\' in \'cp\'.\n\n\'archive-name\'\n \'-n\' in \'shar\'.\n\n\'arglength\'\n \'-l\' in \'m4\'.\n\n\'ascii\'\n \'-a\' in \'diff\'.\n\n\'assign\'\n \'-v\' in \'gawk\'.\n\n\'assume-new\'\n \'-W\' in \'make\'.\n\n\'assume-old\'\n \'-o\' in \'make\'.\n\n\'auto-check\'\n \'-a\' in \'recode\'.\n\n\'auto-pager\'\n \'-a\' in \'wdiff\'.\n\n\'auto-reference\'\n \'-A\' in \'ptx\'.\n\n\'avoid-wraps\'\n \'-n\' in \'wdiff\'.\n\n\'background\'\n For server programs, run in the background.\n\n\'backward-search\'\n \'-B\' in \'ctags\'.\n\n\'basename\'\n \'-f\' in \'shar\'.\n\n\'batch\'\n Used in GDB.\n\n\'baud\'\n Used in GDB.\n\n\'before\'\n \'-b\' in \'tac\'.\n\n\'binary\'\n \'-b\' in \'cpio\' and \'diff\'.\n\n\'bits-per-code\'\n \'-b\' in \'shar\'.\n\n\'block-size\'\n Used in \'cpio\' and \'tar\'.\n\n\'blocks\'\n \'-b\' in \'head\' and \'tail\'.\n\n\'break-file\'\n \'-b\' in \'ptx\'.\n\n\'brief\'\n Used in various programs to make output shorter.\n\n\'bytes\'\n \'-c\' in \'head\', \'split\', and \'tail\'.\n\n\'c++\'\n \'-C\' in \'etags\'.\n\n\'catenate\'\n \'-A\' in \'tar\'.\n\n\'cd\'\n Used in various programs to specify the directory to use.\n\n\'changes\'\n \'-c\' in \'chgrp\' and \'chown\'.\n\n\'classify\'\n \'-F\' in \'ls\'.\n\n\'colons\'\n \'-c\' in \'recode\'.\n\n\'command\'\n \'-c\' in \'su\'; \'-x\' in GDB.\n\n\'compare\'\n \'-d\' in \'tar\'.\n\n\'compat\'\n Used in \'gawk\'.\n\n\'compress\'\n \'-Z\' in \'tar\' and \'shar\'.\n\n\'concatenate\'\n \'-A\' in \'tar\'.\n\n\'confirmation\'\n \'-w\' in \'tar\'.\n\n\'context\'\n Used in \'diff\'.\n\n\'copyleft\'\n \'-W copyleft\' in \'gawk\'.\n\n\'copyright\'\n \'-C\' in \'ptx\', \'recode\', and \'wdiff\'; \'-W copyright\' in \'gawk\'.\n\n\'core\'\n Used in GDB.\n\n\'count\'\n \'-q\' in \'who\'.\n\n\'count-links\'\n \'-l\' in \'du\'.\n\n\'create\'\n Used in \'tar\' and \'cpio\'.\n\n\'cut-mark\'\n \'-c\' in \'shar\'.\n\n\'cxref\'\n \'-x\' in \'ctags\'.\n\n\'date\'\n \'-d\' in \'touch\'.\n\n\'debug\'\n \'-d\' in \'make\' and \'m4\'; \'-t\' in Bison.\n\n\'define\'\n \'-D\' in \'m4\'.\n\n\'defines\'\n \'-d\' in Bison and \'ctags\'.\n\n\'delete\'\n \'-D\' in \'tar\'.\n\n\'dereference\'\n \'-L\' in \'chgrp\', \'chown\', \'cpio\', \'du\', \'ls\', and \'tar\'.\n\n\'dereference-args\'\n \'-D\' in \'du\'.\n\n\'device\'\n Specify an I/O device (special file name).\n\n\'diacritics\'\n \'-d\' in \'recode\'.\n\n\'dictionary-order\'\n \'-d\' in \'look\'.\n\n\'diff\'\n \'-d\' in \'tar\'.\n\n\'digits\'\n \'-n\' in \'csplit\'.\n\n\'directory\'\n Specify the directory to use, in various programs. In \'ls\', it\n means to show directories themselves rather than their contents.\n In \'rm\' and \'ln\', it means to not treat links to directories\n specially.\n\n\'discard-all\'\n \'-x\' in \'strip\'.\n\n\'discard-locals\'\n \'-X\' in \'strip\'.\n\n\'dry-run\'\n \'-n\' in \'make\'.\n\n\'ed\'\n \'-e\' in \'diff\'.\n\n\'elide-empty-files\'\n \'-z\' in \'csplit\'.\n\n\'end-delete\'\n \'-x\' in \'wdiff\'.\n\n\'end-insert\'\n \'-z\' in \'wdiff\'.\n\n\'entire-new-file\'\n \'-N\' in \'diff\'.\n\n\'environment-overrides\'\n \'-e\' in \'make\'.\n\n\'eof\'\n \'-e\' in \'xargs\'.\n\n\'epoch\'\n Used in GDB.\n\n\'error-limit\'\n Used in \'makeinfo\'.\n\n\'error-output\'\n \'-o\' in \'m4\'.\n\n\'escape\'\n \'-b\' in \'ls\'.\n\n\'exclude-from\'\n \'-X\' in \'tar\'.\n\n\'exec\'\n Used in GDB.\n\n\'exit\'\n \'-x\' in \'xargs\'.\n\n\'exit-0\'\n \'-e\' in \'unshar\'.\n\n\'expand-tabs\'\n \'-t\' in \'diff\'.\n\n\'expression\'\n \'-e\' in \'sed\'.\n\n\'extern-only\'\n \'-g\' in \'nm\'.\n\n\'extract\'\n \'-i\' in \'cpio\'; \'-x\' in \'tar\'.\n\n\'faces\'\n \'-f\' in \'finger\'.\n\n\'fast\'\n \'-f\' in \'su\'.\n\n\'fatal-warnings\'\n \'-E\' in \'m4\'.\n\n\'file\'\n \'-f\' in \'gawk\', \'info\', \'make\', \'mt\', \'sed\', and \'tar\'.\n\n\'field-separator\'\n \'-F\' in \'gawk\'.\n\n\'file-prefix\'\n \'-b\' in Bison.\n\n\'file-type\'\n \'-F\' in \'ls\'.\n\n\'files-from\'\n \'-T\' in \'tar\'.\n\n\'fill-column\'\n Used in \'makeinfo\'.\n\n\'flag-truncation\'\n \'-F\' in \'ptx\'.\n\n\'fixed-output-files\'\n \'-y\' in Bison.\n\n\'follow\'\n \'-f\' in \'tail\'.\n\n\'footnote-style\'\n Used in \'makeinfo\'.\n\n\'force\'\n \'-f\' in \'cp\', \'ln\', \'mv\', and \'rm\'.\n\n\'force-prefix\'\n \'-F\' in \'shar\'.\n\n\'foreground\'\n For server programs, run in the foreground; in other words, don\'t\n do anything special to run the server in the background.\n\n\'format\'\n Used in \'ls\', \'time\', and \'ptx\'.\n\n\'freeze-state\'\n \'-F\' in \'m4\'.\n\n\'fullname\'\n Used in GDB.\n\n\'gap-size\'\n \'-g\' in \'ptx\'.\n\n\'get\'\n \'-x\' in \'tar\'.\n\n\'graphic\'\n \'-i\' in \'ul\'.\n\n\'graphics\'\n \'-g\' in \'recode\'.\n\n\'group\'\n \'-g\' in \'install\'.\n\n\'gzip\'\n \'-z\' in \'tar\' and \'shar\'.\n\n\'hashsize\'\n \'-H\' in \'m4\'.\n\n\'header\'\n \'-h\' in \'objdump\' and \'recode\'\n\n\'heading\'\n \'-H\' in \'who\'.\n\n\'help\'\n Used to ask for brief usage information.\n\n\'here-delimiter\'\n \'-d\' in \'shar\'.\n\n\'hide-control-chars\'\n \'-q\' in \'ls\'.\n\n\'html\'\n In \'makeinfo\', output HTML.\n\n\'idle\'\n \'-u\' in \'who\'.\n\n\'ifdef\'\n \'-D\' in \'diff\'.\n\n\'ignore\'\n \'-I\' in \'ls\'; \'-x\' in \'recode\'.\n\n\'ignore-all-space\'\n \'-w\' in \'diff\'.\n\n\'ignore-backups\'\n \'-B\' in \'ls\'.\n\n\'ignore-blank-lines\'\n \'-B\' in \'diff\'.\n\n\'ignore-case\'\n \'-f\' in \'look\' and \'ptx\'; \'-i\' in \'diff\' and \'wdiff\'.\n\n\'ignore-errors\'\n \'-i\' in \'make\'.\n\n\'ignore-file\'\n \'-i\' in \'ptx\'.\n\n\'ignore-indentation\'\n \'-I\' in \'etags\'.\n\n\'ignore-init-file\'\n \'-f\' in Oleo.\n\n\'ignore-interrupts\'\n \'-i\' in \'tee\'.\n\n\'ignore-matching-lines\'\n \'-I\' in \'diff\'.\n\n\'ignore-space-change\'\n \'-b\' in \'diff\'.\n\n\'ignore-zeros\'\n \'-i\' in \'tar\'.\n\n\'include\'\n \'-i\' in \'etags\'; \'-I\' in \'m4\'.\n\n\'include-dir\'\n \'-I\' in \'make\'.\n\n\'incremental\'\n \'-G\' in \'tar\'.\n\n\'info\'\n \'-i\', \'-l\', and \'-m\' in Finger.\n\n\'init-file\'\n In some programs, specify the name of the file to read as the\n user\'s init file.\n\n\'initial\'\n \'-i\' in \'expand\'.\n\n\'initial-tab\'\n \'-T\' in \'diff\'.\n\n\'inode\'\n \'-i\' in \'ls\'.\n\n\'interactive\'\n \'-i\' in \'cp\', \'ln\', \'mv\', \'rm\'; \'-e\' in \'m4\'; \'-p\' in \'xargs\'; \'-w\'\n in \'tar\'.\n\n\'intermix-type\'\n \'-p\' in \'shar\'.\n\n\'iso-8601\'\n Used in \'date\'\n\n\'jobs\'\n \'-j\' in \'make\'.\n\n\'just-print\'\n \'-n\' in \'make\'.\n\n\'keep-going\'\n \'-k\' in \'make\'.\n\n\'keep-files\'\n \'-k\' in \'csplit\'.\n\n\'kilobytes\'\n \'-k\' in \'du\' and \'ls\'.\n\n\'language\'\n \'-l\' in \'etags\'.\n\n\'less-mode\'\n \'-l\' in \'wdiff\'.\n\n\'level-for-gzip\'\n \'-g\' in \'shar\'.\n\n\'line-bytes\'\n \'-C\' in \'split\'.\n\n\'lines\'\n Used in \'split\', \'head\', and \'tail\'.\n\n\'link\'\n \'-l\' in \'cpio\'.\n\n\'lint\'\n\'lint-old\'\n Used in \'gawk\'.\n\n\'list\'\n \'-t\' in \'cpio\'; \'-l\' in \'recode\'.\n\n\'list\'\n \'-t\' in \'tar\'.\n\n\'literal\'\n \'-N\' in \'ls\'.\n\n\'load-average\'\n \'-l\' in \'make\'.\n\n\'login\'\n Used in \'su\'.\n\n\'machine\'\n Used in \'uname\'.\n\n\'macro-name\'\n \'-M\' in \'ptx\'.\n\n\'mail\'\n \'-m\' in \'hello\' and \'uname\'.\n\n\'make-directories\'\n \'-d\' in \'cpio\'.\n\n\'makefile\'\n \'-f\' in \'make\'.\n\n\'mapped\'\n Used in GDB.\n\n\'max-args\'\n \'-n\' in \'xargs\'.\n\n\'max-chars\'\n \'-n\' in \'xargs\'.\n\n\'max-lines\'\n \'-l\' in \'xargs\'.\n\n\'max-load\'\n \'-l\' in \'make\'.\n\n\'max-procs\'\n \'-P\' in \'xargs\'.\n\n\'mesg\'\n \'-T\' in \'who\'.\n\n\'message\'\n \'-T\' in \'who\'.\n\n\'minimal\'\n \'-d\' in \'diff\'.\n\n\'mixed-uuencode\'\n \'-M\' in \'shar\'.\n\n\'mode\'\n \'-m\' in \'install\', \'mkdir\', and \'mkfifo\'.\n\n\'modification-time\'\n \'-m\' in \'tar\'.\n\n\'multi-volume\'\n \'-M\' in \'tar\'.\n\n\'name-prefix\'\n \'-a\' in Bison.\n\n\'nesting-limit\'\n \'-L\' in \'m4\'.\n\n\'net-headers\'\n \'-a\' in \'shar\'.\n\n\'new-file\'\n \'-W\' in \'make\'.\n\n\'no-builtin-rules\'\n \'-r\' in \'make\'.\n\n\'no-character-count\'\n \'-w\' in \'shar\'.\n\n\'no-check-existing\'\n \'-x\' in \'shar\'.\n\n\'no-common\'\n \'-3\' in \'wdiff\'.\n\n\'no-create\'\n \'-c\' in \'touch\'.\n\n\'no-defines\'\n \'-D\' in \'etags\'.\n\n\'no-deleted\'\n \'-1\' in \'wdiff\'.\n\n\'no-dereference\'\n \'-d\' in \'cp\'.\n\n\'no-inserted\'\n \'-2\' in \'wdiff\'.\n\n\'no-keep-going\'\n \'-S\' in \'make\'.\n\n\'no-lines\'\n \'-l\' in Bison.\n\n\'no-piping\'\n \'-P\' in \'shar\'.\n\n\'no-prof\'\n \'-e\' in \'gprof\'.\n\n\'no-regex\'\n \'-R\' in \'etags\'.\n\n\'no-sort\'\n \'-p\' in \'nm\'.\n\n\'no-splash\'\n Don\'t print a startup splash screen.\n\n\'no-split\'\n Used in \'makeinfo\'.\n\n\'no-static\'\n \'-a\' in \'gprof\'.\n\n\'no-time\'\n \'-E\' in \'gprof\'.\n\n\'no-timestamp\'\n \'-m\' in \'shar\'.\n\n\'no-validate\'\n Used in \'makeinfo\'.\n\n\'no-wait\'\n Used in \'emacsclient\'.\n\n\'no-warn\'\n Used in various programs to inhibit warnings.\n\n\'node\'\n \'-n\' in \'info\'.\n\n\'nodename\'\n \'-n\' in \'uname\'.\n\n\'nonmatching\'\n \'-f\' in \'cpio\'.\n\n\'nstuff\'\n \'-n\' in \'objdump\'.\n\n\'null\'\n \'-0\' in \'xargs\'.\n\n\'number\'\n \'-n\' in \'cat\'.\n\n\'number-nonblank\'\n \'-b\' in \'cat\'.\n\n\'numeric-sort\'\n \'-n\' in \'nm\'.\n\n\'numeric-uid-gid\'\n \'-n\' in \'cpio\' and \'ls\'.\n\n\'nx\'\n Used in GDB.\n\n\'old-archive\'\n \'-o\' in \'tar\'.\n\n\'old-file\'\n \'-o\' in \'make\'.\n\n\'one-file-system\'\n \'-l\' in \'tar\', \'cp\', and \'du\'.\n\n\'only-file\'\n \'-o\' in \'ptx\'.\n\n\'only-prof\'\n \'-f\' in \'gprof\'.\n\n\'only-time\'\n \'-F\' in \'gprof\'.\n\n\'options\'\n \'-o\' in \'getopt\', \'fdlist\', \'fdmount\', \'fdmountd\', and \'fdumount\'.\n\n\'output\'\n In various programs, specify the output file name.\n\n\'output-prefix\'\n \'-o\' in \'shar\'.\n\n\'override\'\n \'-o\' in \'rm\'.\n\n\'overwrite\'\n \'-c\' in \'unshar\'.\n\n\'owner\'\n \'-o\' in \'install\'.\n\n\'paginate\'\n \'-l\' in \'diff\'.\n\n\'paragraph-indent\'\n Used in \'makeinfo\'.\n\n\'parents\'\n \'-p\' in \'mkdir\' and \'rmdir\'.\n\n\'pass-all\'\n \'-p\' in \'ul\'.\n\n\'pass-through\'\n \'-p\' in \'cpio\'.\n\n\'port\'\n \'-P\' in \'finger\'.\n\n\'portability\'\n \'-c\' in \'cpio\' and \'tar\'.\n\n\'posix\'\n Used in \'gawk\'.\n\n\'prefix-builtins\'\n \'-P\' in \'m4\'.\n\n\'prefix\'\n \'-f\' in \'csplit\'.\n\n\'preserve\'\n Used in \'tar\' and \'cp\'.\n\n\'preserve-environment\'\n \'-p\' in \'su\'.\n\n\'preserve-modification-time\'\n \'-m\' in \'cpio\'.\n\n\'preserve-order\'\n \'-s\' in \'tar\'.\n\n\'preserve-permissions\'\n \'-p\' in \'tar\'.\n\n\'print\'\n \'-l\' in \'diff\'.\n\n\'print-chars\'\n \'-L\' in \'cmp\'.\n\n\'print-data-base\'\n \'-p\' in \'make\'.\n\n\'print-directory\'\n \'-w\' in \'make\'.\n\n\'print-file-name\'\n \'-o\' in \'nm\'.\n\n\'print-symdefs\'\n \'-s\' in \'nm\'.\n\n\'printer\'\n \'-p\' in \'wdiff\'.\n\n\'prompt\'\n \'-p\' in \'ed\'.\n\n\'proxy\'\n Specify an HTTP proxy.\n\n\'query-user\'\n \'-X\' in \'shar\'.\n\n\'question\'\n \'-q\' in \'make\'.\n\n\'quiet\'\n Used in many programs to inhibit the usual output. Every program\n accepting \'--quiet\' should accept \'--silent\' as a synonym.\n\n\'quiet-unshar\'\n \'-Q\' in \'shar\'\n\n\'quote-name\'\n \'-Q\' in \'ls\'.\n\n\'rcs\'\n \'-n\' in \'diff\'.\n\n\'re-interval\'\n Used in \'gawk\'.\n\n\'read-full-blocks\'\n \'-B\' in \'tar\'.\n\n\'readnow\'\n Used in GDB.\n\n\'recon\'\n \'-n\' in \'make\'.\n\n\'record-number\'\n \'-R\' in \'tar\'.\n\n\'recursive\'\n Used in \'chgrp\', \'chown\', \'cp\', \'ls\', \'diff\', and \'rm\'.\n\n\'reference\'\n \'-r\' in \'touch\'.\n\n\'references\'\n \'-r\' in \'ptx\'.\n\n\'regex\'\n \'-r\' in \'tac\' and \'etags\'.\n\n\'release\'\n \'-r\' in \'uname\'.\n\n\'reload-state\'\n \'-R\' in \'m4\'.\n\n\'relocation\'\n \'-r\' in \'objdump\'.\n\n\'rename\'\n \'-r\' in \'cpio\'.\n\n\'replace\'\n \'-i\' in \'xargs\'.\n\n\'report-identical-files\'\n \'-s\' in \'diff\'.\n\n\'reset-access-time\'\n \'-a\' in \'cpio\'.\n\n\'reverse\'\n \'-r\' in \'ls\' and \'nm\'.\n\n\'reversed-ed\'\n \'-f\' in \'diff\'.\n\n\'right-side-defs\'\n \'-R\' in \'ptx\'.\n\n\'same-order\'\n \'-s\' in \'tar\'.\n\n\'same-permissions\'\n \'-p\' in \'tar\'.\n\n\'save\'\n \'-g\' in \'stty\'.\n\n\'se\'\n Used in GDB.\n\n\'sentence-regexp\'\n \'-S\' in \'ptx\'.\n\n\'separate-dirs\'\n \'-S\' in \'du\'.\n\n\'separator\'\n \'-s\' in \'tac\'.\n\n\'sequence\'\n Used by \'recode\' to chose files or pipes for sequencing passes.\n\n\'shell\'\n \'-s\' in \'su\'.\n\n\'show-all\'\n \'-A\' in \'cat\'.\n\n\'show-c-function\'\n \'-p\' in \'diff\'.\n\n\'show-ends\'\n \'-E\' in \'cat\'.\n\n\'show-function-line\'\n \'-F\' in \'diff\'.\n\n\'show-tabs\'\n \'-T\' in \'cat\'.\n\n\'silent\'\n Used in many programs to inhibit the usual output. Every program\n accepting \'--silent\' should accept \'--quiet\' as a synonym.\n\n\'size\'\n \'-s\' in \'ls\'.\n\n\'socket\'\n Specify a file descriptor for a network server to use for its\n socket, instead of opening and binding a new socket. This provides\n a way to run, in a non-privileged process, a server that normally\n needs a reserved port number.\n\n\'sort\'\n Used in \'ls\'.\n\n\'source\'\n \'-W source\' in \'gawk\'.\n\n\'sparse\'\n \'-S\' in \'tar\'.\n\n\'speed-large-files\'\n \'-H\' in \'diff\'.\n\n\'split-at\'\n \'-E\' in \'unshar\'.\n\n\'split-size-limit\'\n \'-L\' in \'shar\'.\n\n\'squeeze-blank\'\n \'-s\' in \'cat\'.\n\n\'start-delete\'\n \'-w\' in \'wdiff\'.\n\n\'start-insert\'\n \'-y\' in \'wdiff\'.\n\n\'starting-file\'\n Used in \'tar\' and \'diff\' to specify which file within a directory\n to start processing with.\n\n\'statistics\'\n \'-s\' in \'wdiff\'.\n\n\'stdin-file-list\'\n \'-S\' in \'shar\'.\n\n\'stop\'\n \'-S\' in \'make\'.\n\n\'strict\'\n \'-s\' in \'recode\'.\n\n\'strip\'\n \'-s\' in \'install\'.\n\n\'strip-all\'\n \'-s\' in \'strip\'.\n\n\'strip-debug\'\n \'-S\' in \'strip\'.\n\n\'submitter\'\n \'-s\' in \'shar\'.\n\n\'suffix\'\n \'-S\' in \'cp\', \'ln\', \'mv\'.\n\n\'suffix-format\'\n \'-b\' in \'csplit\'.\n\n\'sum\'\n \'-s\' in \'gprof\'.\n\n\'summarize\'\n \'-s\' in \'du\'.\n\n\'symbolic\'\n \'-s\' in \'ln\'.\n\n\'symbols\'\n Used in GDB and \'objdump\'.\n\n\'synclines\'\n \'-s\' in \'m4\'.\n\n\'sysname\'\n \'-s\' in \'uname\'.\n\n\'tabs\'\n \'-t\' in \'expand\' and \'unexpand\'.\n\n\'tabsize\'\n \'-T\' in \'ls\'.\n\n\'terminal\'\n \'-T\' in \'tput\' and \'ul\'. \'-t\' in \'wdiff\'.\n\n\'text\'\n \'-a\' in \'diff\'.\n\n\'text-files\'\n \'-T\' in \'shar\'.\n\n\'time\'\n Used in \'ls\' and \'touch\'.\n\n\'timeout\'\n Specify how long to wait before giving up on some operation.\n\n\'to-stdout\'\n \'-O\' in \'tar\'.\n\n\'total\'\n \'-c\' in \'du\'.\n\n\'touch\'\n \'-t\' in \'make\', \'ranlib\', and \'recode\'.\n\n\'trace\'\n \'-t\' in \'m4\'.\n\n\'traditional\'\n \'-t\' in \'hello\'; \'-W traditional\' in \'gawk\'; \'-G\' in \'ed\', \'m4\',\n and \'ptx\'.\n\n\'tty\'\n Used in GDB.\n\n\'typedefs\'\n \'-t\' in \'ctags\'.\n\n\'typedefs-and-c++\'\n \'-T\' in \'ctags\'.\n\n\'typeset-mode\'\n \'-t\' in \'ptx\'.\n\n\'uncompress\'\n \'-z\' in \'tar\'.\n\n\'unconditional\'\n \'-u\' in \'cpio\'.\n\n\'undefine\'\n \'-U\' in \'m4\'.\n\n\'undefined-only\'\n \'-u\' in \'nm\'.\n\n\'update\'\n \'-u\' in \'cp\', \'ctags\', \'mv\', \'tar\'.\n\n\'usage\'\n Used in \'gawk\'; same as \'--help\'.\n\n\'uuencode\'\n \'-B\' in \'shar\'.\n\n\'vanilla-operation\'\n \'-V\' in \'shar\'.\n\n\'verbose\'\n Print more information about progress. Many programs support this.\n\n\'verify\'\n \'-W\' in \'tar\'.\n\n\'version\'\n Print the version number.\n\n\'version-control\'\n \'-V\' in \'cp\', \'ln\', \'mv\'.\n\n\'vgrind\'\n \'-v\' in \'ctags\'.\n\n\'volume\'\n \'-V\' in \'tar\'.\n\n\'what-if\'\n \'-W\' in \'make\'.\n\n\'whole-size-limit\'\n \'-l\' in \'shar\'.\n\n\'width\'\n \'-w\' in \'ls\' and \'ptx\'.\n\n\'word-regexp\'\n \'-W\' in \'ptx\'.\n\n\'writable\'\n \'-T\' in \'who\'.\n\n\'zeros\'\n \'-z\' in \'gprof\'.\n\n4.10 OID Allocations\n====================\n\nThe OID (object identifier) 1.3.6.1.4.1.11591 has been assigned to the\nGNU Project (thanks to Sergey Poznyakoff). These are used for SNMP,\nLDAP, X.509 certificates, and so on. The web site\n<http://www.alvestrand.no/objectid> has a (voluntary) listing of many\nOID assignments.\n\n If you need a new slot for your GNU package, write\n<maintainers@gnu.org>. Here is a list of arcs currently assigned:\n\n\n 1.3.6.1.4.1.11591 GNU\n\n 1.3.6.1.4.1.11591.1 GNU Radius\n\n 1.3.6.1.4.1.11591.2 GnuPG\n 1.3.6.1.4.1.11591.2.1 notation\n 1.3.6.1.4.1.11591.2.1.1 pkaAddress\n\n 1.3.6.1.4.1.11591.3 GNU Radar\n\n 1.3.6.1.4.1.11591.4 GNU GSS\n\n 1.3.6.1.4.1.11591.5 GNU Mailutils\n\n 1.3.6.1.4.1.11591.6 GNU Shishi\n\n 1.3.6.1.4.1.11591.7 GNU Radio\n\n 1.3.6.1.4.1.11591.8 GNU Dico\n\n 1.3.6.1.4.1.11591.9 GNU Rush\n\n 1.3.6.1.4.1.11591.12 digestAlgorithm\n 1.3.6.1.4.1.11591.12.2 TIGER/192\n\n 1.3.6.1.4.1.11591.13 encryptionAlgorithm\n 1.3.6.1.4.1.11591.13.2 Serpent\n 1.3.6.1.4.1.11591.13.2.1 Serpent-128-ECB\n 1.3.6.1.4.1.11591.13.2.2 Serpent-128-CBC\n 1.3.6.1.4.1.11591.13.2.3 Serpent-128-OFB\n 1.3.6.1.4.1.11591.13.2.4 Serpent-128-CFB\n 1.3.6.1.4.1.11591.13.2.21 Serpent-192-ECB\n 1.3.6.1.4.1.11591.13.2.22 Serpent-192-CBC\n 1.3.6.1.4.1.11591.13.2.23 Serpent-192-OFB\n 1.3.6.1.4.1.11591.13.2.24 Serpent-192-CFB\n 1.3.6.1.4.1.11591.13.2.41 Serpent-256-ECB\n 1.3.6.1.4.1.11591.13.2.42 Serpent-256-CBC\n 1.3.6.1.4.1.11591.13.2.43 Serpent-256-OFB\n 1.3.6.1.4.1.11591.13.2.44 Serpent-256-CFB\n\n 1.3.6.1.4.1.11591.14 CRC algorithms\n 1.3.6.1.4.1.11591.14.1 CRC 32\n\n 1.3.6.1.4.1.11591.15 ellipticCurve\n 1.3.6.1.4.1.11591.15.1 Ed25519\n\n4.11 Memory Usage\n=================\n\nIf a program typically uses just a few meg of memory, don\'t bother\nmaking any effort to reduce memory usage. For example, if it is\nimpractical for other reasons to operate on files more than a few meg\nlong, it is reasonable to read entire input files into memory to operate\non them.\n\n However, for programs such as \'cat\' or \'tail\', that can usefully\noperate on very large files, it is important to avoid using a technique\nthat would artificially limit the size of files it can handle. If a\nprogram works by lines and could be applied to arbitrary user-supplied\ninput files, it should keep only a line in memory, because this is not\nvery hard and users will want to be able to operate on input files that\nare bigger than will fit in memory all at once.\n\n If your program creates complicated data structures, just make them\nin memory and give a fatal error if \'malloc\' returns \'NULL\'.\n\n Memory analysis tools such as \'valgrind\' can be useful, but don\'t\ncomplicate a program merely to avoid their false alarms. For example,\nif memory is used until just before a process exits, don\'t free it\nsimply to silence such a tool.\n\n4.12 File Usage\n===============\n\nPrograms should be prepared to operate when \'/usr\' and \'/etc\' are\nread-only file systems. Thus, if the program manages log files, lock\nfiles, backup files, score files, or any other files which are modified\nfor internal purposes, these files should not be stored in \'/usr\' or\n\'/etc\'.\n\n There are two exceptions. \'/etc\' is used to store system\nconfiguration information; it is reasonable for a program to modify\nfiles in \'/etc\' when its job is to update the system configuration.\nAlso, if the user explicitly asks to modify one file in a directory, it\nis reasonable for the program to store other files in the same\ndirectory.\n\n5 Making The Best Use of C\n**************************\n\nThis chapter provides advice on how best to use the C language when\nwriting GNU software.\n\n5.1 Formatting Your Source Code\n===============================\n\nPlease keep the length of source lines to 79 characters or less, for\nmaximum readability in the widest range of environments.\n\n It is important to put the open-brace that starts the body of a C\nfunction in column one, so that they will start a defun. Several tools\nlook for open-braces in column one to find the beginnings of C\nfunctions. These tools will not work on code not formatted that way.\n\n Avoid putting open-brace, open-parenthesis or open-bracket in column\none when they are inside a function, so that they won\'t start a defun.\nThe open-brace that starts a \'struct\' body can go in column one if you\nfind it useful to treat that definition as a defun.\n\n It is also important for function definitions to start the name of\nthe function in column one. This helps people to search for function\ndefinitions, and may also help certain tools recognize them. Thus,\nusing Standard C syntax, the format is this:\n\n static char *\n concat (char *s1, char *s2)\n {\n ...\n }\n\nor, if you want to use traditional C syntax, format the definition like\nthis:\n\n static char *\n concat (s1, s2) /* Name starts in column one here */\n char *s1, *s2;\n { /* Open brace in column one here */\n ...\n }\n\n In Standard C, if the arguments don\'t fit nicely on one line, split\nit like this:\n\n int\n lots_of_args (int an_integer, long a_long, short a_short,\n double a_double, float a_float)\n ...\n\n For \'struct\' and \'enum\' types, likewise put the braces in column one,\nunless the whole contents fits on one line:\n\n struct foo\n {\n int a, b;\n }\nor\n struct foo { int a, b; }\n\n The rest of this section gives our recommendations for other aspects\nof C formatting style, which is also the default style of the \'indent\'\nprogram in version 1.2 and newer. It corresponds to the options\n\n -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2\n -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsob\n\n We don\'t think of these recommendations as requirements, because it\ncauses no problems for users if two different programs have different\nformatting styles.\n\n But whatever style you use, please use it consistently, since a\nmixture of styles within one program tends to look ugly. If you are\ncontributing changes to an existing program, please follow the style of\nthat program.\n\n For the body of the function, our recommended style looks like this:\n\n if (x < foo (y, z))\n haha = bar[4] + 5;\n else\n {\n while (z)\n {\n haha += foo (z, z);\n z--;\n }\n return ++x + bar ();\n }\n\n We find it easier to read a program when it has spaces before the\nopen-parentheses and after the commas. Especially after the commas.\n\n When you split an expression into multiple lines, split it before an\noperator, not after one. Here is the right way:\n\n if (foo_this_is_long && bar > win (x, y, z)\n && remaining_condition)\n\n Try to avoid having two operators of different precedence at the same\nlevel of indentation. For example, don\'t write this:\n\n mode = (inmode[j] == VOIDmode\n || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])\n ? outmode[j] : inmode[j]);\n\n Instead, use extra parentheses so that the indentation shows the\nnesting:\n\n mode = ((inmode[j] == VOIDmode\n || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])))\n ? outmode[j] : inmode[j]);\n\n Insert extra parentheses so that Emacs will indent the code properly.\nFor example, the following indentation looks nice if you do it by hand,\n\n v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000\n + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;\n\nbut Emacs would alter it. Adding a set of parentheses produces\nsomething that looks equally nice, and which Emacs will preserve:\n\n v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000\n + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);\n\n Format do-while statements like this:\n\n do\n {\n a = foo (a);\n }\n while (a > 0);\n\n Please use formfeed characters (control-L) to divide the program into\npages at logical places (but not within a function). It does not matter\njust how long the pages are, since they do not have to fit on a printed\npage. The formfeeds should appear alone on lines by themselves.\n\n5.2 Commenting Your Work\n========================\n\nEvery program should start with a comment saying briefly what it is for.\nExample: \'fmt - filter for simple filling of text\'. This comment should\nbe at the top of the source file containing the \'main\' function of the\nprogram.\n\n Also, please write a brief comment at the start of each source file,\nwith the file name and a line or two about the overall purpose of the\nfile.\n\n Please write the comments in a GNU program in English, because\nEnglish is the one language that nearly all programmers in all countries\ncan read. If you do not write English well, please write comments in\nEnglish as well as you can, then ask other people to help rewrite them.\nIf you can\'t write comments in English, please find someone to work with\nyou and translate your comments into English.\n\n Please put a comment on each function saying what the function does,\nwhat sorts of arguments it gets, and what the possible values of\narguments mean and are used for. It is not necessary to duplicate in\nwords the meaning of the C argument declarations, if a C type is being\nused in its customary fashion. If there is anything nonstandard about\nits use (such as an argument of type \'char *\' which is really the\naddress of the second character of a string, not the first), or any\npossible values that would not work the way one would expect (such as,\nthat strings containing newlines are not guaranteed to work), be sure to\nsay so.\n\n Also explain the significance of the return value, if there is one.\n\n Please put two spaces after the end of a sentence in your comments,\nso that the Emacs sentence commands will work. Also, please write\ncomplete sentences and capitalize the first word. If a lower-case\nidentifier comes at the beginning of a sentence, don\'t capitalize it!\nChanging the spelling makes it a different identifier. If you don\'t\nlike starting a sentence with a lower case letter, write the sentence\ndifferently (e.g., "The identifier lower-case is ...").\n\n The comment on a function is much clearer if you use the argument\nnames to speak about the argument values. The variable name itself\nshould be lower case, but write it in upper case when you are speaking\nabout the value rather than the variable itself. Thus, "the inode\nnumber NODE_NUM" rather than "an inode".\n\n There is usually no purpose in restating the name of the function in\nthe comment before it, because readers can see that for themselves.\nThere might be an exception when the comment is so long that the\nfunction itself would be off the bottom of the screen.\n\n There should be a comment on each static variable as well, like this:\n\n /* Nonzero means truncate lines in the display;\n zero means continue them. */\n int truncate_lines;\n\n Every \'#endif\' should have a comment, except in the case of short\nconditionals (just a few lines) that are not nested. The comment should\nstate the condition of the conditional that is ending, _including its\nsense_. \'#else\' should have a comment describing the condition _and\nsense_ of the code that follows. For example:\n\n #ifdef foo\n ...\n #else /* not foo */\n ...\n #endif /* not foo */\n #ifdef foo\n ...\n #endif /* foo */\n\nbut, by contrast, write the comments this way for a \'#ifndef\':\n\n #ifndef foo\n ...\n #else /* foo */\n ...\n #endif /* foo */\n #ifndef foo\n ...\n #endif /* not foo */\n\n5.3 Clean Use of C Constructs\n=============================\n\nPlease explicitly declare the types of all objects. For example, you\nshould explicitly declare all arguments to functions, and you should\ndeclare functions to return \'int\' rather than omitting the \'int\'.\n\n Some programmers like to use the GCC \'-Wall\' option, and change the\ncode whenever it issues a warning. If you want to do this, then do.\nOther programmers prefer not to use \'-Wall\', because it gives warnings\nfor valid and legitimate code which they do not want to change. If you\nwant to do this, then do. The compiler should be your servant, not your\nmaster.\n\n Don\'t make the program ugly just to placate static analysis tools\nsuch as \'lint\', \'clang\', and GCC with extra warnings options such as\n\'-Wconversion\' and \'-Wundef\'. These tools can help find bugs and\nunclear code, but they can also generate so many false alarms that it\nhurts readability to silence them with unnecessary casts, wrappers, and\nother complications. For example, please don\'t insert casts to \'void\'\nor calls to do-nothing functions merely to pacify a lint checker.\n\n Declarations of external functions and functions to appear later in\nthe source file should all go in one place near the beginning of the\nfile (somewhere before the first function definition in the file), or\nelse should go in a header file. Don\'t put \'extern\' declarations inside\nfunctions.\n\n It used to be common practice to use the same local variables (with\nnames like \'tem\') over and over for different values within one\nfunction. Instead of doing this, it is better to declare a separate\nlocal variable for each distinct purpose, and give it a name which is\nmeaningful. This not only makes programs easier to understand, it also\nfacilitates optimization by good compilers. You can also move the\ndeclaration of each local variable into the smallest scope that includes\nall its uses. This makes the program even cleaner.\n\n Don\'t use local variables or parameters that shadow global\nidentifiers. GCC\'s \'-Wshadow\' option can detect this problem.\n\n Don\'t declare multiple variables in one declaration that spans lines.\nStart a new declaration on each line, instead. For example, instead of\nthis:\n\n int foo,\n bar;\n\nwrite either this:\n\n int foo, bar;\n\nor this:\n\n int foo;\n int bar;\n\n(If they are global variables, each should have a comment preceding it\nanyway.)\n\n When you have an \'if\'-\'else\' statement nested in another \'if\'\nstatement, always put braces around the \'if\'-\'else\'. Thus, never write\nlike this:\n\n if (foo)\n if (bar)\n win ();\n else\n lose ();\n\nalways like this:\n\n if (foo)\n {\n if (bar)\n win ();\n else\n lose ();\n }\n\n If you have an \'if\' statement nested inside of an \'else\' statement,\neither write \'else if\' on one line, like this,\n\n if (foo)\n ...\n else if (bar)\n ...\n\nwith its \'then\'-part indented like the preceding \'then\'-part, or write\nthe nested \'if\' within braces like this:\n\n if (foo)\n ...\n else\n {\n if (bar)\n ...\n }\n\n Don\'t declare both a structure tag and variables or typedefs in the\nsame declaration. Instead, declare the structure tag separately and\nthen use it to declare the variables or typedefs.\n\n Try to avoid assignments inside \'if\'-conditions (assignments inside\n\'while\'-conditions are ok). For example, don\'t write this:\n\n if ((foo = (char *) malloc (sizeof *foo)) == NULL)\n fatal ("virtual memory exhausted");\n\ninstead, write this:\n\n foo = (char *) malloc (sizeof *foo);\n if (foo == NULL)\n fatal ("virtual memory exhausted");\n\n5.4 Naming Variables, Functions, and Files\n==========================================\n\nThe names of global variables and functions in a program serve as\ncomments of a sort. So don\'t choose terse names--instead, look for\nnames that give useful information about the meaning of the variable or\nfunction. In a GNU program, names should be English, like other\ncomments.\n\n Local variable names can be shorter, because they are used only\nwithin one context, where (presumably) comments explain their purpose.\n\n Try to limit your use of abbreviations in symbol names. It is ok to\nmake a few abbreviations, explain what they mean, and then use them\nfrequently, but don\'t use lots of obscure abbreviations.\n\n Please use underscores to separate words in a name, so that the Emacs\nword commands can be useful within them. Stick to lower case; reserve\nupper case for macros and \'enum\' constants, and for name-prefixes that\nfollow a uniform convention.\n\n For example, you should use names like \'ignore_space_change_flag\';\ndon\'t use names like \'iCantReadThis\'.\n\n Variables that indicate whether command-line options have been\nspecified should be named after the meaning of the option, not after the\noption-letter. A comment should state both the exact meaning of the\noption and its letter. For example,\n\n /* Ignore changes in horizontal whitespace (-b). */\n int ignore_space_change_flag;\n\n When you want to define names with constant integer values, use\n\'enum\' rather than \'#define\'. GDB knows about enumeration constants.\n\n You might want to make sure that none of the file names would\nconflict if the files were loaded onto an MS-DOS file system which\nshortens the names. You can use the program \'doschk\' to test for this.\n\n Some GNU programs were designed to limit themselves to file names of\n14 characters or less, to avoid file name conflicts if they are read\ninto older System V systems. Please preserve this feature in the\nexisting GNU programs that have it, but there is no need to do this in\nnew GNU programs. \'doschk\' also reports file names longer than 14\ncharacters.\n\n5.5 Portability between System Types\n====================================\n\nIn the Unix world, "portability" refers to porting to different Unix\nversions. For a GNU program, this kind of portability is desirable, but\nnot paramount.\n\n The primary purpose of GNU software is to run on top of the GNU\nkernel, compiled with the GNU C compiler, on various types of CPU. So\nthe kinds of portability that are absolutely necessary are quite\nlimited. But it is important to support Linux-based GNU systems, since\nthey are the form of GNU that is popular.\n\n Beyond that, it is good to support the other free operating systems\n(*BSD), and it is nice to support other Unix-like systems if you want\nto. Supporting a variety of Unix-like systems is desirable, although\nnot paramount. It is usually not too hard, so you may as well do it.\nBut you don\'t have to consider it an obligation, if it does turn out to\nbe hard.\n\n The easiest way to achieve portability to most Unix-like systems is\nto use Autoconf. It\'s unlikely that your program needs to know more\ninformation about the host platform than Autoconf can provide, simply\nbecause most of the programs that need such knowledge have already been\nwritten.\n\n Avoid using the format of semi-internal data bases (e.g.,\ndirectories) when there is a higher-level alternative (\'readdir\').\n\n As for systems that are not like Unix, such as MSDOS, Windows, VMS,\nMVS, and older Macintosh systems, supporting them is often a lot of\nwork. When that is the case, it is better to spend your time adding\nfeatures that will be useful on GNU and GNU/Linux, rather than on\nsupporting other incompatible systems.\n\n If you do support Windows, please do not abbreviate it as "win". In\nhacker terminology, calling something a "win" is a form of praise.\nYou\'re free to praise Microsoft Windows on your own if you want, but\nplease don\'t do this in GNU packages. Instead of abbreviating "Windows"\nto "win", you can write it in full or abbreviate it to "woe" or "w". In\nGNU Emacs, for instance, we use \'w32\' in file names of Windows-specific\nfiles, but the macro for Windows conditionals is called \'WINDOWSNT\'.\n\n It is a good idea to define the "feature test macro" \'_GNU_SOURCE\'\nwhen compiling your C files. When you compile on GNU or GNU/Linux, this\nwill enable the declarations of GNU library extension functions, and\nthat will usually give you a compiler error message if you define the\nsame function names in some other way in your program. (You don\'t have\nto actually _use_ these functions, if you prefer to make the program\nmore portable to other systems.)\n\n But whether or not you use these GNU extensions, you should avoid\nusing their names for any other meanings. Doing so would make it hard\nto move your code into other GNU programs.\n\n5.6 Portability between CPUs\n============================\n\nEven GNU systems will differ because of differences among CPU types--for\nexample, difference in byte ordering and alignment requirements. It is\nabsolutely essential to handle these differences. However, don\'t make\nany effort to cater to the possibility that an \'int\' will be less than\n32 bits. We don\'t support 16-bit machines in GNU.\n\n Similarly, don\'t make any effort to cater to the possibility that\n\'long\' will be smaller than predefined types like \'size_t\'. For\nexample, the following code is ok:\n\n printf ("size = %lu\\n", (unsigned long) sizeof array);\n printf ("diff = %ld\\n", (long) (pointer2 - pointer1));\n\n 1989 Standard C requires this to work, and we know of only one\ncounterexample: 64-bit programs on Microsoft Windows. We will leave it\nto those who want to port GNU programs to that environment to figure out\nhow to do it.\n\n Predefined file-size types like \'off_t\' are an exception: they are\nlonger than \'long\' on many platforms, so code like the above won\'t work\nwith them. One way to print an \'off_t\' value portably is to print its\ndigits yourself, one by one.\n\n Don\'t assume that the address of an \'int\' object is also the address\nof its least-significant byte. This is false on big-endian machines.\nThus, don\'t make the following mistake:\n\n int c;\n ...\n while ((c = getchar ()) != EOF)\n write (file_descriptor, &c, 1);\n\nInstead, use \'unsigned char\' as follows. (The \'unsigned\' is for\nportability to unusual systems where \'char\' is signed and where there is\ninteger overflow checking.)\n\n int c;\n while ((c = getchar ()) != EOF)\n {\n unsigned char u = c;\n write (file_descriptor, &u, 1);\n }\n\n Avoid casting pointers to integers if you can. Such casts greatly\nreduce portability, and in most programs they are easy to avoid. In the\ncases where casting pointers to integers is essential--such as, a Lisp\ninterpreter which stores type information as well as an address in one\nword--you\'ll have to make explicit provisions to handle different word\nsizes. You will also need to make provision for systems in which the\nnormal range of addresses you can get from \'malloc\' starts far away from\nzero.\n\n5.7 Calling System Functions\n============================\n\nHistorically, C implementations differed substantially, and many systems\nlacked a full implementation of ANSI/ISO C89. Nowadays, however, all\npractical systems have a C89 compiler and GNU C supports almost all of\nC99 and some of C11. Similarly, most systems implement POSIX.1-2001\nlibraries and tools, and many have POSIX.1-2008.\n\n Hence, there is little reason to support old C or non-POSIX systems,\nand you may want to take advantage of standard C and POSIX to write\nclearer, more portable, or faster code. You should use standard\ninterfaces where possible; but if GNU extensions make your program more\nmaintainable, powerful, or otherwise better, don\'t hesitate to use them.\nIn any case, don\'t make your own declaration of system functions; that\'s\na recipe for conflict.\n\n Despite the standards, nearly every library function has some sort of\nportability issue on some system or another. Here are some examples:\n\n\'open\'\n Names with trailing \'/\'\'s are mishandled on many platforms.\n\n\'printf\'\n \'long double\' may be unimplemented; floating values Infinity and\n NaN are often mishandled; output for large precisions may be\n incorrect.\n\n\'readlink\'\n May return \'int\' instead of \'ssize_t\'.\n\n\'scanf\'\n On Windows, \'errno\' is not set on failure.\n\n Gnulib (http://www.gnu.org/software/gnulib/) is a big help in this\nregard. Gnulib provides implementations of standard interfaces on many\nof the systems that lack them, including portable implementations of\nenhanced GNU interfaces, thereby making their use portable, and of\nPOSIX-1.2008 interfaces, some of which are missing even on up-to-date\nGNU systems.\n\n Gnulib also provides many useful non-standard interfaces; for\nexample, C implementations of standard data structures (hash tables,\nbinary trees), error-checking type-safe wrappers for memory allocation\nfunctions (\'xmalloc\', \'xrealloc\'), and output of error messages.\n\n Gnulib integrates with GNU Autoconf and Automake to remove much of\nthe burden of writing portable code from the programmer: Gnulib makes\nyour configure script automatically determine what features are missing\nand use the Gnulib code to supply the missing pieces.\n\n The Gnulib and Autoconf manuals have extensive sections on\nportability: *note Introduction: (gnulib)Top. and *note\n(autoconf)Portable C and C++::. Please consult them for many more\ndetails.\n\n5.8 Internationalization\n========================\n\nGNU has a library called GNU gettext that makes it easy to translate the\nmessages in a program into various languages. You should use this\nlibrary in every program. Use English for the messages as they appear\nin the program, and let gettext provide the way to translate them into\nother languages.\n\n Using GNU gettext involves putting a call to the \'gettext\' macro\naround each string that might need translation--like this:\n\n printf (gettext ("Processing file \'%s\'..."), file);\n\nThis permits GNU gettext to replace the string \'"Processing file\n\'%s\'..."\' with a translated version.\n\n Once a program uses gettext, please make a point of writing calls to\n\'gettext\' when you add new strings that call for translation.\n\n Using GNU gettext in a package involves specifying a "text domain\nname" for the package. The text domain name is used to separate the\ntranslations for this package from the translations for other packages.\nNormally, the text domain name should be the same as the name of the\npackage--for example, \'coreutils\' for the GNU core utilities.\n\n To enable gettext to work well, avoid writing code that makes\nassumptions about the structure of words or sentences. When you want\nthe precise text of a sentence to vary depending on the data, use two or\nmore alternative string constants each containing a complete sentences,\nrather than inserting conditionalized words or phrases into a single\nsentence framework.\n\n Here is an example of what not to do:\n\n printf ("%s is full", capacity > 5000000 ? "disk" : "floppy disk");\n\n If you apply gettext to all strings, like this,\n\n printf (gettext ("%s is full"),\n capacity > 5000000 ? gettext ("disk") : gettext ("floppy disk"));\n\nthe translator will hardly know that "disk" and "floppy disk" are meant\nto be substituted in the other string. Worse, in some languages (like\nFrench) the construction will not work: the translation of the word\n"full" depends on the gender of the first part of the sentence; it\nhappens to be not the same for "disk" as for "floppy disk".\n\n Complete sentences can be translated without problems:\n\n printf (capacity > 5000000 ? gettext ("disk is full")\n : gettext ("floppy disk is full"));\n\n A similar problem appears at the level of sentence structure with\nthis code:\n\n printf ("# Implicit rule search has%s been done.\\n",\n f->tried_implicit ? "" : " not");\n\nAdding \'gettext\' calls to this code cannot give correct results for all\nlanguages, because negation in some languages requires adding words at\nmore than one place in the sentence. By contrast, adding \'gettext\'\ncalls does the job straightforwardly if the code starts out like this:\n\n printf (f->tried_implicit\n ? "# Implicit rule search has been done.\\n",\n : "# Implicit rule search has not been done.\\n");\n\n Another example is this one:\n\n printf ("%d file%s processed", nfiles,\n nfiles != 1 ? "s" : "");\n\nThe problem with this example is that it assumes that plurals are made\nby adding \'s\'. If you apply gettext to the format string, like this,\n\n printf (gettext ("%d file%s processed"), nfiles,\n nfiles != 1 ? "s" : "");\n\nthe message can use different words, but it will still be forced to use\n\'s\' for the plural. Here is a better way, with gettext being applied to\nthe two strings independently:\n\n printf ((nfiles != 1 ? gettext ("%d files processed")\n : gettext ("%d file processed")),\n nfiles);\n\nBut this still doesn\'t work for languages like Polish, which has three\nplural forms: one for nfiles == 1, one for nfiles == 2, 3, 4, 22, 23,\n24, ... and one for the rest. The GNU \'ngettext\' function solves this\nproblem:\n\n printf (ngettext ("%d files processed", "%d file processed", nfiles),\n nfiles);\n\n5.9 Character Set\n=================\n\nSticking to the ASCII character set (plain text, 7-bit characters) is\npreferred in GNU source code comments, text documents, and other\ncontexts, unless there is good reason to do something else because of\nthe application domain. For example, if source code deals with the\nFrench Revolutionary calendar, it is OK if its literal strings contain\naccented characters in month names like "Flore\'al". Also, it is OK (but\nnot required) to use non-ASCII characters to represent proper names of\ncontributors in change logs (*note Change Logs::).\n\n If you need to use non-ASCII characters, you should normally stick\nwith one encoding, certainly within a single file. UTF-8 is likely to\nbe the best choice.\n\n5.10 Quote Characters\n=====================\n\nIn the C locale, the output of GNU programs should stick to plain ASCII\nfor quotation characters in messages to users: preferably 0x22 (\'"\') or\n0x27 (\'\'\') for both opening and closing quotes. Although GNU programs\ntraditionally used 0x60 (\'`\') for opening and 0x27 (\'\'\') for closing\nquotes, nowadays quotes \'`like this\'\' are typically rendered\nasymmetrically, so quoting \'"like this"\' or \'\'like this\'\' typically\nlooks better.\n\n It is ok, but not required, for GNU programs to generate\nlocale-specific quotes in non-C locales. For example:\n\n printf (gettext ("Processing file \'%s\'..."), file);\n\nHere, a French translation might cause \'gettext\' to return the string\n\'"Traitement de fichier < %s >..."\', yielding quotes more appropriate\nfor a French locale.\n\n Sometimes a program may need to use opening and closing quotes\ndirectly. By convention, \'gettext\' translates the string \'"`"\' to the\nopening quote and the string \'"\'"\' to the closing quote, and a program\ncan use these translations. Generally, though, it is better to\ntranslate quote characters in the context of longer strings.\n\n If the output of your program is ever likely to be parsed by another\nprogram, it is good to provide an option that makes this parsing\nreliable. For example, you could escape special characters using\nconventions from the C language or the Bourne shell. See for example\nthe option \'--quoting-style\' of GNU \'ls\'.\n\n5.11 Mmap\n=========\n\nIf you use \'mmap\' to read or write files, don\'t assume it either works\non all files or fails for all files. It may work on some files and fail\non others.\n\n The proper way to use \'mmap\' is to try it on the specific file for\nwhich you want to use it--and if \'mmap\' doesn\'t work, fall back on doing\nthe job in another way using \'read\' and \'write\'.\n\n The reason this precaution is needed is that the GNU kernel (the\nHURD) provides a user-extensible file system, in which there can be many\ndifferent kinds of "ordinary files". Many of them support \'mmap\', but\nsome do not. It is important to make programs handle all these kinds of\nfiles.\n\n6 Documenting Programs\n**********************\n\nA GNU program should ideally come with full free documentation, adequate\nfor both reference and tutorial purposes. If the package can be\nprogrammed or extended, the documentation should cover programming or\nextending it, as well as just using it.\n\n6.1 GNU Manuals\n===============\n\nThe preferred document format for the GNU system is the Texinfo\nformatting language. Every GNU package should (ideally) have\ndocumentation in Texinfo both for reference and for learners. Texinfo\nmakes it possible to produce a good quality formatted book, using TeX,\nand to generate an Info file. It is also possible to generate HTML\noutput from Texinfo source. See the Texinfo manual, either the\nhardcopy, or the on-line version available through \'info\' or the Emacs\nInfo subsystem (\'C-h i\').\n\n Nowadays some other formats such as Docbook and Sgmltexi can be\nconverted automatically into Texinfo. It is ok to produce the Texinfo\ndocumentation by conversion this way, as long as it gives good results.\n\n Make sure your manual is clear to a reader who knows nothing about\nthe topic and reads it straight through. This means covering basic\ntopics at the beginning, and advanced topics only later. This also\nmeans defining every specialized term when it is first used.\n\n Programmers tend to carry over the structure of the program as the\nstructure for its documentation. But this structure is not necessarily\ngood for explaining how to use the program; it may be irrelevant and\nconfusing for a user.\n\n Instead, the right way to structure documentation is according to the\nconcepts and questions that a user will have in mind when reading it.\nThis principle applies at every level, from the lowest (ordering\nsentences in a paragraph) to the highest (ordering of chapter topics\nwithin the manual). Sometimes this structure of ideas matches the\nstructure of the implementation of the software being documented--but\noften they are different. An important part of learning to write good\ndocumentation is to learn to notice when you have unthinkingly\nstructured the documentation like the implementation, stop yourself, and\nlook for better alternatives.\n\n For example, each program in the GNU system probably ought to be\ndocumented in one manual; but this does not mean each program should\nhave its own manual. That would be following the structure of the\nimplementation, rather than the structure that helps the user\nunderstand.\n\n Instead, each manual should cover a coherent _topic_. For example,\ninstead of a manual for \'diff\' and a manual for \'diff3\', we have one\nmanual for "comparison of files" which covers both of those programs, as\nwell as \'cmp\'. By documenting these programs together, we can make the\nwhole subject clearer.\n\n The manual which discusses a program should certainly document all of\nthe program\'s command-line options and all of its commands. It should\ngive examples of their use. But don\'t organize the manual as a list of\nfeatures. Instead, organize it logically, by subtopics. Address the\nquestions that a user will ask when thinking about the job that the\nprogram does. Don\'t just tell the reader what each feature can do--say\nwhat jobs it is good for, and show how to use it for those jobs.\nExplain what is recommended usage, and what kinds of usage users should\navoid.\n\n In general, a GNU manual should serve both as tutorial and reference.\nIt should be set up for convenient access to each topic through Info,\nand for reading straight through (appendixes aside). A GNU manual\nshould give a good introduction to a beginner reading through from the\nstart, and should also provide all the details that hackers want. The\nBison manual is a good example of this--please take a look at it to see\nwhat we mean.\n\n That is not as hard as it first sounds. Arrange each chapter as a\nlogical breakdown of its topic, but order the sections, and write their\ntext, so that reading the chapter straight through makes sense. Do\nlikewise when structuring the book into chapters, and when structuring a\nsection into paragraphs. The watchword is, _at each point, address the\nmost fundamental and important issue raised by the preceding text._\n\n If necessary, add extra chapters at the beginning of the manual which\nare purely tutorial and cover the basics of the subject. These provide\nthe framework for a beginner to understand the rest of the manual. The\nBison manual provides a good example of how to do this.\n\n To serve as a reference, a manual should have an Index that lists all\nthe functions, variables, options, and important concepts that are part\nof the program. One combined Index should do for a short manual, but\nsometimes for a complex package it is better to use multiple indices.\nThe Texinfo manual includes advice on preparing good index entries, see\n*note Making Index Entries: (texinfo)Index Entries, and see *note\nDefining the Entries of an Index: (texinfo)Indexing Commands.\n\n Don\'t use Unix man pages as a model for how to write GNU\ndocumentation; most of them are terse, badly structured, and give\ninadequate explanation of the underlying concepts. (There are, of\ncourse, some exceptions.) Also, Unix man pages use a particular format\nwhich is different from what we use in GNU manuals.\n\n Please include an email address in the manual for where to report\nbugs _in the text of the manual_.\n\n Please do not use the term "pathname" that is used in Unix\ndocumentation; use "file name" (two words) instead. We use the term\n"path" only for search paths, which are lists of directory names.\n\n Please do not use the term "illegal" to refer to erroneous input to a\ncomputer program. Please use "invalid" for this, and reserve the term\n"illegal" for activities prohibited by law.\n\n Please do not write \'()\' after a function name just to indicate it is\na function. \'foo ()\' is not a function, it is a function call with no\narguments.\n\n Whenever possible, please stick to the active voice, avoiding the\npassive, and use the present tense, not the future teste. For instance,\nwrite "The function \'foo\' returns a list containing A and B" rather than\n"A list containing A and B will be returned." One advantage of the\nactive voice is it requires you to state the subject of the sentence;\nwith the passive voice, you might omit the subject, which leads to\nvagueness.\n\n It is proper to use the future tense when grammar demands it, as in,\n"If you type \'x\', the computer will self-destruct in 10 seconds."\n\n6.2 Doc Strings and Manuals\n===========================\n\nSome programming systems, such as Emacs, provide a documentation string\nfor each function, command or variable. You may be tempted to write a\nreference manual by compiling the documentation strings and writing a\nlittle additional text to go around them--but you must not do it. That\napproach is a fundamental mistake. The text of well-written\ndocumentation strings will be entirely wrong for a manual.\n\n A documentation string needs to stand alone--when it appears on the\nscreen, there will be no other text to introduce or explain it.\nMeanwhile, it can be rather informal in style.\n\n The text describing a function or variable in a manual must not stand\nalone; it appears in the context of a section or subsection. Other text\nat the beginning of the section should explain some of the concepts, and\nshould often make some general points that apply to several functions or\nvariables. The previous descriptions of functions and variables in the\nsection will also have given information about the topic. A description\nwritten to stand alone would repeat some of that information; this\nredundancy looks bad. Meanwhile, the informality that is acceptable in\na documentation string is totally unacceptable in a manual.\n\n The only good way to use documentation strings in writing a good\nmanual is to use them as a source of information for writing good text.\n\n6.3 Manual Structure Details\n============================\n\nThe title page of the manual should state the version of the programs or\npackages documented in the manual. The Top node of the manual should\nalso contain this information. If the manual is changing more\nfrequently than or independent of the program, also state a version\nnumber for the manual in both of these places.\n\n Each program documented in the manual should have a node named\n\'PROGRAM Invocation\' or \'Invoking PROGRAM\'. This node (together with\nits subnodes, if any) should describe the program\'s command line\narguments and how to run it (the sort of information people would look\nfor in a man page). Start with an \'@example\' containing a template for\nall the options and arguments that the program uses.\n\n Alternatively, put a menu item in some menu whose item name fits one\nof the above patterns. This identifies the node which that item points\nto as the node for this purpose, regardless of the node\'s actual name.\n\n The \'--usage\' feature of the Info reader looks for such a node or\nmenu item in order to find the relevant text, so it is essential for\nevery Texinfo file to have one.\n\n If one manual describes several programs, it should have such a node\nfor each program described in the manual.\n\n6.4 License for Manuals\n=======================\n\nPlease use the GNU Free Documentation License for all GNU manuals that\nare more than a few pages long. Likewise for a collection of short\ndocuments--you only need one copy of the GNU FDL for the whole\ncollection. For a single short document, you can use a very permissive\nnon-copyleft license, to avoid taking up space with a long license.\n\n See <http://www.gnu.org/copyleft/fdl-howto.html> for more explanation\nof how to employ the GFDL.\n\n Note that it is not obligatory to include a copy of the GNU GPL or\nGNU LGPL in a manual whose license is neither the GPL nor the LGPL. It\ncan be a good idea to include the program\'s license in a large manual;\nin a short manual, whose size would be increased considerably by\nincluding the program\'s license, it is probably better not to include\nit.\n\n6.5 Manual Credits\n==================\n\nPlease credit the principal human writers of the manual as the authors,\non the title page of the manual. If a company sponsored the work, thank\nthe company in a suitable place in the manual, but do not cite the\ncompany as an author.\n\n6.6 Printed Manuals\n===================\n\nThe FSF publishes some GNU manuals in printed form. To encourage sales\nof these manuals, the on-line versions of the manual should mention at\nthe very start that the printed manual is available and should point at\ninformation for getting it--for instance, with a link to the page\n<http://www.gnu.org/order/order.html>. This should not be included in\nthe printed manual, though, because there it is redundant.\n\n It is also useful to explain in the on-line forms of the manual how\nthe user can print out the manual from the sources.\n\n6.7 The NEWS File\n=================\n\nIn addition to its manual, the package should have a file named \'NEWS\'\nwhich contains a list of user-visible changes worth mentioning. In each\nnew release, add items to the front of the file and identify the version\nthey pertain to. Don\'t discard old items; leave them in the file after\nthe newer items. This way, a user upgrading from any previous version\ncan see what is new.\n\n If the \'NEWS\' file gets very long, move some of the older items into\na file named \'ONEWS\' and put a note at the end referring the user to\nthat file.\n\n6.8 Change Logs\n===============\n\nKeep a change log to describe all the changes made to program source\nfiles. The purpose of this is so that people investigating bugs in the\nfuture will know about the changes that might have introduced the bug.\nOften a new bug can be found by looking at what was recently changed.\nMore importantly, change logs can help you eliminate conceptual\ninconsistencies between different parts of a program, by giving you a\nhistory of how the conflicting concepts arose and who they came from.\n\n6.8.1 Change Log Concepts\n-------------------------\n\nYou can think of the change log as a conceptual "undo list" which\nexplains how earlier versions were different from the current version.\nPeople can see the current version; they don\'t need the change log to\ntell them what is in it. What they want from a change log is a clear\nexplanation of how the earlier version differed. Each "entry" in a\nchange log describes either an individual change or the smallest batch\nof changes that belong together, also known as a "change set". For\nlater reference or for summarizing, sometimes it is useful to start the\nentry with a one-line description (sometimes called a "title") to\ndescribe its overall purpose.\n\n In the past, we recommended not mentioning changes in non-software\nfiles (manuals, help files, media files, etc.) in change logs. However,\nwe\'ve been advised that it is a good idea to include them, for the sake\nof copyright records.\n\n The change log file is normally called \'ChangeLog\' and covers an\nentire directory. Each directory can have its own change log, or a\ndirectory can use the change log of its parent directory--it\'s up to\nyou.\n\n Another alternative is to record change log information with a\nversion control system such as RCS or CVS. This can be converted\nautomatically to a \'ChangeLog\' file using \'rcs2log\'; in Emacs, the\ncommand \'C-x v a\' (\'vc-update-change-log\') does the job.\n\n For changes to code, there\'s no need to describe the full purpose of\nthe changes or how they work together. If you think that a change calls\nfor explanation, you\'re probably right. Please do explain it--but\nplease put the full explanation in comments in the code, where people\nwill see it whenever they see the code. For example, "New function" is\nenough for the change log when you add a function, because there should\nbe a comment before the function definition to explain what it does, how\nto call it, and so on.\n\n For changes to files that do not support a comment syntax (e.g.,\nmedia files), it is ok to include the full explanation in the change log\nfile, after the title and before the list of individual changes.\n\n The easiest way to add an entry to \'ChangeLog\' is with the Emacs\ncommand \'M-x add-change-log-entry\'. An individual change should have an\nasterisk, the name of the changed file, and then in parentheses the name\nof the changed functions, variables or whatever, followed by a colon.\nThen describe the changes you made to that function or variable.\n\n6.8.2 Style of Change Logs\n--------------------------\n\nHere are some simple examples of change log entries, starting with the\nheader line that says who made the change and when it was installed,\nfollowed by descriptions of specific changes. (These examples are drawn\nfrom Emacs and GCC.)\n\n 1998-08-17 Richard Stallman <rms@gnu.org>\n\n * register.el (insert-register): Return nil.\n (jump-to-register): Likewise.\n\n * sort.el (sort-subr): Return nil.\n\n * tex-mode.el (tex-bibtex-file, tex-file, tex-region):\n Restart the tex shell if process is gone or stopped.\n (tex-shell-running): New function.\n\n * expr.c (store_one_arg): Round size up for move_block_to_reg.\n (expand_call): Round up when emitting USE insns.\n * stmt.c (assign_parms): Round size up for move_block_from_reg.\n\n It\'s important to name the changed function or variable in full.\nDon\'t abbreviate function or variable names, and don\'t combine them.\nSubsequent maintainers will often search for a function name to find all\nthe change log entries that pertain to it; if you abbreviate the name,\nthey won\'t find it when they search.\n\n For example, some people are tempted to abbreviate groups of function\nnames by writing \'* register.el ({insert,jump-to}-register)\'; this is\nnot a good idea, since searching for \'jump-to-register\' or\n\'insert-register\' would not find that entry.\n\n Separate unrelated change log entries with blank lines. Don\'t put\nblank lines between individual changes of an entry. You can omit the\nfile name and the asterisk when successive individual changes are in the\nsame file.\n\n Break long lists of function names by closing continued lines with\n\')\', rather than \',\', and opening the continuation with \'(\' as in this\nexample:\n\n * keyboard.c (menu_bar_items, tool_bar_items)\n (Fexecute_extended_command): Deal with \'keymap\' property.\n\n When you install someone else\'s changes, put the contributor\'s name\nin the change log entry rather than in the text of the entry. In other\nwords, write this:\n\n 2002-07-14 John Doe <jdoe@gnu.org>\n\n * sewing.c: Make it sew.\n\nrather than this:\n\n 2002-07-14 Usual Maintainer <usual@gnu.org>\n\n * sewing.c: Make it sew. Patch by jdoe@gnu.org.\n\n As for the date, that should be the date you applied the change.\n\n6.8.3 Simple Changes\n--------------------\n\nCertain simple kinds of changes don\'t need much detail in the change\nlog.\n\n When you change the calling sequence of a function in a simple\nfashion, and you change all the callers of the function to use the new\ncalling sequence, there is no need to make individual entries for all\nthe callers that you changed. Just write in the entry for the function\nbeing called, "All callers changed"--like this:\n\n * keyboard.c (Fcommand_execute): New arg SPECIAL.\n All callers changed.\n\n When you change just comments or doc strings, it is enough to write\nan entry for the file, without mentioning the functions. Just "Doc\nfixes" is enough for the change log.\n\n There\'s no technical need to make change log entries for\ndocumentation files. This is because documentation is not susceptible\nto bugs that are hard to fix. Documentation does not consist of parts\nthat must interact in a precisely engineered fashion. To correct an\nerror, you need not know the history of the erroneous passage; it is\nenough to compare what the documentation says with the way the program\nactually works.\n\n However, you should keep change logs for documentation files when the\nproject gets copyright assignments from its contributors, so as to make\nthe records of authorship more accurate.\n\n6.8.4 Conditional Changes\n-------------------------\n\nSource files can often contain code that is conditional to build-time or\nstatic conditions. For example, C programs can contain compile-time\n\'#if\' conditionals; programs implemented in interpreted languages can\ncontain module imports of function definitions that are only performed\nfor certain versions of the interpreter; and Automake \'Makefile.am\'\nfiles can contain variable definitions or target declarations that are\nonly to be considered if a configure-time Automake conditional is true.\n\n Many changes are conditional as well: sometimes you add a new\nvariable, or function, or even a new program or library, which is\nentirely dependent on a build-time condition. It is useful to indicate\nin the change log the conditions for which a change applies.\n\n Our convention for indicating conditional changes is to use _square\nbrackets around the name of the condition_.\n\n Conditional changes can happen in numerous scenarios and with many\nvariations, so here are some examples to help clarify. This first\nexample describes changes in C, Perl, and Python files which are\nconditional but do not have an associated function or entity name:\n\n * xterm.c [SOLARIS2]: Include <string.h>.\n * FilePath.pm [$^O eq \'VMS\']: Import the VMS::Feature module.\n * framework.py [sys.version_info < (2, 6)]: Make "with" statement\n available by importing it from __future__,\n to support also python 2.5.\n\n Our other examples will for simplicity be limited to C, as the minor\nchanges necessary to adapt them to other languages should be\nself-evident.\n\n Next, here is an entry describing a new definition which is entirely\nconditional: the C macro \'FRAME_WINDOW_P\' is defined (and used) only\nwhen the macro \'HAVE_X_WINDOWS\' is defined:\n\n * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined.\n\n Next, an entry for a change within the function \'init_display\', whose\ndefinition as a whole is unconditional, but the changes themselves are\ncontained in a \'#ifdef HAVE_LIBNCURSES\' conditional:\n\n * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent.\n\n Finally, here is an entry for a change that takes effect only when a\ncertain macro is _not_ defined:\n\n * host.c (gethostname) [!HAVE_SOCKETS]: Replace with winsock version.\n\n6.8.5 Indicating the Part Changed\n---------------------------------\n\nIndicate the part of a function which changed by using angle brackets\nenclosing an indication of what the changed part does. Here is an entry\nfor a change in the part of the function \'sh-while-getopts\' that deals\nwith \'sh\' commands:\n\n * progmodes/sh-script.el (sh-while-getopts) <sh>: Handle case that\n user-specified option string is empty.\n\n6.9 Man Pages\n=============\n\nIn the GNU project, man pages are secondary. It is not necessary or\nexpected for every GNU program to have a man page, but some of them do.\nIt\'s your choice whether to include a man page in your program.\n\n When you make this decision, consider that supporting a man page\nrequires continual effort each time the program is changed. The time\nyou spend on the man page is time taken away from more useful work.\n\n For a simple program which changes little, updating the man page may\nbe a small job. Then there is little reason not to include a man page,\nif you have one.\n\n For a large program that changes a great deal, updating a man page\nmay be a substantial burden. If a user offers to donate a man page, you\nmay find this gift costly to accept. It may be better to refuse the man\npage unless the same person agrees to take full responsibility for\nmaintaining it--so that you can wash your hands of it entirely. If this\nvolunteer later ceases to do the job, then don\'t feel obliged to pick it\nup yourself; it may be better to withdraw the man page from the\ndistribution until someone else agrees to update it.\n\n When a program changes only a little, you may feel that the\ndiscrepancies are small enough that the man page remains useful without\nupdating. If so, put a prominent note near the beginning of the man\npage explaining that you don\'t maintain it and that the Texinfo manual\nis more authoritative. The note should say how to access the Texinfo\ndocumentation.\n\n Be sure that man pages include a copyright statement and free\nlicense. The simple all-permissive license is appropriate for simple\nman pages (*note (maintain)License Notices for Other Files::).\n\n For long man pages, with enough explanation and documentation that\nthey can be considered true manuals, use the GFDL (*note License for\nManuals::).\n\n Finally, the GNU help2man program\n(<http://www.gnu.org/software/help2man/>) is one way to automate\ngeneration of a man page, in this case from \'--help\' output. This is\nsufficient in many cases.\n\n6.10 Reading other Manuals\n==========================\n\nThere may be non-free books or documentation files that describe the\nprogram you are documenting.\n\n It is ok to use these documents for reference, just as the author of\na new algebra textbook can read other books on algebra. A large portion\nof any non-fiction book consists of facts, in this case facts about how\na certain program works, and these facts are necessarily the same for\neveryone who writes about the subject. But be careful not to copy your\noutline structure, wording, tables or examples from preexisting non-free\ndocumentation. Copying from free documentation may be ok; please check\nwith the FSF about the individual case.\n\n7 The Release Process\n*********************\n\nMaking a release is more than just bundling up your source files in a\ntar file and putting it up for FTP. You should set up your software so\nthat it can be configured to run on a variety of systems. Your Makefile\nshould conform to the GNU standards described below, and your directory\nlayout should also conform to the standards discussed below. Doing so\nmakes it easy to include your package into the larger framework of all\nGNU software.\n\n7.1 How Configuration Should Work\n=================================\n\nEach GNU distribution should come with a shell script named \'configure\'.\nThis script is given arguments which describe the kind of machine and\nsystem you want to compile the program for. The \'configure\' script must\nrecord the configuration options so that they affect compilation.\n\n The description here is the specification of the interface for the\n\'configure\' script in GNU packages. Many packages implement it using\nGNU Autoconf (*note Introduction: (autoconf)Top.) and/or GNU Automake\n(*note Introduction: (automake)Top.), but you do not have to use these\ntools. You can implement it any way you like; for instance, by making\n\'configure\' be a wrapper around a completely different configuration\nsystem.\n\n Another way for the \'configure\' script to operate is to make a link\nfrom a standard name such as \'config.h\' to the proper configuration file\nfor the chosen system. If you use this technique, the distribution\nshould _not_ contain a file named \'config.h\'. This is so that people\nwon\'t be able to build the program without configuring it first.\n\n Another thing that \'configure\' can do is to edit the Makefile. If\nyou do this, the distribution should _not_ contain a file named\n\'Makefile\'. Instead, it should include a file \'Makefile.in\' which\ncontains the input used for editing. Once again, this is so that people\nwon\'t be able to build the program without configuring it first.\n\n If \'configure\' does write the \'Makefile\', then \'Makefile\' should have\na target named \'Makefile\' which causes \'configure\' to be rerun, setting\nup the same configuration that was set up last time. The files that\n\'configure\' reads should be listed as dependencies of \'Makefile\'.\n\n All the files which are output from the \'configure\' script should\nhave comments at the beginning explaining that they were generated\nautomatically using \'configure\'. This is so that users won\'t think of\ntrying to edit them by hand.\n\n The \'configure\' script should write a file named \'config.status\'\nwhich describes which configuration options were specified when the\nprogram was last configured. This file should be a shell script which,\nif run, will recreate the same configuration.\n\n The \'configure\' script should accept an option of the form\n\'--srcdir=DIRNAME\' to specify the directory where sources are found (if\nit is not the current directory). This makes it possible to build the\nprogram in a separate directory, so that the actual source directory is\nnot modified.\n\n If the user does not specify \'--srcdir\', then \'configure\' should\ncheck both \'.\' and \'..\' to see if it can find the sources. If it finds\nthe sources in one of these places, it should use them from there.\nOtherwise, it should report that it cannot find the sources, and should\nexit with nonzero status.\n\n Usually the easy way to support \'--srcdir\' is by editing a definition\nof \'VPATH\' into the Makefile. Some rules may need to refer explicitly\nto the specified source directory. To make this possible, \'configure\'\ncan add to the Makefile a variable named \'srcdir\' whose value is\nprecisely the specified directory.\n\n In addition, the \'configure\' script should take options corresponding\nto most of the standard directory variables (*note Directory\nVariables::). Here is the list:\n\n --prefix --exec-prefix --bindir --sbindir --libexecdir --sysconfdir\n --sharedstatedir --localstatedir --runstatedir\n --libdir --includedir --oldincludedir\n --datarootdir --datadir --infodir --localedir --mandir --docdir\n --htmldir --dvidir --pdfdir --psdir\n\n The \'configure\' script should also take an argument which specifies\nthe type of system to build the program for. This argument should look\nlike this:\n\n CPU-COMPANY-SYSTEM\n\n For example, an Athlon-based GNU/Linux system might be\n\'i686-pc-linux-gnu\'.\n\n The \'configure\' script needs to be able to decode all plausible\nalternatives for how to describe a machine. Thus, \'athlon-pc-gnu/linux\'\nwould be a valid alias. There is a shell script called \'config.sub\'\n(http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD)\nthat you can use as a subroutine to validate system types and\ncanonicalize aliases.\n\n The \'configure\' script should also take the option\n\'--build=BUILDTYPE\', which should be equivalent to a plain BUILDTYPE\nargument. For example, \'configure --build=i686-pc-linux-gnu\' is\nequivalent to \'configure i686-pc-linux-gnu\'. When the build type is not\nspecified by an option or argument, the \'configure\' script should\nnormally guess it using the shell script \'config.guess\'\n(http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD).\n\n Other options are permitted to specify in more detail the software or\nhardware present on the machine, to include or exclude optional parts of\nthe package, or to adjust the name of some tools or arguments to them:\n\n\'--enable-FEATURE[=PARAMETER]\'\n Configure the package to build and install an optional user-level\n facility called FEATURE. This allows users to choose which\n optional features to include. Giving an optional PARAMETER of \'no\'\n should omit FEATURE, if it is built by default.\n\n No \'--enable\' option should *ever* cause one feature to replace\n another. No \'--enable\' option should ever substitute one useful\n behavior for another useful behavior. The only proper use for\n \'--enable\' is for questions of whether to build part of the program\n or exclude it.\n\n\'--with-PACKAGE\'\n The package PACKAGE will be installed, so configure this package to\n work with PACKAGE.\n\n Possible values of PACKAGE include \'gnu-as\' (or \'gas\'), \'gnu-ld\',\n \'gnu-libc\', \'gdb\', \'x\', and \'x-toolkit\'.\n\n Do not use a \'--with\' option to specify the file name to use to\n find certain files. That is outside the scope of what \'--with\'\n options are for.\n\n\'VARIABLE=VALUE\'\n Set the value of the variable VARIABLE to VALUE. This is used to\n override the default values of commands or arguments in the build\n process. For example, the user could issue \'configure CFLAGS=-g\n CXXFLAGS=-g\' to build with debugging information and without the\n default optimization.\n\n Specifying variables as arguments to \'configure\', like this:\n ./configure CC=gcc\n is preferable to setting them in environment variables:\n CC=gcc ./configure\n as it helps to recreate the same configuration later with\n \'config.status\'. However, both methods should be supported.\n\n All \'configure\' scripts should accept all of the "detail" options and\nthe variable settings, whether or not they make any difference to the\nparticular package at hand. In particular, they should accept any\noption that starts with \'--with-\' or \'--enable-\'. This is so users will\nbe able to configure an entire GNU source tree at once with a single set\nof options.\n\n You will note that the categories \'--with-\' and \'--enable-\' are\nnarrow: they *do not* provide a place for any sort of option you might\nthink of. That is deliberate. We want to limit the possible\nconfiguration options in GNU software. We do not want GNU programs to\nhave idiosyncratic configuration options.\n\n Packages that perform part of the compilation process may support\ncross-compilation. In such a case, the host and target machines for the\nprogram may be different.\n\n The \'configure\' script should normally treat the specified type of\nsystem as both the host and the target, thus producing a program which\nworks for the same type of machine that it runs on.\n\n To compile a program to run on a host type that differs from the\nbuild type, use the configure option \'--host=HOSTTYPE\', where HOSTTYPE\nuses the same syntax as BUILDTYPE. The host type normally defaults to\nthe build type.\n\n To configure a cross-compiler, cross-assembler, or what have you, you\nshould specify a target different from the host, using the configure\noption \'--target=TARGETTYPE\'. The syntax for TARGETTYPE is the same as\nfor the host type. So the command would look like this:\n\n ./configure --host=HOSTTYPE --target=TARGETTYPE\n\n The target type normally defaults to the host type. Programs for\nwhich cross-operation is not meaningful need not accept the \'--target\'\noption, because configuring an entire operating system for\ncross-operation is not a meaningful operation.\n\n Some programs have ways of configuring themselves automatically. If\nyour program is set up to do this, your \'configure\' script can simply\nignore most of its arguments.\n\n7.2 Makefile Conventions\n========================\n\nThis node describes conventions for writing the Makefiles for GNU\nprograms. Using Automake will help you write a Makefile that follows\nthese conventions. For more information on portable Makefiles, see\nPOSIX and *note Portable Make Programming: (autoconf)Portable Make.\n\n7.2.1 General Conventions for Makefiles\n---------------------------------------\n\nEvery Makefile should contain this line:\n\n SHELL = /bin/sh\n\nto avoid trouble on systems where the \'SHELL\' variable might be\ninherited from the environment. (This is never a problem with GNU\n\'make\'.)\n\n Different \'make\' programs have incompatible suffix lists and implicit\nrules, and this sometimes creates confusion or misbehavior. So it is a\ngood idea to set the suffix list explicitly using only the suffixes you\nneed in the particular Makefile, like this:\n\n .SUFFIXES:\n .SUFFIXES: .c .o\n\nThe first line clears out the suffix list, the second introduces all\nsuffixes which may be subject to implicit rules in this Makefile.\n\n Don\'t assume that \'.\' is in the path for command execution. When you\nneed to run programs that are a part of your package during the make,\nplease make sure that it uses \'./\' if the program is built as part of\nthe make or \'$(srcdir)/\' if the file is an unchanging part of the source\ncode. Without one of these prefixes, the current search path is used.\n\n The distinction between \'./\' (the "build directory") and \'$(srcdir)/\'\n(the "source directory") is important because users can build in a\nseparate directory using the \'--srcdir\' option to \'configure\'. A rule\nof the form:\n\n foo.1 : foo.man sedscript\n sed -f sedscript foo.man > foo.1\n\nwill fail when the build directory is not the source directory, because\n\'foo.man\' and \'sedscript\' are in the source directory.\n\n When using GNU \'make\', relying on \'VPATH\' to find the source file\nwill work in the case where there is a single dependency file, since the\n\'make\' automatic variable \'$<\' will represent the source file wherever\nit is. (Many versions of \'make\' set \'$<\' only in implicit rules.) A\nMakefile target like\n\n foo.o : bar.c\n $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o\n\nshould instead be written as\n\n foo.o : bar.c\n $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@\n\nin order to allow \'VPATH\' to work correctly. When the target has\nmultiple dependencies, using an explicit \'$(srcdir)\' is the easiest way\nto make the rule work well. For example, the target above for \'foo.1\'\nis best written as:\n\n foo.1 : foo.man sedscript\n sed -f $(srcdir)/sedscript $(srcdir)/foo.man > $@\n\n GNU distributions usually contain some files which are not source\nfiles--for example, Info files, and the output from Autoconf, Automake,\nBison or Flex. Since these files normally appear in the source\ndirectory, they should always appear in the source directory, not in the\nbuild directory. So Makefile rules to update them should put the\nupdated files in the source directory.\n\n However, if a file does not appear in the distribution, then the\nMakefile should not put it in the source directory, because building a\nprogram in ordinary circumstances should not modify the source directory\nin any way.\n\n Try to make the build and installation targets, at least (and all\ntheir subtargets) work correctly with a parallel \'make\'.\n\n7.2.2 Utilities in Makefiles\n----------------------------\n\nWrite the Makefile commands (and any shell scripts, such as \'configure\')\nto run under \'sh\' (both the traditional Bourne shell and the POSIX\nshell), not \'csh\'. Don\'t use any special features of \'ksh\' or \'bash\',\nor POSIX features not widely supported in traditional Bourne \'sh\'.\n\n The \'configure\' script and the Makefile rules for building and\ninstallation should not use any utilities directly except these:\n\n awk cat cmp cp diff echo egrep expr false grep install-info ln ls\n mkdir mv printf pwd rm rmdir sed sleep sort tar test touch tr true\n\n Compression programs such as \'gzip\' can be used in the \'dist\' rule.\n\n Generally, stick to the widely-supported (usually POSIX-specified)\noptions and features of these programs. For example, don\'t use \'mkdir\n-p\', convenient as it may be, because a few systems don\'t support it at\nall and with others, it is not safe for parallel execution. For a list\nof known incompatibilities, see *note Portable Shell Programming:\n(autoconf)Portable Shell.\n\n It is a good idea to avoid creating symbolic links in makefiles,\nsince a few file systems don\'t support them.\n\n The Makefile rules for building and installation can also use\ncompilers and related programs, but should do so via \'make\' variables so\nthat the user can substitute alternatives. Here are some of the\nprograms we mean:\n\n ar bison cc flex install ld ldconfig lex\n make makeinfo ranlib texi2dvi yacc\n\n Use the following \'make\' variables to run those programs:\n\n $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)\n $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)\n\n When you use \'ranlib\' or \'ldconfig\', you should make sure nothing bad\nhappens if the system does not have the program in question. Arrange to\nignore an error from that command, and print a message before the\ncommand to tell the user that failure of this command does not mean a\nproblem. (The Autoconf \'AC_PROG_RANLIB\' macro can help with this.)\n\n If you use symbolic links, you should implement a fallback for\nsystems that don\'t have symbolic links.\n\n Additional utilities that can be used via Make variables are:\n\n chgrp chmod chown mknod\n\n It is ok to use other utilities in Makefile portions (or scripts)\nintended only for particular systems where you know those utilities\nexist.\n\n7.2.3 Variables for Specifying Commands\n---------------------------------------\n\nMakefiles should provide variables for overriding certain commands,\noptions, and so on.\n\n In particular, you should run most utility programs via variables.\nThus, if you use Bison, have a variable named \'BISON\' whose default\nvalue is set with \'BISON = bison\', and refer to it with \'$(BISON)\'\nwhenever you need to use Bison.\n\n File management utilities such as \'ln\', \'rm\', \'mv\', and so on, need\nnot be referred to through variables in this way, since users don\'t need\nto replace them with other programs.\n\n Each program-name variable should come with an options variable that\nis used to supply options to the program. Append \'FLAGS\' to the\nprogram-name variable name to get the options variable name--for\nexample, \'BISONFLAGS\'. (The names \'CFLAGS\' for the C compiler, \'YFLAGS\'\nfor yacc, and \'LFLAGS\' for lex, are exceptions to this rule, but we keep\nthem because they are standard.) Use \'CPPFLAGS\' in any compilation\ncommand that runs the preprocessor, and use \'LDFLAGS\' in any compilation\ncommand that does linking as well as in any direct use of \'ld\'.\n\n If there are C compiler options that _must_ be used for proper\ncompilation of certain files, do not include them in \'CFLAGS\'. Users\nexpect to be able to specify \'CFLAGS\' freely themselves. Instead,\narrange to pass the necessary options to the C compiler independently of\n\'CFLAGS\', by writing them explicitly in the compilation commands or by\ndefining an implicit rule, like this:\n\n CFLAGS = -g\n ALL_CFLAGS = -I. $(CFLAGS)\n .c.o:\n $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<\n\n Do include the \'-g\' option in \'CFLAGS\', because that is not\n_required_ for proper compilation. You can consider it a default that\nis only recommended. If the package is set up so that it is compiled\nwith GCC by default, then you might as well include \'-O\' in the default\nvalue of \'CFLAGS\' as well.\n\n Put \'CFLAGS\' last in the compilation command, after other variables\ncontaining compiler options, so the user can use \'CFLAGS\' to override\nthe others.\n\n \'CFLAGS\' should be used in every invocation of the C compiler, both\nthose which do compilation and those which do linking.\n\n Every Makefile should define the variable \'INSTALL\', which is the\nbasic command for installing a file into the system.\n\n Every Makefile should also define the variables \'INSTALL_PROGRAM\' and\n\'INSTALL_DATA\'. (The default for \'INSTALL_PROGRAM\' should be\n\'$(INSTALL)\'; the default for \'INSTALL_DATA\' should be \'${INSTALL} -m\n644\'.) Then it should use those variables as the commands for actual\ninstallation, for executables and non-executables respectively. Minimal\nuse of these variables is as follows:\n\n $(INSTALL_PROGRAM) foo $(bindir)/foo\n $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a\n\n However, it is preferable to support a \'DESTDIR\' prefix on the target\nfiles, as explained in the next section.\n\n It is acceptable, but not required, to install multiple files in one\ncommand, with the final argument being a directory, as in:\n\n $(INSTALL_PROGRAM) foo bar baz $(bindir)\n\n7.2.4 \'DESTDIR\': Support for Staged Installs\n--------------------------------------------\n\n\'DESTDIR\' is a variable prepended to each installed target file, like\nthis:\n\n $(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo\n $(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a\n\n The \'DESTDIR\' variable is specified by the user on the \'make\' command\nline as an absolute file name. For example:\n\n make DESTDIR=/tmp/stage install\n\n\'DESTDIR\' should be supported only in the \'install*\' and \'uninstall*\'\ntargets, as those are the only targets where it is useful.\n\n If your installation step would normally install \'/usr/local/bin/foo\'\nand \'/usr/local/lib/libfoo.a\', then an installation invoked as in the\nexample above would install \'/tmp/stage/usr/local/bin/foo\' and\n\'/tmp/stage/usr/local/lib/libfoo.a\' instead.\n\n Prepending the variable \'DESTDIR\' to each target in this way provides\nfor "staged installs", where the installed files are not placed directly\ninto their expected location but are instead copied into a temporary\nlocation (\'DESTDIR\'). However, installed files maintain their relative\ndirectory structure and any embedded file names will not be modified.\n\n You should not set the value of \'DESTDIR\' in your \'Makefile\' at all;\nthen the files are installed into their expected locations by default.\nAlso, specifying \'DESTDIR\' should not change the operation of the\nsoftware in any way, so its value should not be included in any file\ncontents.\n\n \'DESTDIR\' support is commonly used in package creation. It is also\nhelpful to users who want to understand what a given package will\ninstall where, and to allow users who don\'t normally have permissions to\ninstall into protected areas to build and install before gaining those\npermissions. Finally, it can be useful with tools such as \'stow\', where\ncode is installed in one place but made to appear to be installed\nsomewhere else using symbolic links or special mount operations. So, we\nstrongly recommend GNU packages support \'DESTDIR\', though it is not an\nabsolute requirement.\n\n7.2.5 Variables for Installation Directories\n--------------------------------------------\n\nInstallation directories should always be named by variables, so it is\neasy to install in a nonstandard place. The standard names for these\nvariables and the values they should have in GNU packages are described\nbelow. They are based on a standard file system layout; variants of it\nare used in GNU/Linux and other modern operating systems.\n\n Installers are expected to override these values when calling \'make\'\n(e.g., \'make prefix=/usr install\') or \'configure\' (e.g., \'configure\n--prefix=/usr\'). GNU packages should not try to guess which value\nshould be appropriate for these variables on the system they are being\ninstalled onto: use the default settings specified here so that all GNU\npackages behave identically, allowing the installer to achieve any\ndesired layout.\n\n All installation directories, and their parent directories, should be\ncreated (if necessary) before they are installed into.\n\n These first two variables set the root for the installation. All the\nother installation directories should be subdirectories of one of these\ntwo, and nothing should be directly installed into these two\ndirectories.\n\n\'prefix\'\n A prefix used in constructing the default values of the variables\n listed below. The default value of \'prefix\' should be\n \'/usr/local\'. When building the complete GNU system, the prefix\n will be empty and \'/usr\' will be a symbolic link to \'/\'. (If you\n are using Autoconf, write it as \'@prefix@\'.)\n\n Running \'make install\' with a different value of \'prefix\' from the\n one used to build the program should _not_ recompile the program.\n\n\'exec_prefix\'\n A prefix used in constructing the default values of some of the\n variables listed below. The default value of \'exec_prefix\' should\n be \'$(prefix)\'. (If you are using Autoconf, write it as\n \'@exec_prefix@\'.)\n\n Generally, \'$(exec_prefix)\' is used for directories that contain\n machine-specific files (such as executables and subroutine\n libraries), while \'$(prefix)\' is used directly for other\n directories.\n\n Running \'make install\' with a different value of \'exec_prefix\' from\n the one used to build the program should _not_ recompile the\n program.\n\n Executable programs are installed in one of the following\ndirectories.\n\n\'bindir\'\n The directory for installing executable programs that users can\n run. This should normally be \'/usr/local/bin\', but write it as\n \'$(exec_prefix)/bin\'. (If you are using Autoconf, write it as\n \'@bindir@\'.)\n\n\'sbindir\'\n The directory for installing executable programs that can be run\n from the shell, but are only generally useful to system\n administrators. This should normally be \'/usr/local/sbin\', but\n write it as \'$(exec_prefix)/sbin\'. (If you are using Autoconf,\n write it as \'@sbindir@\'.)\n\n\'libexecdir\'\n The directory for installing executable programs to be run by other\n programs rather than by users. This directory should normally be\n \'/usr/local/libexec\', but write it as \'$(exec_prefix)/libexec\'.\n (If you are using Autoconf, write it as \'@libexecdir@\'.)\n\n The definition of \'libexecdir\' is the same for all packages, so you\n should install your data in a subdirectory thereof. Most packages\n install their data under \'$(libexecdir)/PACKAGE-NAME/\', possibly\n within additional subdirectories thereof, such as\n \'$(libexecdir)/PACKAGE-NAME/MACHINE/VERSION\'.\n\n Data files used by the program during its execution are divided into\ncategories in two ways.\n\n * Some files are normally modified by programs; others are never\n normally modified (though users may edit some of these).\n\n * Some files are architecture-independent and can be shared by all\n machines at a site; some are architecture-dependent and can be\n shared only by machines of the same kind and operating system;\n others may never be shared between two machines.\n\n This makes for six different possibilities. However, we want to\ndiscourage the use of architecture-dependent files, aside from object\nfiles and libraries. It is much cleaner to make other data files\narchitecture-independent, and it is generally not hard.\n\n Here are the variables Makefiles should use to specify directories to\nput these various kinds of files in:\n\n\'datarootdir\'\n The root of the directory tree for read-only\n architecture-independent data files. This should normally be\n \'/usr/local/share\', but write it as \'$(prefix)/share\'. (If you are\n using Autoconf, write it as \'@datarootdir@\'.) \'datadir\'\'s default\n value is based on this variable; so are \'infodir\', \'mandir\', and\n others.\n\n\'datadir\'\n The directory for installing idiosyncratic read-only\n architecture-independent data files for this program. This is\n usually the same place as \'datarootdir\', but we use the two\n separate variables so that you can move these program-specific\n files without altering the location for Info files, man pages, etc.\n\n This should normally be \'/usr/local/share\', but write it as\n \'$(datarootdir)\'. (If you are using Autoconf, write it as\n \'@datadir@\'.)\n\n The definition of \'datadir\' is the same for all packages, so you\n should install your data in a subdirectory thereof. Most packages\n install their data under \'$(datadir)/PACKAGE-NAME/\'.\n\n\'sysconfdir\'\n The directory for installing read-only data files that pertain to a\n single machine-that is to say, files for configuring a host.\n Mailer and network configuration files, \'/etc/passwd\', and so forth\n belong here. All the files in this directory should be ordinary\n ASCII text files. This directory should normally be\n \'/usr/local/etc\', but write it as \'$(prefix)/etc\'. (If you are\n using Autoconf, write it as \'@sysconfdir@\'.)\n\n Do not install executables here in this directory (they probably\n belong in \'$(libexecdir)\' or \'$(sbindir)\'). Also do not install\n files that are modified in the normal course of their use (programs\n whose purpose is to change the configuration of the system\n excluded). Those probably belong in \'$(localstatedir)\'.\n\n\'sharedstatedir\'\n The directory for installing architecture-independent data files\n which the programs modify while they run. This should normally be\n \'/usr/local/com\', but write it as \'$(prefix)/com\'. (If you are\n using Autoconf, write it as \'@sharedstatedir@\'.)\n\n\'localstatedir\'\n The directory for installing data files which the programs modify\n while they run, and that pertain to one specific machine. Users\n should never need to modify files in this directory to configure\n the package\'s operation; put such configuration information in\n separate files that go in \'$(datadir)\' or \'$(sysconfdir)\'.\n \'$(localstatedir)\' should normally be \'/usr/local/var\', but write\n it as \'$(prefix)/var\'. (If you are using Autoconf, write it as\n \'@localstatedir@\'.)\n\n\'runstatedir\'\n The directory for installing data files which the programs modify\n while they run, that pertain to one specific machine, and which\n need not persist longer than the execution of the program--which is\n generally long-lived, for example, until the next reboot. PID\n files for system daemons are a typical use. In addition, this\n directory should not be cleaned except perhaps at reboot, while the\n general \'/tmp\' (\'TMPDIR\') may be cleaned arbitrarily. This should\n normally be \'/var/run\', but write it as \'$(localstatedir)/run\'.\n Having it as a separate variable allows the use of \'/run\' if\n desired, for example. (If you are using Autoconf 2.70 or later,\n write it as \'@runstatedir@\'.)\n\n These variables specify the directory for installing certain specific\ntypes of files, if your program has them. Every GNU package should have\nInfo files, so every program needs \'infodir\', but not all need \'libdir\'\nor \'lispdir\'.\n\n\'includedir\'\n The directory for installing header files to be included by user\n programs with the C \'#include\' preprocessor directive. This should\n normally be \'/usr/local/include\', but write it as\n \'$(prefix)/include\'. (If you are using Autoconf, write it as\n \'@includedir@\'.)\n\n Most compilers other than GCC do not look for header files in\n directory \'/usr/local/include\'. So installing the header files\n this way is only useful with GCC. Sometimes this is not a problem\n because some libraries are only really intended to work with GCC.\n But some libraries are intended to work with other compilers. They\n should install their header files in two places, one specified by\n \'includedir\' and one specified by \'oldincludedir\'.\n\n\'oldincludedir\'\n The directory for installing \'#include\' header files for use with\n compilers other than GCC. This should normally be \'/usr/include\'.\n (If you are using Autoconf, you can write it as \'@oldincludedir@\'.)\n\n The Makefile commands should check whether the value of\n \'oldincludedir\' is empty. If it is, they should not try to use it;\n they should cancel the second installation of the header files.\n\n A package should not replace an existing header in this directory\n unless the header came from the same package. Thus, if your Foo\n package provides a header file \'foo.h\', then it should install the\n header file in the \'oldincludedir\' directory if either (1) there is\n no \'foo.h\' there or (2) the \'foo.h\' that exists came from the Foo\n package.\n\n To tell whether \'foo.h\' came from the Foo package, put a magic\n string in the file--part of a comment--and \'grep\' for that string.\n\n\'docdir\'\n The directory for installing documentation files (other than Info)\n for this package. By default, it should be\n \'/usr/local/share/doc/YOURPKG\', but it should be written as\n \'$(datarootdir)/doc/YOURPKG\'. (If you are using Autoconf, write it\n as \'@docdir@\'.) The YOURPKG subdirectory, which may include a\n version number, prevents collisions among files with common names,\n such as \'README\'.\n\n\'infodir\'\n The directory for installing the Info files for this package. By\n default, it should be \'/usr/local/share/info\', but it should be\n written as \'$(datarootdir)/info\'. (If you are using Autoconf,\n write it as \'@infodir@\'.) \'infodir\' is separate from \'docdir\' for\n compatibility with existing practice.\n\n\'htmldir\'\n\'dvidir\'\n\'pdfdir\'\n\'psdir\'\n Directories for installing documentation files in the particular\n format. They should all be set to \'$(docdir)\' by default. (If you\n are using Autoconf, write them as \'@htmldir@\', \'@dvidir@\', etc.)\n Packages which supply several translations of their documentation\n should install them in \'$(htmldir)/\'LL, \'$(pdfdir)/\'LL, etc. where\n LL is a locale abbreviation such as \'en\' or \'pt_BR\'.\n\n\'libdir\'\n The directory for object files and libraries of object code. Do\n not install executables here, they probably ought to go in\n \'$(libexecdir)\' instead. The value of \'libdir\' should normally be\n \'/usr/local/lib\', but write it as \'$(exec_prefix)/lib\'. (If you\n are using Autoconf, write it as \'@libdir@\'.)\n\n\'lispdir\'\n The directory for installing any Emacs Lisp files in this package.\n By default, it should be \'/usr/local/share/emacs/site-lisp\', but it\n should be written as \'$(datarootdir)/emacs/site-lisp\'.\n\n If you are using Autoconf, write the default as \'@lispdir@\'. In\n order to make \'@lispdir@\' work, you need the following lines in\n your \'configure.ac\' file:\n\n lispdir=\'${datarootdir}/emacs/site-lisp\'\n AC_SUBST(lispdir)\n\n\'localedir\'\n The directory for installing locale-specific message catalogs for\n this package. By default, it should be \'/usr/local/share/locale\',\n but it should be written as \'$(datarootdir)/locale\'. (If you are\n using Autoconf, write it as \'@localedir@\'.) This directory usually\n has a subdirectory per locale.\n\n Unix-style man pages are installed in one of the following:\n\n\'mandir\'\n The top-level directory for installing the man pages (if any) for\n this package. It will normally be \'/usr/local/share/man\', but you\n should write it as \'$(datarootdir)/man\'. (If you are using\n Autoconf, write it as \'@mandir@\'.)\n\n\'man1dir\'\n The directory for installing section 1 man pages. Write it as\n \'$(mandir)/man1\'.\n\'man2dir\'\n The directory for installing section 2 man pages. Write it as\n \'$(mandir)/man2\'\n\'...\'\n\n *Don\'t make the primary documentation for any GNU software be a man\n page. Write a manual in Texinfo instead. Man pages are just for\n the sake of people running GNU software on Unix, which is a\n secondary application only.*\n\n\'manext\'\n The file name extension for the installed man page. This should\n contain a period followed by the appropriate digit; it should\n normally be \'.1\'.\n\n\'man1ext\'\n The file name extension for installed section 1 man pages.\n\'man2ext\'\n The file name extension for installed section 2 man pages.\n\'...\'\n Use these names instead of \'manext\' if the package needs to install\n man pages in more than one section of the manual.\n\n And finally, you should set the following variable:\n\n\'srcdir\'\n The directory for the sources being compiled. The value of this\n variable is normally inserted by the \'configure\' shell script. (If\n you are using Autoconf, use \'srcdir = @srcdir@\'.)\n\n For example:\n\n # Common prefix for installation directories.\n # NOTE: This directory must exist when you start the install.\n prefix = /usr/local\n datarootdir = $(prefix)/share\n datadir = $(datarootdir)\n exec_prefix = $(prefix)\n # Where to put the executable for the command \'gcc\'.\n bindir = $(exec_prefix)/bin\n # Where to put the directories used by the compiler.\n libexecdir = $(exec_prefix)/libexec\n # Where to put the Info files.\n infodir = $(datarootdir)/info\n\n If your program installs a large number of files into one of the\nstandard user-specified directories, it might be useful to group them\ninto a subdirectory particular to that program. If you do this, you\nshould write the \'install\' rule to create these subdirectories.\n\n Do not expect the user to include the subdirectory name in the value\nof any of the variables listed above. The idea of having a uniform set\nof variable names for installation directories is to enable the user to\nspecify the exact same values for several different GNU packages. In\norder for this to be useful, all the packages must be designed so that\nthey will work sensibly when the user does so.\n\n At times, not all of these variables may be implemented in the\ncurrent release of Autoconf and/or Automake; but as of Autoconf 2.60, we\nbelieve all of them are. When any are missing, the descriptions here\nserve as specifications for what Autoconf will implement. As a\nprogrammer, you can either use a development version of Autoconf or\navoid using these variables until a stable release is made which\nsupports them.\n\n7.2.6 Standard Targets for Users\n--------------------------------\n\nAll GNU programs should have the following targets in their Makefiles:\n\n\'all\'\n Compile the entire program. This should be the default target.\n This target need not rebuild any documentation files; Info files\n should normally be included in the distribution, and DVI (and other\n documentation format) files should be made only when explicitly\n asked for.\n\n By default, the Make rules should compile and link with \'-g\', so\n that executable programs have debugging symbols. Otherwise, you\n are essentially helpless in the face of a crash, and it is often\n far from easy to reproduce with a fresh build.\n\n\'install\'\n Compile the program and copy the executables, libraries, and so on\n to the file names where they should reside for actual use. If\n there is a simple test to verify that a program is properly\n installed, this target should run that test.\n\n Do not strip executables when installing them. This helps eventual\n debugging that may be needed later, and nowadays disk space is\n cheap and dynamic loaders typically ensure debug sections are not\n loaded during normal execution. Users that need stripped binaries\n may invoke the \'install-strip\' target to do that.\n\n If possible, write the \'install\' target rule so that it does not\n modify anything in the directory where the program was built,\n provided \'make all\' has just been done. This is convenient for\n building the program under one user name and installing it under\n another.\n\n The commands should create all the directories in which files are\n to be installed, if they don\'t already exist. This includes the\n directories specified as the values of the variables \'prefix\' and\n \'exec_prefix\', as well as all subdirectories that are needed. One\n way to do this is by means of an \'installdirs\' target as described\n below.\n\n Use \'-\' before any command for installing a man page, so that\n \'make\' will ignore any errors. This is in case there are systems\n that don\'t have the Unix man page documentation system installed.\n\n The way to install Info files is to copy them into \'$(infodir)\'\n with \'$(INSTALL_DATA)\' (*note Command Variables::), and then run\n the \'install-info\' program if it is present. \'install-info\' is a\n program that edits the Info \'dir\' file to add or update the menu\n entry for the given Info file; it is part of the Texinfo package.\n\n Here is a sample rule to install an Info file that also tries to\n handle some additional situations, such as \'install-info\' not being\n present.\n\n do-install-info: foo.info installdirs\n $(NORMAL_INSTALL)\n # Prefer an info file in . to one in srcdir.\n if test -f foo.info; then d=.; \\\n else d="$(srcdir)"; fi; \\\n $(INSTALL_DATA) $$d/foo.info \\\n "$(DESTDIR)$(infodir)/foo.info"\n # Run install-info only if it exists.\n # Use \'if\' instead of just prepending \'-\' to the\n # line so we notice real errors from install-info.\n # Use \'$(SHELL) -c\' because some shells do not\n # fail gracefully when there is an unknown command.\n $(POST_INSTALL)\n if $(SHELL) -c \'install-info --version\' \\\n >/dev/null 2>&1; then \\\n install-info --dir-file="$(DESTDIR)$(infodir)/dir" \\\n "$(DESTDIR)$(infodir)/foo.info"; \\\n else true; fi\n\n When writing the \'install\' target, you must classify all the\n commands into three categories: normal ones, "pre-installation"\n commands and "post-installation" commands. *Note Install Command\n Categories::.\n\n\'install-html\'\n\'install-dvi\'\n\'install-pdf\'\n\'install-ps\'\n These targets install documentation in formats other than Info;\n they\'re intended to be called explicitly by the person installing\n the package, if that format is desired. GNU prefers Info files, so\n these must be installed by the \'install\' target.\n\n When you have many documentation files to install, we recommend\n that you avoid collisions and clutter by arranging for these\n targets to install in subdirectories of the appropriate\n installation directory, such as \'htmldir\'. As one example, if your\n package has multiple manuals, and you wish to install HTML\n documentation with many files (such as the "split" mode output by\n \'makeinfo --html\'), you\'ll certainly want to use subdirectories, or\n two nodes with the same name in different manuals will overwrite\n each other.\n\n Please make these \'install-FORMAT\' targets invoke the commands for\n the FORMAT target, for example, by making FORMAT a dependency.\n\n\'uninstall\'\n Delete all the installed files--the copies that the \'install\' and\n \'install-*\' targets create.\n\n This rule should not modify the directories where compilation is\n done, only the directories where files are installed.\n\n The uninstallation commands are divided into three categories, just\n like the installation commands. *Note Install Command\n Categories::.\n\n\'install-strip\'\n Like \'install\', but strip the executable files while installing\n them. In simple cases, this target can use the \'install\' target in\n a simple way:\n\n install-strip:\n $(MAKE) INSTALL_PROGRAM=\'$(INSTALL_PROGRAM) -s\' \\\n install\n\n But if the package installs scripts as well as real executables,\n the \'install-strip\' target can\'t just refer to the \'install\'\n target; it has to strip the executables but not the scripts.\n\n \'install-strip\' should not strip the executables in the build\n directory which are being copied for installation. It should only\n strip the copies that are installed.\n\n Normally we do not recommend stripping an executable unless you are\n sure the program has no bugs. However, it can be reasonable to\n install a stripped executable for actual execution while saving the\n unstripped executable elsewhere in case there is a bug.\n\n\'clean\'\n Delete all files in the current directory that are normally created\n by building the program. Also delete files in other directories if\n they are created by this makefile. However, don\'t delete the files\n that record the configuration. Also preserve files that could be\n made by building, but normally aren\'t because the distribution\n comes with them. There is no need to delete parent directories\n that were created with \'mkdir -p\', since they could have existed\n anyway.\n\n Delete \'.dvi\' files here if they are not part of the distribution.\n\n\'distclean\'\n Delete all files in the current directory (or created by this\n makefile) that are created by configuring or building the program.\n If you have unpacked the source and built the program without\n creating any other files, \'make distclean\' should leave only the\n files that were in the distribution. However, there is no need to\n delete parent directories that were created with \'mkdir -p\', since\n they could have existed anyway.\n\n\'mostlyclean\'\n Like \'clean\', but may refrain from deleting a few files that people\n normally don\'t want to recompile. For example, the \'mostlyclean\'\n target for GCC does not delete \'libgcc.a\', because recompiling it\n is rarely necessary and takes a lot of time.\n\n\'maintainer-clean\'\n Delete almost everything that can be reconstructed with this\n Makefile. This typically includes everything deleted by\n \'distclean\', plus more: C source files produced by Bison, tags\n tables, Info files, and so on.\n\n The reason we say "almost everything" is that running the command\n \'make maintainer-clean\' should not delete \'configure\' even if\n \'configure\' can be remade using a rule in the Makefile. More\n generally, \'make maintainer-clean\' should not delete anything that\n needs to exist in order to run \'configure\' and then begin to build\n the program. Also, there is no need to delete parent directories\n that were created with \'mkdir -p\', since they could have existed\n anyway. These are the only exceptions; \'maintainer-clean\' should\n delete everything else that can be rebuilt.\n\n The \'maintainer-clean\' target is intended to be used by a\n maintainer of the package, not by ordinary users. You may need\n special tools to reconstruct some of the files that \'make\n maintainer-clean\' deletes. Since these files are normally included\n in the distribution, we don\'t take care to make them easy to\n reconstruct. If you find you need to unpack the full distribution\n again, don\'t blame us.\n\n To help make users aware of this, the commands for the special\n \'maintainer-clean\' target should start with these two:\n\n @echo \'This command is intended for maintainers to use; it\'\n @echo \'deletes files that may need special tools to rebuild.\'\n\n\'TAGS\'\n Update a tags table for this program.\n\n\'info\'\n Generate any Info files needed. The best way to write the rules is\n as follows:\n\n info: foo.info\n\n foo.info: foo.texi chap1.texi chap2.texi\n $(MAKEINFO) $(srcdir)/foo.texi\n\n You must define the variable \'MAKEINFO\' in the Makefile. It should\n run the \'makeinfo\' program, which is part of the Texinfo\n distribution.\n\n Normally a GNU distribution comes with Info files, and that means\n the Info files are present in the source directory. Therefore, the\n Make rule for an info file should update it in the source\n directory. When users build the package, ordinarily Make will not\n update the Info files because they will already be up to date.\n\n\'dvi\'\n\'html\'\n\'pdf\'\n\'ps\'\n Generate documentation files in the given format. These targets\n should always exist, but any or all can be a no-op if the given\n output format cannot be generated. These targets should not be\n dependencies of the \'all\' target; the user must manually invoke\n them.\n\n Here\'s an example rule for generating DVI files from Texinfo:\n\n dvi: foo.dvi\n\n foo.dvi: foo.texi chap1.texi chap2.texi\n $(TEXI2DVI) $(srcdir)/foo.texi\n\n You must define the variable \'TEXI2DVI\' in the Makefile. It should\n run the program \'texi2dvi\', which is part of the Texinfo\n distribution. (\'texi2dvi\' uses TeX to do the real work of\n formatting. TeX is not distributed with Texinfo.) Alternatively,\n write only the dependencies, and allow GNU \'make\' to provide the\n command.\n\n Here\'s another example, this one for generating HTML from Texinfo:\n\n html: foo.html\n\n foo.html: foo.texi chap1.texi chap2.texi\n $(TEXI2HTML) $(srcdir)/foo.texi\n\n Again, you would define the variable \'TEXI2HTML\' in the Makefile;\n for example, it might run \'makeinfo --no-split --html\' (\'makeinfo\'\n is part of the Texinfo distribution).\n\n\'dist\'\n Create a distribution tar file for this program. The tar file\n should be set up so that the file names in the tar file start with\n a subdirectory name which is the name of the package it is a\n distribution for. This name can include the version number.\n\n For example, the distribution tar file of GCC version 1.40 unpacks\n into a subdirectory named \'gcc-1.40\'.\n\n The easiest way to do this is to create a subdirectory\n appropriately named, use \'ln\' or \'cp\' to install the proper files\n in it, and then \'tar\' that subdirectory.\n\n Compress the tar file with \'gzip\'. For example, the actual\n distribution file for GCC version 1.40 is called \'gcc-1.40.tar.gz\'.\n It is ok to support other free compression formats as well.\n\n The \'dist\' target should explicitly depend on all non-source files\n that are in the distribution, to make sure they are up to date in\n the distribution. *Note Making Releases: Releases.\n\n\'check\'\n Perform self-tests (if any). The user must build the program\n before running the tests, but need not install the program; you\n should write the self-tests so that they work when the program is\n built but not installed.\n\n The following targets are suggested as conventional names, for\nprograms in which they are useful.\n\n\'installcheck\'\n Perform installation tests (if any). The user must build and\n install the program before running the tests. You should not\n assume that \'$(bindir)\' is in the search path.\n\n\'installdirs\'\n It\'s useful to add a target named \'installdirs\' to create the\n directories where files are installed, and their parent\n directories. There is a script called \'mkinstalldirs\' which is\n convenient for this; you can find it in the Gnulib package. You\n can use a rule like this:\n\n # Make sure all installation directories (e.g. $(bindir))\n # actually exist by making them if necessary.\n installdirs: mkinstalldirs\n $(srcdir)/mkinstalldirs $(bindir) $(datadir) \\\n $(libdir) $(infodir) \\\n $(mandir)\n\n or, if you wish to support \'DESTDIR\' (strongly encouraged),\n\n # Make sure all installation directories (e.g. $(bindir))\n # actually exist by making them if necessary.\n installdirs: mkinstalldirs\n $(srcdir)/mkinstalldirs \\\n $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \\\n $(DESTDIR)$(libdir) $(DESTDIR)$(infodir) \\\n $(DESTDIR)$(mandir)\n\n This rule should not modify the directories where compilation is\n done. It should do nothing but create installation directories.\n\n7.2.7 Install Command Categories\n--------------------------------\n\nWhen writing the \'install\' target, you must classify all the commands\ninto three categories: normal ones, "pre-installation" commands and\n"post-installation" commands.\n\n Normal commands move files into their proper places, and set their\nmodes. They may not alter any files except the ones that come entirely\nfrom the package they belong to.\n\n Pre-installation and post-installation commands may alter other\nfiles; in particular, they can edit global configuration files or data\nbases.\n\n Pre-installation commands are typically executed before the normal\ncommands, and post-installation commands are typically run after the\nnormal commands.\n\n The most common use for a post-installation command is to run\n\'install-info\'. This cannot be done with a normal command, since it\nalters a file (the Info directory) which does not come entirely and\nsolely from the package being installed. It is a post-installation\ncommand because it needs to be done after the normal command which\ninstalls the package\'s Info files.\n\n Most programs don\'t need any pre-installation commands, but we have\nthe feature just in case it is needed.\n\n To classify the commands in the \'install\' rule into these three\ncategories, insert "category lines" among them. A category line\nspecifies the category for the commands that follow.\n\n A category line consists of a tab and a reference to a special Make\nvariable, plus an optional comment at the end. There are three\nvariables you can use, one for each category; the variable name\nspecifies the category. Category lines are no-ops in ordinary execution\nbecause these three Make variables are normally undefined (and you\n_should not_ define them in the makefile).\n\n Here are the three possible category lines, each with a comment that\nexplains what it means:\n\n $(PRE_INSTALL) # Pre-install commands follow.\n $(POST_INSTALL) # Post-install commands follow.\n $(NORMAL_INSTALL) # Normal commands follow.\n\n If you don\'t use a category line at the beginning of the \'install\'\nrule, all the commands are classified as normal until the first category\nline. If you don\'t use any category lines, all the commands are\nclassified as normal.\n\n These are the category lines for \'uninstall\':\n\n $(PRE_UNINSTALL) # Pre-uninstall commands follow.\n $(POST_UNINSTALL) # Post-uninstall commands follow.\n $(NORMAL_UNINSTALL) # Normal commands follow.\n\n Typically, a pre-uninstall command would be used for deleting entries\nfrom the Info directory.\n\n If the \'install\' or \'uninstall\' target has any dependencies which act\nas subroutines of installation, then you should start _each_\ndependency\'s commands with a category line, and start the main target\'s\ncommands with a category line also. This way, you can ensure that each\ncommand is placed in the right category regardless of which of the\ndependencies actually run.\n\n Pre-installation and post-installation commands should not run any\nprograms except for these:\n\n [ basename bash cat chgrp chmod chown cmp cp dd diff echo\n egrep expand expr false fgrep find getopt grep gunzip gzip\n hostname install install-info kill ldconfig ln ls md5sum\n mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee\n test touch true uname xargs yes\n\n The reason for distinguishing the commands in this way is for the\nsake of making binary packages. Typically a binary package contains all\nthe executables and other files that need to be installed, and has its\nown method of installing them--so it does not need to run the normal\ninstallation commands. But installing the binary package does need to\nexecute the pre-installation and post-installation commands.\n\n Programs to build binary packages work by extracting the\npre-installation and post-installation commands. Here is one way of\nextracting the pre-installation commands (the \'-s\' option to \'make\' is\nneeded to silence messages about entering subdirectories):\n\n make -s -n install -o all \\\n PRE_INSTALL=pre-install \\\n POST_INSTALL=post-install \\\n NORMAL_INSTALL=normal-install \\\n | gawk -f pre-install.awk\n\nwhere the file \'pre-install.awk\' could contain this:\n\n $0 ~ /^(normal-install|post-install)[ \\t]*$/ {on = 0}\n on {print $0}\n $0 ~ /^pre-install[ \\t]*$/ {on = 1}\n\n7.3 Making Releases\n===================\n\nYou should identify each release with a pair of version numbers, a major\nversion and a minor. We have no objection to using more than two\nnumbers, but it is very unlikely that you really need them.\n\n Package the distribution of \'Foo version 69.96\' up in a gzipped tar\nfile with the name \'foo-69.96.tar.gz\'. It should unpack into a\nsubdirectory named \'foo-69.96\'.\n\n Building and installing the program should never modify any of the\nfiles contained in the distribution. This means that all the files that\nform part of the program in any way must be classified into "source\nfiles" and "non-source files". Source files are written by humans and\nnever changed automatically; non-source files are produced from source\nfiles by programs under the control of the Makefile.\n\n The distribution should contain a file named \'README\' with a general\noverview of the package:\n\n * the name of the package;\n\n * the version number of the package, or refer to where in the package\n the version can be found;\n\n * a general description of what the package does;\n\n * a reference to the file \'INSTALL\', which should in turn contain an\n explanation of the installation procedure;\n\n * a brief explanation of any unusual top-level directories or files,\n or other hints for readers to find their way around the source;\n\n * a reference to the file which contains the copying conditions. The\n GNU GPL, if used, should be in a file called \'COPYING\'. If the GNU\n LGPL is used, it should be in a file called \'COPYING.LESSER\'.\n\n Naturally, all the source files must be in the distribution. It is\nokay to include non-source files in the distribution along with the\nsource files they are generated from, provided they are up-to-date with\nthe source they are made from, and machine-independent, so that normal\nbuilding of the distribution will never modify them. We commonly\ninclude non-source files produced by Autoconf, Automake, Bison, \'flex\',\nTeX, and \'makeinfo\'; this helps avoid unnecessary dependencies between\nour distributions, so that users can install whichever versions of\nwhichever packages they like. Do not induce new dependencies on other\nsoftware lightly.\n\n Non-source files that might actually be modified by building and\ninstalling the program should *never* be included in the distribution.\nSo if you do distribute non-source files, always make sure they are up\nto date when you make a new distribution.\n\n Make sure that all the files in the distribution are world-readable,\nand that directories are world-readable and world-searchable (octal mode\n755). We used to recommend that all directories in the distribution\nalso be world-writable (octal mode 777), because ancient versions of\n\'tar\' would otherwise not cope when extracting the archive as an\nunprivileged user. That can easily lead to security issues when\ncreating the archive, however, so now we recommend against that.\n\n Don\'t include any symbolic links in the distribution itself. If the\ntar file contains symbolic links, then people cannot even unpack it on\nsystems that don\'t support symbolic links. Also, don\'t use multiple\nnames for one file in different directories, because certain file\nsystems cannot handle this and that prevents unpacking the distribution.\n\n Try to make sure that all the file names will be unique on MS-DOS. A\nname on MS-DOS consists of up to 8 characters, optionally followed by a\nperiod and up to three characters. MS-DOS will truncate extra\ncharacters both before and after the period. Thus, \'foobarhacker.c\' and\n\'foobarhacker.o\' are not ambiguous; they are truncated to \'foobarha.c\'\nand \'foobarha.o\', which are distinct.\n\n Include in your distribution a copy of the \'texinfo.tex\' you used to\ntest print any \'*.texinfo\' or \'*.texi\' files.\n\n Likewise, if your program uses small GNU software packages like\nregex, getopt, obstack, or termcap, include them in the distribution\nfile. Leaving them out would make the distribution file a little\nsmaller at the expense of possible inconvenience to a user who doesn\'t\nknow what other files to get.\n\n8 References to Non-Free Software and Documentation\n***************************************************\n\nA GNU program should not recommend, promote, or grant legitimacy to the\nuse of any non-free program. Proprietary software is a social and\nethical problem, and our aim is to put an end to that problem. We can\'t\nstop some people from writing proprietary programs, or stop other people\nfrom using them, but we can and should refuse to advertise them to new\npotential customers, or to give the public the idea that their existence\nis ethical.\n\n The GNU definition of free software is found on the GNU web site at\n<http://www.gnu.org/philosophy/free-sw.html>, and the definition of free\ndocumentation is found at <http://www.gnu.org/philosophy/free-doc.html>.\nThe terms "free" and "non-free", used in this document, refer to those\ndefinitions.\n\n A list of important licenses and whether they qualify as free is in\n<http://www.gnu.org/licenses/license-list.html>. If it is not clear\nwhether a license qualifies as free, please ask the GNU Project by\nwriting to <licensing@gnu.org>. We will answer, and if the license is\nan important one, we will add it to the list.\n\n When a non-free program or system is well known, you can mention it\nin passing--that is harmless, since users who might want to use it\nprobably already know about it. For instance, it is fine to explain how\nto build your package on top of some widely used non-free operating\nsystem, or how to use it together with some widely used non-free\nprogram.\n\n However, you should give only the necessary information to help those\nwho already use the non-free program to use your program with it--don\'t\ngive, or refer to, any further information about the proprietary\nprogram, and don\'t imply that the proprietary program enhances your\nprogram, or that its existence is in any way a good thing. The goal\nshould be that people already using the proprietary program will get the\nadvice they need about how to use your free program with it, while\npeople who don\'t already use the proprietary program will not see\nanything likely to lead them to take an interest in it.\n\n If a non-free program or system is obscure in your program\'s domain,\nyour program should not mention or support it at all, since doing so\nwould tend to popularize the non-free program more than it popularizes\nyour program. (You cannot hope to find many additional users for your\nprogram among the users of Foobar, if the existence of Foobar is not\ngenerally known among people who might want to use your program.)\n\n Sometimes a program is free software in itself but depends on a\nnon-free platform in order to run. For instance, many Java programs\ndepend on some non-free Java libraries. To recommend or promote such a\nprogram is to promote the other programs it needs. This is why we are\ncareful about listing Java programs in the Free Software Directory: we\ndon\'t want to promote the non-free Java libraries.\n\n We hope this particular problem with Java will be gone by and by, as\nwe replace the remaining non-free standard Java libraries with free\nsoftware, but the general principle will remain the same: don\'t\nrecommend, promote or legitimize programs that depend on non-free\nsoftware to run.\n\n Some free programs strongly encourage the use of non-free software.\nA typical example is \'mplayer\'. It is free software in itself, and the\nfree code can handle some kinds of files. However, \'mplayer\' recommends\nuse of non-free codecs for other kinds of files, and users that install\n\'mplayer\' are very likely to install those codecs along with it. To\nrecommend \'mplayer\' is, in effect, to promote use of the non-free\ncodecs.\n\n Thus, you should not recommend programs that strongly encourage the\nuse of non-free software. This is why we do not list \'mplayer\' in the\nFree Software Directory.\n\n A GNU package should not refer the user to any non-free documentation\nfor free software. Free documentation that can be included in free\noperating systems is essential for completing the GNU system, or any\nfree operating system, so encouraging it is a priority; to recommend use\nof documentation that we are not allowed to include undermines the\nimpetus for the community to produce documentation that we can include.\nSo GNU packages should never recommend non-free documentation.\n\n By contrast, it is ok to refer to journal articles and textbooks in\nthe comments of a program for explanation of how it functions, even\nthough they are non-free. This is because we don\'t include such things\nin the GNU system even if they are free--they are outside the scope of\nwhat a software distribution needs to include.\n\n Referring to a web site that describes or recommends a non-free\nprogram is promoting that program, so please do not make links to (or\nmention by name) web sites that contain such material. This policy is\nrelevant particularly for the web pages for a GNU package.\n\n Following links from nearly any web site can lead eventually to\nnon-free software; this is inherent in the nature of the web. So it\nmakes no sense to criticize a site for having such links. As long as\nthe site does not itself recommend a non-free program, there is no need\nto consider the question of the sites that it links to for other\nreasons.\n\n Thus, for example, you should not refer to AT&T\'s web site if that\nrecommends AT&T\'s non-free software packages; you should not refer to a\npage P that links to AT&T\'s site presenting it as a place to get some\nnon-free program, because that part of the page P itself recommends and\nlegitimizes the non-free program. However, that P contains a link to\nAT&T\'s web site for some other purpose (such as long-distance telephone\nservice) is not an objection against it.\n\n A web page recommends a program in a particularly strong way if it\nrequires users to run that program in order to use the page. Many pages\ncontain Javascript code which they recommend in this way. This\nJavascript code may be free or nonfree, but nonfree is the usual case.\n\n If the purpose for which you would refer to the page cannot be\ncarried out without running nonfree Javascript code, then you should not\nrefer to it. Thus, if the purpose of referring to the page is for\npeople to view a video, or subscribing to a mailing list, and the\nviewing or subscribing fail to work if the user\'s browser blocks the\nnonfree Javascript code, then don\'t refer to that page.\n\n The extreme case is that of web sites which depend on nonfree\nJavascript code even to _see_ the contents of the pages. Any site\nhosted on \'wix.com\' has this problem, and so do some other sites.\nReferring people to such pages to read their contents is, in effect,\nurging them to run those nonfree programs--so please don\'t refer to\nthose pages. (Such pages also break the Web, so they deserve\ncondemnation for two reasons.)\n\n Instead, please quote excerpts from the page to make your point, or\nfind another place to refer to that information.\n\nAppendix A GNU Free Documentation License\n*****************************************\n\n Version 1.3, 3 November 2008\n\n Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.\n <http://fsf.org/>\n\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n 0. PREAMBLE\n\n The purpose of this License is to make a manual, textbook, or other\n functional and useful document "free" in the sense of freedom: to\n assure everyone the effective freedom to copy and redistribute it,\n with or without modifying it, either commercially or\n noncommercially. Secondarily, this License preserves for the\n author and publisher a way to get credit for their work, while not\n being considered responsible for modifications made by others.\n\n This License is a kind of "copyleft", which means that derivative\n works of the document must themselves be free in the same sense.\n It complements the GNU General Public License, which is a copyleft\n license designed for free software.\n\n We have designed this License in order to use it for manuals for\n free software, because free software needs free documentation: a\n free program should come with manuals providing the same freedoms\n that the software does. But this License is not limited to\n software manuals; it can be used for any textual work, regardless\n of subject matter or whether it is published as a printed book. We\n recommend this License principally for works whose purpose is\n instruction or reference.\n\n 1. APPLICABILITY AND DEFINITIONS\n\n This License applies to any manual or other work, in any medium,\n that contains a notice placed by the copyright holder saying it can\n be distributed under the terms of this License. Such a notice\n grants a world-wide, royalty-free license, unlimited in duration,\n to use that work under the conditions stated herein. The\n "Document", below, refers to any such manual or work. Any member\n of the public is a licensee, and is addressed as "you". You accept\n the license if you copy, modify or distribute the work in a way\n requiring permission under copyright law.\n\n A "Modified Version" of the Document means any work containing the\n Document or a portion of it, either copied verbatim, or with\n modifications and/or translated into another language.\n\n A "Secondary Section" is a named appendix or a front-matter section\n of the Document that deals exclusively with the relationship of the\n publishers or authors of the Document to the Document\'s overall\n subject (or to related matters) and contains nothing that could\n fall directly within that overall subject. (Thus, if the Document\n is in part a textbook of mathematics, a Secondary Section may not\n explain any mathematics.) The relationship could be a matter of\n historical connection with the subject or with related matters, or\n of legal, commercial, philosophical, ethical or political position\n regarding them.\n\n The "Invariant Sections" are certain Secondary Sections whose\n titles are designated, as being those of Invariant Sections, in the\n notice that says that the Document is released under this License.\n If a section does not fit the above definition of Secondary then it\n is not allowed to be designated as Invariant. The Document may\n contain zero Invariant Sections. If the Document does not identify\n any Invariant Sections then there are none.\n\n The "Cover Texts" are certain short passages of text that are\n listed, as Front-Cover Texts or Back-Cover Texts, in the notice\n that says that the Document is released under this License. A\n Front-Cover Text may be at most 5 words, and a Back-Cover Text may\n be at most 25 words.\n\n A "Transparent" copy of the Document means a machine-readable copy,\n represented in a format whose specification is available to the\n general public, that is suitable for revising the document\n straightforwardly with generic text editors or (for images composed\n of pixels) generic paint programs or (for drawings) some widely\n available drawing editor, and that is suitable for input to text\n formatters or for automatic translation to a variety of formats\n suitable for input to text formatters. A copy made in an otherwise\n Transparent file format whose markup, or absence of markup, has\n been arranged to thwart or discourage subsequent modification by\n readers is not Transparent. An image format is not Transparent if\n used for any substantial amount of text. A copy that is not\n "Transparent" is called "Opaque".\n\n Examples of suitable formats for Transparent copies include plain\n ASCII without markup, Texinfo input format, LaTeX input format,\n SGML or XML using a publicly available DTD, and standard-conforming\n simple HTML, PostScript or PDF designed for human modification.\n Examples of transparent image formats include PNG, XCF and JPG.\n Opaque formats include proprietary formats that can be read and\n edited only by proprietary word processors, SGML or XML for which\n the DTD and/or processing tools are not generally available, and\n the machine-generated HTML, PostScript or PDF produced by some word\n processors for output purposes only.\n\n The "Title Page" means, for a printed book, the title page itself,\n plus such following pages as are needed to hold, legibly, the\n material this License requires to appear in the title page. For\n works in formats which do not have any title page as such, "Title\n Page" means the text near the most prominent appearance of the\n work\'s title, preceding the beginning of the body of the text.\n\n The "publisher" means any person or entity that distributes copies\n of the Document to the public.\n\n A section "Entitled XYZ" means a named subunit of the Document\n whose title either is precisely XYZ or contains XYZ in parentheses\n following text that translates XYZ in another language. (Here XYZ\n stands for a specific section name mentioned below, such as\n "Acknowledgements", "Dedications", "Endorsements", or "History".)\n To "Preserve the Title" of such a section when you modify the\n Document means that it remains a section "Entitled XYZ" according\n to this definition.\n\n The Document may include Warranty Disclaimers next to the notice\n which states that this License applies to the Document. These\n Warranty Disclaimers are considered to be included by reference in\n this License, but only as regards disclaiming warranties: any other\n implication that these Warranty Disclaimers may have is void and\n has no effect on the meaning of this License.\n\n 2. VERBATIM COPYING\n\n You may copy and distribute the Document in any medium, either\n commercially or noncommercially, provided that this License, the\n copyright notices, and the license notice saying this License\n applies to the Document are reproduced in all copies, and that you\n add no other conditions whatsoever to those of this License. You\n may not use technical measures to obstruct or control the reading\n or further copying of the copies you make or distribute. However,\n you may accept compensation in exchange for copies. If you\n distribute a large enough number of copies you must also follow the\n conditions in section 3.\n\n You may also lend copies, under the same conditions stated above,\n and you may publicly display copies.\n\n 3. COPYING IN QUANTITY\n\n If you publish printed copies (or copies in media that commonly\n have printed covers) of the Document, numbering more than 100, and\n the Document\'s license notice requires Cover Texts, you must\n enclose the copies in covers that carry, clearly and legibly, all\n these Cover Texts: Front-Cover Texts on the front cover, and\n Back-Cover Texts on the back cover. Both covers must also clearly\n and legibly identify you as the publisher of these copies. The\n front cover must present the full title with all words of the title\n equally prominent and visible. You may add other material on the\n covers in addition. Copying with changes limited to the covers, as\n long as they preserve the title of the Document and satisfy these\n conditions, can be treated as verbatim copying in other respects.\n\n If the required texts for either cover are too voluminous to fit\n legibly, you should put the first ones listed (as many as fit\n reasonably) on the actual cover, and continue the rest onto\n adjacent pages.\n\n If you publish or distribute Opaque copies of the Document\n numbering more than 100, you must either include a machine-readable\n Transparent copy along with each Opaque copy, or state in or with\n each Opaque copy a computer-network location from which the general\n network-using public has access to download using public-standard\n network protocols a complete Transparent copy of the Document, free\n of added material. If you use the latter option, you must take\n reasonably prudent steps, when you begin distribution of Opaque\n copies in quantity, to ensure that this Transparent copy will\n remain thus accessible at the stated location until at least one\n year after the last time you distribute an Opaque copy (directly or\n through your agents or retailers) of that edition to the public.\n\n It is requested, but not required, that you contact the authors of\n the Document well before redistributing any large number of copies,\n to give them a chance to provide you with an updated version of the\n Document.\n\n 4. MODIFICATIONS\n\n You may copy and distribute a Modified Version of the Document\n under the conditions of sections 2 and 3 above, provided that you\n release the Modified Version under precisely this License, with the\n Modified Version filling the role of the Document, thus licensing\n distribution and modification of the Modified Version to whoever\n possesses a copy of it. In addition, you must do these things in\n the Modified Version:\n\n A. Use in the Title Page (and on the covers, if any) a title\n distinct from that of the Document, and from those of previous\n versions (which should, if there were any, be listed in the\n History section of the Document). You may use the same title\n as a previous version if the original publisher of that\n version gives permission.\n\n B. List on the Title Page, as authors, one or more persons or\n entities responsible for authorship of the modifications in\n the Modified Version, together with at least five of the\n principal authors of the Document (all of its principal\n authors, if it has fewer than five), unless they release you\n from this requirement.\n\n C. State on the Title page the name of the publisher of the\n Modified Version, as the publisher.\n\n D. Preserve all the copyright notices of the Document.\n\n E. Add an appropriate copyright notice for your modifications\n adjacent to the other copyright notices.\n\n F. Include, immediately after the copyright notices, a license\n notice giving the public permission to use the Modified\n Version under the terms of this License, in the form shown in\n the Addendum below.\n\n G. Preserve in that license notice the full lists of Invariant\n Sections and required Cover Texts given in the Document\'s\n license notice.\n\n H. Include an unaltered copy of this License.\n\n I. Preserve the section Entitled "History", Preserve its Title,\n and add to it an item stating at least the title, year, new\n authors, and publisher of the Modified Version as given on the\n Title Page. If there is no section Entitled "History" in the\n Document, create one stating the title, year, authors, and\n publisher of the Document as given on its Title Page, then add\n an item describing the Modified Version as stated in the\n previous sentence.\n\n J. Preserve the network location, if any, given in the Document\n for public access to a Transparent copy of the Document, and\n likewise the network locations given in the Document for\n previous versions it was based on. These may be placed in the\n "History" section. You may omit a network location for a work\n that was published at least four years before the Document\n itself, or if the original publisher of the version it refers\n to gives permission.\n\n K. For any section Entitled "Acknowledgements" or "Dedications",\n Preserve the Title of the section, and preserve in the section\n all the substance and tone of each of the contributor\n acknowledgements and/or dedications given therein.\n\n L. Preserve all the Invariant Sections of the Document, unaltered\n in their text and in their titles. Section numbers or the\n equivalent are not considered part of the section titles.\n\n M. Delete any section Entitled "Endorsements". Such a section\n may not be included in the Modified Version.\n\n N. Do not retitle any existing section to be Entitled\n "Endorsements" or to conflict in title with any Invariant\n Section.\n\n O. Preserve any Warranty Disclaimers.\n\n If the Modified Version includes new front-matter sections or\n appendices that qualify as Secondary Sections and contain no\n material copied from the Document, you may at your option designate\n some or all of these sections as invariant. To do this, add their\n titles to the list of Invariant Sections in the Modified Version\'s\n license notice. These titles must be distinct from any other\n section titles.\n\n You may add a section Entitled "Endorsements", provided it contains\n nothing but endorsements of your Modified Version by various\n parties--for example, statements of peer review or that the text\n has been approved by an organization as the authoritative\n definition of a standard.\n\n You may add a passage of up to five words as a Front-Cover Text,\n and a passage of up to 25 words as a Back-Cover Text, to the end of\n the list of Cover Texts in the Modified Version. Only one passage\n of Front-Cover Text and one of Back-Cover Text may be added by (or\n through arrangements made by) any one entity. If the Document\n already includes a cover text for the same cover, previously added\n by you or by arrangement made by the same entity you are acting on\n behalf of, you may not add another; but you may replace the old\n one, on explicit permission from the previous publisher that added\n the old one.\n\n The author(s) and publisher(s) of the Document do not by this\n License give permission to use their names for publicity for or to\n assert or imply endorsement of any Modified Version.\n\n 5. COMBINING DOCUMENTS\n\n You may combine the Document with other documents released under\n this License, under the terms defined in section 4 above for\n modified versions, provided that you include in the combination all\n of the Invariant Sections of all of the original documents,\n unmodified, and list them all as Invariant Sections of your\n combined work in its license notice, and that you preserve all\n their Warranty Disclaimers.\n\n The combined work need only contain one copy of this License, and\n multiple identical Invariant Sections may be replaced with a single\n copy. If there are multiple Invariant Sections with the same name\n but different contents, make the title of each such section unique\n by adding at the end of it, in parentheses, the name of the\n original author or publisher of that section if known, or else a\n unique number. Make the same adjustment to the section titles in\n the list of Invariant Sections in the license notice of the\n combined work.\n\n In the combination, you must combine any sections Entitled\n "History" in the various original documents, forming one section\n Entitled "History"; likewise combine any sections Entitled\n "Acknowledgements", and any sections Entitled "Dedications". You\n must delete all sections Entitled "Endorsements."\n\n 6. COLLECTIONS OF DOCUMENTS\n\n You may make a collection consisting of the Document and other\n documents released under this License, and replace the individual\n copies of this License in the various documents with a single copy\n that is included in the collection, provided that you follow the\n rules of this License for verbatim copying of each of the documents\n in all other respects.\n\n You may extract a single document from such a collection, and\n distribute it individually under this License, provided you insert\n a copy of this License into the extracted document, and follow this\n License in all other respects regarding verbatim copying of that\n document.\n\n 7. AGGREGATION WITH INDEPENDENT WORKS\n\n A compilation of the Document or its derivatives with other\n separate and independent documents or works, in or on a volume of a\n storage or distribution medium, is called an "aggregate" if the\n copyright resulting from the compilation is not used to limit the\n legal rights of the compilation\'s users beyond what the individual\n works permit. When the Document is included in an aggregate, this\n License does not apply to the other works in the aggregate which\n are not themselves derivative works of the Document.\n\n If the Cover Text requirement of section 3 is applicable to these\n copies of the Document, then if the Document is less than one half\n of the entire aggregate, the Document\'s Cover Texts may be placed\n on covers that bracket the Document within the aggregate, or the\n electronic equivalent of covers if the Document is in electronic\n form. Otherwise they must appear on printed covers that bracket\n the whole aggregate.\n\n 8. TRANSLATION\n\n Translation is considered a kind of modification, so you may\n distribute translations of the Document under the terms of section\n 4. Replacing Invariant Sections with translations requires special\n permission from their copyright holders, but you may include\n translations of some or all Invariant Sections in addition to the\n original versions of these Invariant Sections. You may include a\n translation of this License, and all the license notices in the\n Document, and any Warranty Disclaimers, provided that you also\n include the original English version of this License and the\n original versions of those notices and disclaimers. In case of a\n disagreement between the translation and the original version of\n this License or a notice or disclaimer, the original version will\n prevail.\n\n If a section in the Document is Entitled "Acknowledgements",\n "Dedications", or "History", the requirement (section 4) to\n Preserve its Title (section 1) will typically require changing the\n actual title.\n\n 9. TERMINATION\n\n You may not copy, modify, sublicense, or distribute the Document\n except as expressly provided under this License. Any attempt\n otherwise to copy, modify, sublicense, or distribute it is void,\n and will automatically terminate your rights under this License.\n\n However, if you cease all violation of this License, then your\n license from a particular copyright holder is reinstated (a)\n provisionally, unless and until the copyright holder explicitly and\n finally terminates your license, and (b) permanently, if the\n copyright holder fails to notify you of the violation by some\n reasonable means prior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\n reinstated permanently if the copyright holder notifies you of the\n violation by some reasonable means, this is the first time you have\n received notice of violation of this License (for any work) from\n that copyright holder, and you cure the violation prior to 30 days\n after your receipt of the notice.\n\n Termination of your rights under this section does not terminate\n the licenses of parties who have received copies or rights from you\n under this License. If your rights have been terminated and not\n permanently reinstated, receipt of a copy of some or all of the\n same material does not give you any rights to use it.\n\n 10. FUTURE REVISIONS OF THIS LICENSE\n\n The Free Software Foundation may publish new, revised versions of\n the GNU Free Documentation License from time to time. Such new\n versions will be similar in spirit to the present version, but may\n differ in detail to address new problems or concerns. See\n <http://www.gnu.org/copyleft/>.\n\n Each version of the License is given a distinguishing version\n number. If the Document specifies that a particular numbered\n version of this License "or any later version" applies to it, you\n have the option of following the terms and conditions either of\n that specified version or of any later version that has been\n published (not as a draft) by the Free Software Foundation. If the\n Document does not specify a version number of this License, you may\n choose any version ever published (not as a draft) by the Free\n Software Foundation. If the Document specifies that a proxy can\n decide which future versions of this License can be used, that\n proxy\'s public statement of acceptance of a version permanently\n authorizes you to choose that version for the Document.\n\n 11. RELICENSING\n\n "Massive Multiauthor Collaboration Site" (or "MMC Site") means any\n World Wide Web server that publishes copyrightable works and also\n provides prominent facilities for anybody to edit those works. A\n public wiki that anybody can edit is an example of such a server.\n A "Massive Multiauthor Collaboration" (or "MMC") contained in the\n site means any set of copyrightable works thus published on the MMC\n site.\n\n "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0\n license published by Creative Commons Corporation, a not-for-profit\n corporation with a principal place of business in San Francisco,\n California, as well as future copyleft versions of that license\n published by that same organization.\n\n "Incorporate" means to publish or republish a Document, in whole or\n in part, as part of another Document.\n\n An MMC is "eligible for relicensing" if it is licensed under this\n License, and if all works that were first published under this\n License somewhere other than this MMC, and subsequently\n incorporated in whole or in part into the MMC, (1) had no cover\n texts or invariant sections, and (2) were thus incorporated prior\n to November 1, 2008.\n\n The operator of an MMC Site may republish an MMC contained in the\n site under CC-BY-SA on the same site at any time before August 1,\n 2009, provided the MMC is eligible for relicensing.\n\nADDENDUM: How to use this License for your documents\n====================================================\n\nTo use this License in a document you have written, include a copy of\nthe License in the document and put the following copyright and license\nnotices just after the title page:\n\n Copyright (C) YEAR YOUR NAME.\n Permission is granted to copy, distribute and/or modify this document\n under the terms of the GNU Free Documentation License, Version 1.3\n or any later version published by the Free Software Foundation;\n with no Invariant Sections, no Front-Cover Texts, and no Back-Cover\n Texts. A copy of the license is included in the section entitled ``GNU\n Free Documentation License\'\'.\n\n If you have Invariant Sections, Front-Cover Texts and Back-Cover\nTexts, replace the "with...Texts." line with this:\n\n with the Invariant Sections being LIST THEIR TITLES, with\n the Front-Cover Texts being LIST, and with the Back-Cover Texts\n being LIST.\n\n If you have Invariant Sections without Cover Texts, or some other\ncombination of the three, merge those two alternatives to suit the\nsituation.\n\n If your document contains nontrivial examples of program code, we\nrecommend releasing these examples in parallel under your choice of free\nsoftware license, such as the GNU General Public License, to permit\ntheir use in free software.\n\nIndex\n*****\n\n* Menu:\n\n* #endif, commenting: Comments. (line 2380)\n* --help output: --help. (line 948)\n* --version output: --version. (line 801)\n* -Wall compiler option: Syntactic Conventions.\n (line 2413)\n* accepting contributions: Contributions. (line 183)\n* address for bug reports: --help. (line 953)\n* ANSI C standard: Standard C. (line 355)\n* arbitrary limits on data: Semantics. (line 514)\n* ASCII characters: Character Set. (line 2830)\n* autoconf: System Portability. (line 2586)\n* avoiding proprietary code: Reading Non-Free Code.\n (line 149)\n* batch of changes: Change Log Concepts.\n (line 3141)\n* behavior, dependent on program\'s name: User Interfaces. (line 699)\n* binary packages: Install Command Categories.\n (line 4563)\n* bindir: Directory Variables.\n (line 3897)\n* braces, in C source: Formatting. (line 2196)\n* bug reports: --help. (line 953)\n* bug-standards@gnu.org email address: Preface. (line 112)\n* C compatibility: Compatibility. (line 292)\n* C library functions, and portability: System Functions. (line 2679)\n* canonical name of a program: --version. (line 807)\n* casting pointers to integers: CPU Portability. (line 2667)\n* CGI programs, standard options for: Command-Line Interfaces.\n (line 792)\n* change logs: Change Logs. (line 3130)\n* change logs, conditional changes: Conditional Changes.\n (line 3282)\n* change logs, style: Style of Change Logs.\n (line 3189)\n* change set: Change Log Concepts.\n (line 3141)\n* character set: Character Set. (line 2830)\n* clang: Syntactic Conventions.\n (line 2420)\n* command-line arguments, decoding: Semantics. (line 545)\n* command-line interface: Command-Line Interfaces.\n (line 767)\n* commenting: Comments. (line 2326)\n* compatibility with C and POSIX standards: Compatibility. (line 292)\n* compiler warnings: Syntactic Conventions.\n (line 2413)\n* conditional changes, and change logs: Conditional Changes.\n (line 3282)\n* conditionals, comments for: Comments. (line 2380)\n* configure: Configuration. (line 3414)\n* control-L: Formatting. (line 2318)\n* conventions for makefiles: Makefile Conventions.\n (line 3592)\n* CORBA: Graphical Interfaces.\n (line 751)\n* credits for manuals: Manual Credits. (line 3095)\n* D-bus: Graphical Interfaces.\n (line 751)\n* data structures, in Gnulib: System Functions. (line 2717)\n* data types, and portability: CPU Portability. (line 2624)\n* description, change log entry: Change Log Concepts.\n (line 3147)\n* DESTDIR: DESTDIR. (line 3802)\n* directories, creating installation: Directory Variables.\n (line 3860)\n* documentation: Documentation. (line 2895)\n* doschk: Names. (line 2555)\n* double quote: Quote Characters. (line 2846)\n* downloading this manual: Preface. (line 96)\n* dynamic plug-ins: Dynamic Plug-In Interfaces.\n (line 967)\n* encodings: Character Set. (line 2830)\n* enum types, formatting: Formatting. (line 2235)\n* error messages: Semantics. (line 524)\n* error messages, formatting: Errors. (line 634)\n* error messages, in Gnulib: System Functions. (line 2717)\n* exec_prefix: Directory Variables.\n (line 3879)\n* expressions, splitting: Formatting. (line 2281)\n* FDL, GNU Free Documentation License: GNU Free Documentation License.\n (line 4803)\n* file usage: File Usage. (line 2171)\n* file-name limitations: Names. (line 2555)\n* formatting error messages: Errors. (line 634)\n* formatting source code: Formatting. (line 2193)\n* formfeed: Formatting. (line 2318)\n* function argument, declaring: Syntactic Conventions.\n (line 2409)\n* function definitions, formatting: Formatting. (line 2196)\n* function prototypes: Standard C. (line 371)\n* getopt: Command-Line Interfaces.\n (line 767)\n* gettext: Internationalization.\n (line 2735)\n* GNOME: Graphical Interfaces.\n (line 751)\n* GNOME and Guile: Source Language. (line 281)\n* Gnulib: System Functions. (line 2710)\n* gnustandards project repository: Preface. (line 112)\n* gnustandards-commit@gnu.org mailing list: Preface. (line 106)\n* GNUstep: Graphical Interfaces.\n (line 740)\n* graphical user interface: Graphical Interfaces.\n (line 740)\n* grave accent: Quote Characters. (line 2846)\n* GTK+: Graphical Interfaces.\n (line 740)\n* Guile: Source Language. (line 281)\n* implicit int: Syntactic Conventions.\n (line 2409)\n* impossible conditions: Semantics. (line 571)\n* installation directories, creating: Directory Variables.\n (line 3860)\n* installations, staged: DESTDIR. (line 3802)\n* interface styles: Graphical Interfaces.\n (line 740)\n* internationalization: Internationalization.\n (line 2735)\n* keyboard interface: Graphical Interfaces.\n (line 751)\n* LDAP: OID Allocations. (line 2087)\n* left quote: Quote Characters. (line 2846)\n* legal aspects: Legal Issues. (line 143)\n* legal papers: Contributions. (line 183)\n* length of source lines: Formatting. (line 2193)\n* libexecdir: Directory Variables.\n (line 3910)\n* libiconv: Semantics. (line 519)\n* libraries: Libraries. (line 606)\n* library functions, and portability: System Functions. (line 2679)\n* library interface: Graphical Interfaces.\n (line 751)\n* license for manuals: License for Manuals.\n (line 3076)\n* line length: Formatting. (line 2193)\n* lint: Syntactic Conventions.\n (line 2420)\n* locale-specific quote characters: Quote Characters. (line 2846)\n* long option names: Option Table. (line 999)\n* long-named options: Command-Line Interfaces.\n (line 773)\n* makefile, conventions for: Makefile Conventions.\n (line 3592)\n* malloc return value: Semantics. (line 530)\n* man pages: Man Pages. (line 3344)\n* manual structure: Manual Structure Details.\n (line 3049)\n* memory allocation failure: Semantics. (line 530)\n* memory leak: Memory Usage. (line 2163)\n* memory usage: Memory Usage. (line 2146)\n* message text, and internationalization: Internationalization.\n (line 2758)\n* mmap: Mmap. (line 2878)\n* multiple variables in a line: Syntactic Conventions.\n (line 2446)\n* names of variables, functions, and files: Names. (line 2523)\n* NEWS file: NEWS File. (line 3116)\n* non-ASCII characters: Character Set. (line 2830)\n* non-POSIX systems, and portability: System Portability. (line 2595)\n* non-standard extensions: Using Extensions. (line 324)\n* NUL characters: Semantics. (line 519)\n* OID allocations for GNU: OID Allocations. (line 2087)\n* open brace: Formatting. (line 2196)\n* opening quote: Quote Characters. (line 2846)\n* optional features, configure-time: Configuration. (line 3506)\n* options for compatibility: Compatibility. (line 300)\n* options, standard command-line: Command-Line Interfaces.\n (line 792)\n* output device and program\'s behavior: User Interfaces. (line 707)\n* packaging: Releases. (line 4590)\n* PATH_INFO, specifying standard options as: Command-Line Interfaces.\n (line 792)\n* plug-ins: Dynamic Plug-In Interfaces.\n (line 967)\n* plugin_is_GPL_compatible: Dynamic Plug-In Interfaces.\n (line 978)\n* portability, and data types: CPU Portability. (line 2624)\n* portability, and library functions: System Functions. (line 2679)\n* portability, between system types: System Portability. (line 2569)\n* POSIX compatibility: Compatibility. (line 292)\n* POSIX functions, and portability: System Functions. (line 2679)\n* POSIXLY_CORRECT, environment variable: Compatibility. (line 307)\n* post-installation commands: Install Command Categories.\n (line 4489)\n* pre-installation commands: Install Command Categories.\n (line 4489)\n* prefix: Directory Variables.\n (line 3869)\n* program configuration: Configuration. (line 3414)\n* program design: Design Advice. (line 257)\n* program name and its behavior: User Interfaces. (line 699)\n* program\'s canonical name: --version. (line 807)\n* programming languages: Source Language. (line 263)\n* proprietary programs: Reading Non-Free Code.\n (line 149)\n* quote characters: Quote Characters. (line 2846)\n* README file: Releases. (line 4605)\n* references to non-free material: References. (line 4674)\n* releasing: Managing Releases. (line 3403)\n* right quote: Quote Characters. (line 2846)\n* Savannah repository for gnustandards: Preface. (line 112)\n* sbindir: Directory Variables.\n (line 3903)\n* signal handling: Semantics. (line 560)\n* single quote: Quote Characters. (line 2846)\n* SNMP: OID Allocations. (line 2087)\n* spaces before open-paren: Formatting. (line 2275)\n* staged installs: DESTDIR. (line 3802)\n* standard command-line options: Command-Line Interfaces.\n (line 792)\n* standards for makefiles: Makefile Conventions.\n (line 3592)\n* struct types, formatting: Formatting. (line 2235)\n* syntactic conventions: Syntactic Conventions.\n (line 2409)\n* table of long options: Option Table. (line 999)\n* temporary files: Semantics. (line 585)\n* temporary variables: Syntactic Conventions.\n (line 2434)\n* texinfo.tex, in a distribution: Releases. (line 4662)\n* title, change log entry: Change Log Concepts.\n (line 3147)\n* TMPDIR environment variable: Semantics. (line 585)\n* trademarks: Trademarks. (line 227)\n* user interface styles: Graphical Interfaces.\n (line 740)\n* valgrind: Memory Usage. (line 2163)\n* version numbers, for releases: Releases. (line 4590)\n* where to obtain standards.texi: Preface. (line 96)\n* X.509: OID Allocations. (line 2087)\n* xmalloc, in Gnulib: System Functions. (line 2717)\n\n'
In [53]:
import re
In [54]:
re.split('\W+',txt)
Out[54]:
['GNU',
'Coding',
'Standards',
'1',
'About',
'the',
'GNU',
'Coding',
'Standards',
'2',
'Keeping',
'Free',
'Software',
'Free',
'2',
'1',
'Referring',
'to',
'Proprietary',
'Programs',
'2',
'2',
'Accepting',
'Contributions',
'2',
'3',
'Trademarks',
'3',
'General',
'Program',
'Design',
'3',
'1',
'Which',
'Languages',
'to',
'Use',
'3',
'2',
'Compatibility',
'with',
'Other',
'Implementations',
'3',
'3',
'Using',
'Non',
'standard',
'Features',
'3',
'4',
'Standard',
'C',
'and',
'Pre',
'Standard',
'C',
'3',
'5',
'Conditional',
'Compilation',
'4',
'Program',
'Behavior',
'for',
'All',
'Programs',
'4',
'1',
'Non',
'GNU',
'Standards',
'4',
'2',
'Writing',
'Robust',
'Programs',
'4',
'3',
'Library',
'Behavior',
'4',
'4',
'Formatting',
'Error',
'Messages',
'4',
'5',
'Standards',
'for',
'Interfaces',
'Generally',
'4',
'6',
'Standards',
'for',
'Graphical',
'Interfaces',
'4',
'7',
'Standards',
'for',
'Command',
'Line',
'Interfaces',
'4',
'7',
'1',
'version',
'4',
'7',
'2',
'help',
'4',
'8',
'Standards',
'for',
'Dynamic',
'Plug',
'in',
'Interfaces',
'4',
'9',
'Table',
'of',
'Long',
'Options',
'4',
'10',
'OID',
'Allocations',
'4',
'11',
'Memory',
'Usage',
'4',
'12',
'File',
'Usage',
'5',
'Making',
'The',
'Best',
'Use',
'of',
'C',
'5',
'1',
'Formatting',
'Your',
'Source',
'Code',
'5',
'2',
'Commenting',
'Your',
'Work',
'5',
'3',
'Clean',
'Use',
'of',
'C',
'Constructs',
'5',
'4',
'Naming',
'Variables',
'Functions',
'and',
'Files',
'5',
'5',
'Portability',
'between',
'System',
'Types',
'5',
'6',
'Portability',
'between',
'CPUs',
'5',
'7',
'Calling',
'System',
'Functions',
'5',
'8',
'Internationalization',
'5',
'9',
'Character',
'Set',
'5',
'10',
'Quote',
'Characters',
'5',
'11',
'Mmap',
'6',
'Documenting',
'Programs',
'6',
'1',
'GNU',
'Manuals',
'6',
'2',
'Doc',
'Strings',
'and',
'Manuals',
'6',
'3',
'Manual',
'Structure',
'Details',
'6',
'4',
'License',
'for',
'Manuals',
'6',
'5',
'Manual',
'Credits',
'6',
'6',
'Printed',
'Manuals',
'6',
'7',
'The',
'NEWS',
'File',
'6',
'8',
'Change',
'Logs',
'6',
'8',
'1',
'Change',
'Log',
'Concepts',
'6',
'8',
'2',
'Style',
'of',
'Change',
'Logs',
'6',
'8',
'3',
'Simple',
'Changes',
'6',
'8',
'4',
'Conditional',
'Changes',
'6',
'8',
'5',
'Indicating',
'the',
'Part',
'Changed',
'6',
'9',
'Man',
'Pages',
'6',
'10',
'Reading',
'other',
'Manuals',
'7',
'The',
'Release',
'Process',
'7',
'1',
'How',
'Configuration',
'Should',
'Work',
'7',
'2',
'Makefile',
'Conventions',
'7',
'2',
'1',
'General',
'Conventions',
'for',
'Makefiles',
'7',
'2',
'2',
'Utilities',
'in',
'Makefiles',
'7',
'2',
'3',
'Variables',
'for',
'Specifying',
'Commands',
'7',
'2',
'4',
'DESTDIR',
'Support',
'for',
'Staged',
'Installs',
'7',
'2',
'5',
'Variables',
'for',
'Installation',
'Directories',
'7',
'2',
'6',
'Standard',
'Targets',
'for',
'Users',
'7',
'2',
'7',
'Install',
'Command',
'Categories',
'7',
'3',
'Making',
'Releases',
'8',
'References',
'to',
'Non',
'Free',
'Software',
'and',
'Documentation',
'Appendix',
'A',
'GNU',
'Free',
'Documentation',
'License',
'Index',
'GNU',
'Coding',
'Standards',
'The',
'GNU',
'coding',
'standards',
'last',
'updated',
'July',
'25',
'2016',
'Copyright',
'C',
'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',
'Free',
'Software',
'Foundation',
'Inc',
'Permission',
'is',
'granted',
'to',
'copy',
'distribute',
'and',
'or',
'modify',
'this',
'document',
'under',
'the',
'terms',
'of',
'the',
'GNU',
'Free',
'Documentation',
'License',
'Version',
'1',
'3',
'or',
'any',
'later',
'version',
'published',
'by',
'the',
'Free',
'Software',
'Foundation',
'with',
'no',
'Invariant',
'Sections',
'no',
'Front',
'Cover',
'Texts',
'and',
'no',
'Back',
'Cover',
'Texts',
'A',
'copy',
'of',
'the',
'license',
'is',
'included',
'in',
'the',
'section',
'entitled',
'GNU',
'Free',
'Documentation',
'License',
'1',
'About',
'the',
'GNU',
'Coding',
'Standards',
'The',
'GNU',
'Coding',
'Standards',
'were',
'written',
'by',
'Richard',
'Stallman',
'and',
'other',
'GNU',
'Project',
'volunteers',
'Their',
'purpose',
'is',
'to',
'make',
'the',
'GNU',
'system',
'clean',
'consistent',
'and',
'easy',
'to',
'install',
'This',
'document',
'can',
'also',
'be',
'read',
'as',
'a',
'guide',
'to',
'writing',
'portable',
'robust',
'and',
'reliable',
'programs',
'It',
'focuses',
'on',
'programs',
'written',
'in',
'C',
'but',
'many',
'of',
'the',
'rules',
'and',
'principles',
'are',
'useful',
'even',
'if',
'you',
'write',
'in',
'another',
'programming',
'language',
'The',
'rules',
'often',
'state',
'reasons',
'for',
'writing',
'in',
'a',
'certain',
'way',
'If',
'you',
'did',
'not',
'obtain',
'this',
'file',
'directly',
'from',
'the',
'GNU',
'project',
'and',
'recently',
'please',
'check',
'for',
'a',
'newer',
'version',
'You',
'can',
'get',
'the',
'GNU',
'Coding',
'Standards',
'from',
'the',
'GNU',
'web',
'server',
'in',
'many',
'different',
'formats',
'including',
'the',
'Texinfo',
'source',
'PDF',
'HTML',
'DVI',
'plain',
'text',
'and',
'more',
'at',
'http',
'www',
'gnu',
'org',
'prep',
'standards',
'If',
'you',
'are',
'maintaining',
'an',
'official',
'GNU',
'package',
'in',
'addition',
'to',
'this',
'document',
'please',
'read',
'and',
'follow',
'the',
'GNU',
'maintainer',
'information',
'note',
'Contents',
'maintain',
'Top',
'If',
'you',
'want',
'to',
'receive',
'diffs',
'for',
'every',
'change',
'to',
'these',
'GNU',
'documents',
'join',
'the',
'mailing',
'list',
'gnustandards',
'commit',
'gnu',
'org',
'via',
'the',
'web',
'interface',
'at',
'http',
'lists',
'gnu',
'org',
'mailman',
'listinfo',
'gnustandards',
'commit',
'Archives',
'are',
'also',
'available',
'there',
'Please',
'send',
'corrections',
'or',
'suggestions',
'for',
'this',
'document',
'to',
'bug',
'standards',
'gnu',
'org',
'If',
'you',
'make',
'a',
'suggestion',
'please',
'include',
'a',
'suggested',
'new',
'wording',
'for',
'it',
'to',
'help',
'us',
'consider',
'the',
'suggestion',
'efficiently',
'We',
'prefer',
'a',
'context',
'diff',
'to',
'the',
'Texinfo',
'source',
'but',
'if',
'that',
's',
'difficult',
'for',
'you',
'you',
'can',
'make',
'a',
'context',
'diff',
'for',
'some',
'other',
'version',
'of',
'this',
'document',
'or',
'propose',
'it',
'in',
'any',
'way',
'that',
'makes',
'it',
'clear',
'The',
'source',
'repository',
'for',
'this',
'document',
'can',
'be',
'found',
'at',
'http',
'savannah',
'gnu',
'org',
'projects',
'gnustandards',
'These',
'standards',
'cover',
'the',
'minimum',
'of',
'what',
'is',
'important',
'when',
'writing',
'a',
'GNU',
'package',
'Likely',
'the',
'need',
'for',
'additional',
'standards',
'will',
'come',
'up',
'Sometimes',
'you',
'might',
'suggest',
'that',
'such',
'standards',
'be',
'added',
'to',
'this',
'document',
'If',
'you',
'think',
'your',
'standards',
'would',
'be',
'generally',
'useful',
'please',
'do',
'suggest',
'them',
'You',
'should',
'also',
'set',
'standards',
'for',
'your',
'package',
'on',
'many',
'questions',
'not',
'addressed',
'or',
'not',
'firmly',
'specified',
'here',
'The',
'most',
'important',
'point',
'is',
'to',
'be',
'self',
'consistent',
'try',
'to',
'stick',
'to',
'the',
'conventions',
'you',
'pick',
'and',
'try',
'to',
'document',
'them',
'as',
'much',
'as',
'possible',
'That',
'way',
'your',
'program',
'will',
'be',
'more',
'maintainable',
'by',
'others',
'The',
'GNU',
'Hello',
'program',
'serves',
'as',
'an',
'example',
'of',
'how',
'to',
'follow',
'the',
'GNU',
'coding',
'standards',
'for',
'a',
'trivial',
'program',
'http',
'www',
'gnu',
'org',
'software',
'hello',
'hello',
'html',
'This',
'release',
'of',
'the',
'GNU',
'Coding',
'Standards',
'was',
'last',
'updated',
'July',
'25',
'2016',
'2',
'Keeping',
'Free',
'Software',
'Free',
'This',
'chapter',
'discusses',
'how',
'you',
'can',
'make',
'sure',
'that',
'GNU',
'software',
'avoids',
'legal',
'difficulties',
'and',
'other',
'related',
'issues',
'2',
'1',
'Referring',
'to',
'Proprietary',
'Programs',
'Don',
't',
'in',
'any',
'circumstances',
'refer',
'to',
'Unix',
'source',
'code',
'for',
'or',
'during',
'your',
'work',
'on',
'GNU',
'Or',
'to',
'any',
'other',
'proprietary',
'programs',
'If',
'you',
'have',
'a',
'vague',
'recollection',
'of',
'the',
'internals',
'of',
'a',
'Unix',
'program',
'this',
'does',
'not',
'absolutely',
'mean',
'you',
'can',
't',
'write',
'an',
'imitation',
'of',
'it',
'but',
'do',
'try',
'to',
'organize',
'the',
'imitation',
'internally',
'along',
'different',
'lines',
'because',
'this',
'is',
'likely',
'to',
'make',
'the',
'details',
'of',
'the',
'Unix',
'version',
...]
In [55]:
c3=Counter(re.split('\W+',txt))
In [56]:
c3
Out[56]:
Counter({'concepts': 5,
'': 1,
'GPLv3': 1,
'There': 20,
'second': 3,
'silently': 1,
'INSTALL_PROGRAM': 7,
'VALUE': 2,
'Guile': 8,
'passwd': 1,
'context': 6,
'topic': 4,
'missing': 4,
'nicely': 1,
'flex': 2,
'application': 2,
'level': 11,
'Or': 5,
'word': 10,
'styles': 4,
'unshar': 4,
'July': 2,
'Commands': 3,
'compromise': 1,
'one': 95,
'N': 4,
'NEWS': 6,
'rcs': 1,
'localedir': 3,
'structured': 2,
'BISONFLAGS': 1,
'alter': 4,
'Of': 1,
'clean': 11,
'dev': 2,
'problem': 16,
'specification': 3,
'thank': 1,
'together': 7,
'4674': 1,
'produces': 1,
'aggregate': 6,
'piping': 1,
'overrides': 1,
'units': 2,
'importantly': 1,
'trademarks': 3,
'nontrivial': 2,
'device': 6,
'through': 11,
'emacs': 3,
'nfca': 1,
'someone': 6,
'UTF': 3,
'tail': 5,
'2196': 3,
'prohibit': 1,
'Although': 1,
'condition': 3,
'Which': 2,
'build': 34,
'enhanced': 1,
'equivalent': 7,
'community': 2,
'fail': 4,
'nor': 1,
'YOUR': 1,
'HTTP': 1,
'literal': 2,
'VPATH': 3,
'optionally': 1,
'tmp': 5,
'13': 14,
'easy': 14,
'Building': 1,
'2001': 3,
'foobarha': 2,
'requires': 11,
'execution': 8,
'enclose': 1,
'forth': 1,
'interface': 19,
'column': 14,
'Javascript': 5,
'Simple': 2,
'validity': 1,
'perl': 1,
'composed': 1,
'reproduced': 1,
'output': 47,
'arbitrary': 4,
'model': 1,
'keymap': 1,
'an': 116,
'explained': 1,
'capitalize': 2,
'plain': 5,
'i': 14,
'Common': 1,
'silence': 3,
'hope': 3,
'fgrep': 1,
'disclaimer': 2,
'login': 1,
'man1dir': 1,
'change': 55,
'Mmap': 3,
'configuration': 18,
'parts': 5,
'ranlib': 3,
'FILE2': 1,
'contribution': 2,
'bottom': 1,
'programming': 5,
'will': 78,
'visible': 2,
'updated': 4,
'dereference': 3,
'It': 56,
'psdir': 2,
'clear': 5,
'strings': 11,
'Doc': 3,
'Managing': 1,
'executed': 1,
'ls': 28,
'MAILING': 1,
'thing': 3,
'command': 47,
'preexisting': 1,
'_use_': 1,
'Automake': 8,
'escape': 2,
'Different': 1,
'Commons': 2,
'sounds': 1,
'machines': 10,
'form': 11,
'jdoe': 2,
'templates': 1,
'modify': 19,
'merely': 4,
'substitute': 2,
't': 117,
'view': 1,
'speed': 5,
'verbatim': 5,
'About': 2,
'Changing': 1,
'init': 3,
'Concepts': 6,
'newlines': 1,
'complicate': 1,
'Table': 5,
'library': 16,
'Feature': 1,
'else': 26,
'splitting': 1,
'its': 41,
'follows': 8,
'307': 1,
'seen': 2,
'PREAMBLE': 1,
'AR': 1,
'mostly': 1,
'dev_t': 4,
'Whoever': 1,
'since': 17,
'Poznyakoff': 1,
'comes': 3,
'replace': 10,
'inserted': 2,
'constant': 2,
'ndj': 1,
'which': 101,
'asserting': 1,
'whatsoever': 1,
'gitweb': 2,
'THEIR': 1,
'member': 2,
'adopted': 1,
'_always_': 1,
'obey': 1,
'auto': 3,
'ncdb': 1,
'store': 2,
'Software': 16,
'FLEX': 1,
'constructs': 1,
'el': 5,
'to': 831,
'OID': 9,
'thwart': 1,
'printing': 3,
'actual': 9,
'adjacent': 2,
'Document': 63,
'Appendix': 2,
'COPYING': 4,
'forming': 1,
'process': 6,
'informal': 1,
'facilities': 5,
'Plug': 5,
'precise': 2,
'_each_': 1,
'cd': 1,
'R': 4,
'preceding': 4,
'stty': 2,
'introduction': 1,
'inconsistencies': 1,
'Start': 2,
'bsd': 1,
'implemented': 4,
'really': 4,
'designed': 6,
'stopped': 1,
'automatic': 3,
'fullname': 1,
'AND': 1,
'Sticking': 1,
'magic': 1,
'pair': 1,
'paragraph': 2,
'Unix': 24,
'Apache': 2,
'practices': 1,
'principles': 1,
'lot': 3,
'are': 221,
'accessibility': 2,
'suggest': 2,
'prompt': 2,
'expressions': 1,
'relative': 1,
'valid': 2,
'unpacks': 1,
'Specify': 5,
'org': 45,
'silver': 1,
'techniques': 1,
'negation': 1,
'notation': 1,
'modifying': 1,
'basename': 2,
'their': 37,
'beginner': 2,
'128': 4,
'looking': 1,
'Log': 6,
'questions': 4,
'precisions': 1,
'over': 6,
'__future__': 1,
'gnulib': 4,
'gpl': 2,
'synclines': 1,
'format': 25,
'scenarios': 1,
'nowadays': 2,
'allocations': 1,
'use': 182,
'Since': 2,
'addressed': 2,
'formats': 13,
'current': 7,
're': 4,
'Compression': 1,
'f': 22,
'smallest': 2,
'formatted': 2,
'cpio': 16,
'states': 1,
'Each': 6,
'installed': 28,
'where': 30,
'why': 2,
'Usual': 1,
'WARRANTY': 1,
'work': 51,
'cs': 1,
'readnow': 1,
'If': 130,
'Project': 5,
'exist': 8,
'Termination': 1,
'per': 3,
'procs': 1,
'14': 6,
'verify': 2,
'independence': 1,
'dependencies': 8,
'user': 44,
'calendar': 1,
'q': 3,
'Syntactic': 9,
'Therefore': 1,
'server': 8,
'Used': 44,
'Anything': 1,
'NaN': 1,
'floppy': 5,
'V': 4,
'manually': 1,
'Names': 4,
'CFLAGS': 14,
'keyword': 1,
'configured': 2,
'simple': 15,
'Sending': 1,
'of': 663,
'difficult': 2,
'initialize': 1,
'519': 2,
'tool_bar_items': 1,
'accordingly': 1,
'reconstruct': 2,
'undefined': 2,
'gethelp': 1,
'identifiers': 1,
'uninstall': 7,
'distinction': 1,
'print': 16,
'restarting': 1,
'propose': 1,
'layout': 5,
'says': 6,
'against': 2,
'spread': 1,
'were': 17,
'hours': 1,
'holders': 1,
'Declarations': 1,
'Replacing': 1,
'hurts': 1,
'activities': 2,
'discusses': 3,
'allow': 4,
'working': 1,
'increased': 1,
'alternatives': 5,
'Site': 3,
'traditionally': 1,
'major': 2,
'back': 2,
'mentioned': 1,
'footnote': 1,
'title': 23,
'purposes': 4,
'patterns': 1,
'paginate': 1,
'null': 3,
'Berkeley': 1,
'l': 15,
'In': 56,
'flag': 1,
'finds': 1,
'leads': 1,
'contexts': 1,
'by': 124,
'safe': 2,
'disk': 11,
'parent': 7,
'algorithm': 1,
'entire': 8,
'encouraged': 1,
'ChangeLog': 3,
'generate': 5,
'drawings': 1,
'screen': 5,
'service': 1,
'standards': 22,
'posix': 2,
'medium': 3,
'reduce': 2,
'YEAR': 1,
'conditionally': 1,
'block': 6,
'Command': 17,
'tests': 5,
'accent': 1,
'specifications': 4,
'matches': 1,
'TRANSLATION': 1,
'FDL': 2,
'compiled': 5,
'altering': 1,
'First': 1,
'upper': 2,
'stable': 1,
'4803': 1,
'uid': 1,
'formfeeds': 1,
'but': 90,
'Additional': 2,
'an_integer': 1,
'rules': 15,
'endorsement': 1,
'around': 6,
'1994': 1,
'employ': 1,
'tone': 1,
'suppress': 1,
'person': 4,
'_not_': 5,
'keyboard': 4,
'xml': 1,
'certain': 16,
'document': 23,
'operations': 1,
'exclusively': 1,
'listing': 2,
'multibyte': 1,
'Only': 1,
'vc': 1,
'these': 72,
'operator': 2,
'instead': 28,
'information': 24,
'debugging': 4,
'_topic_': 1,
'Despite': 1,
'handling': 2,
'978': 1,
'X': 8,
'searching': 1,
'normal': 17,
'gzipped': 1,
'what': 34,
'lock': 1,
'operate': 6,
'quote': 12,
'optimized': 1,
'approved': 1,
'scan': 1,
'autoconf': 5,
'anyone': 1,
'insert': 8,
'loaded': 2,
'chap2': 3,
'System': 19,
'd': 20,
'6': 80,
'rms': 1,
'customary': 1,
'contributing': 1,
'may': 75,
'read': 18,
'compatibly': 3,
'Here': 21,
'recently': 3,
'3910': 1,
'responsibility': 1,
'precisely': 6,
'running': 9,
'received': 3,
'fdlist': 1,
'California': 1,
'valgrind': 2,
'gender': 1,
'target': 37,
'Category': 1,
'work_': 1,
'gettext': 27,
'bytes': 3,
'distributed': 3,
'promote': 6,
'Plugins': 2,
'08': 1,
'extract': 2,
'algorithms': 2,
'poorly': 1,
'condition_': 1,
'While': 1,
'during': 5,
'guile': 2,
'putting': 4,
'module': 2,
'bit': 3,
'Style': 3,
'CRC': 2,
'HEAD': 2,
'tag': 2,
'mentioning': 3,
'mt': 1,
'sewing': 2,
'not_': 1,
'_should': 1,
'end': 11,
'popularizes': 1,
'feature': 10,
'interpreter': 4,
'demands': 1,
'environment': 10,
'web': 15,
'reading': 7,
'Macintosh': 1,
'Scheme': 4,
'pertain': 5,
'nested': 4,
'remaining': 1,
'NORMAL_INSTALL': 3,
'entries': 7,
'emacsclient': 1,
'prof': 2,
'likely': 6,
'solution': 1,
'immediately': 1,
'Explain': 1,
'company': 3,
'defaults': 2,
'GNUstep': 2,
'orders': 1,
'LDFLAGS': 1,
'calls': 5,
'provided': 11,
'regardless': 4,
'security': 2,
'mktemp': 2,
'assignments': 4,
'fetch': 2,
'essentially': 1,
'shells': 1,
'aside': 3,
'show': 7,
'anywhere': 1,
'making': 9,
'count': 4,
'properly': 3,
'have': 87,
'older': 3,
'independently': 3,
'labeling': 1,
'brace': 5,
'tried_implicit': 2,
'generality': 1,
'PDF': 3,
'typically': 8,
'nonblank': 1,
'returns': 2,
'file_descriptor': 2,
'handle': 7,
'expression': 2,
'startup': 1,
'happen': 1,
'Usually': 2,
'decided': 1,
'jclark': 1,
'precaution': 1,
'106': 1,
'O_EXCL': 1,
'nsc': 1,
'very': 13,
'ps': 2,
'carry': 2,
'development': 3,
'browser': 2,
'exact': 2,
'paramount': 2,
'today': 1,
'needs': 13,
'deal': 3,
'contributions': 2,
'refers': 3,
'define': 19,
'passes': 1,
'regards': 3,
'recommended': 5,
'di2': 1,
'powerful': 1,
'24': 2,
'2': 77,
'former': 3,
'man1': 1,
'core': 2,
'gawk': 13,
'Shishi': 1,
'2087': 4,
'certificates': 1,
'kill': 2,
'v': 5,
'never': 11,
'period': 5,
'processes': 1,
'contents': 7,
'advanced': 1,
'interfaces': 6,
'business': 1,
'Wconversion': 1,
'bug': 10,
'written': 17,
'alarms': 2,
'closing': 5,
'automate': 1,
'stripping': 1,
'cleaner': 3,
'refuse': 2,
'failing': 1,
'benefit': 2,
'violation': 5,
'typeset': 1,
'0x60': 1,
'Entitled': 14,
'effort': 4,
'case': 28,
'10': 8,
'defs': 1,
'shared': 3,
'irrelevant': 2,
'let': 1,
'Invariant': 22,
'guide': 1,
'D': 8,
'suggestion': 3,
'Installation': 3,
'formfeed': 2,
'LD': 1,
'region': 1,
'prepared': 1,
'kinds': 12,
'GFDL': 2,
'shadow': 1,
'These': 19,
'base': 3,
'operation': 7,
'sizeof': 3,
'15': 2,
'undo': 1,
'zeros': 2,
'job': 7,
'places': 5,
'Executable': 1,
'diff3': 1,
'section': 44,
'ru_utime': 4,
'on': 128,
'AT': 4,
'POSIX_ME_HARDER': 1,
'was': 12,
'NUL': 2,
'Error': 5,
'conventional': 1,
'whichever': 2,
'RANLIB': 1,
'MSDOS': 1,
'subject': 10,
'eligible': 2,
'horizontal': 1,
'supplied': 1,
'graphics': 1,
'var': 3,
'Addendum': 1,
'basic': 3,
'countries': 1,
'diffs': 2,
'load': 2,
'md5sum': 1,
'reasonably': 3,
'compiler': 21,
'lib': 4,
'pages': 29,
'unknown': 1,
'decode': 2,
'small': 3,
'sake': 3,
'times': 1,
'copies': 21,
'briefly': 1,
'State': 1,
'tempted': 2,
'ul': 3,
'recipe': 1,
'inmode': 6,
'truncate': 2,
'builtin': 1,
'U': 1,
'simplicity': 2,
'label': 1,
'absence': 1,
'2667': 1,
'canonical': 4,
'administrators': 1,
'new': 29,
'update': 9,
'exclude': 3,
'2420': 2,
'try': 11,
'manual': 54,
'trailing': 1,
'profit': 1,
'fichier': 1,
'2011': 2,
'changes': 35,
'know': 11,
'means': 27,
'Cover': 26,
'REVERSIBLE_CC_MODE': 2,
'lists': 7,
'tables': 4,
'Title': 11,
'once': 5,
'sites': 4,
'August': 1,
'Even': 2,
'our': 7,
'floating': 1,
'passing': 1,
'stops': 1,
'supporting': 4,
'probably': 7,
'returned': 2,
'staged': 3,
'parse': 2,
'k': 3,
'substituted': 1,
'Variation': 1,
'editions': 1,
'BSD': 5,
'thinking': 1,
'Page': 6,
'Python': 5,
'Several': 1,
'Coding': 7,
'Include': 5,
'structuring': 2,
'However': 19,
'except': 7,
'whatever': 3,
'backup': 1,
'TIGER': 1,
'applied': 3,
'foreground': 2,
'May': 1,
'instruction': 1,
'unexpand': 2,
'subdirectory': 11,
'lack': 1,
'subsequently': 1,
'processing': 2,
'binding': 1,
'does': 37,
'another': 18,
'wrong': 1,
'371': 1,
'Java': 8,
'Internationalization': 6,
'basics': 1,
'simpler': 1,
'sales': 1,
'authorizes': 1,
'other': 100,
'_including': 1,
'arglength': 1,
'cessation': 1,
'any': 108,
'welcome': 1,
'agents': 1,
'Unicode': 1,
'avoiding': 2,
'released': 8,
'template': 1,
'Running': 2,
'unique': 3,
'record': 4,
'from': 99,
'invokes': 1,
'Whether': 1,
'Zlib': 2,
'clearly': 3,
'locales': 1,
'z': 11,
'Allocations': 6,
'ip5': 1,
'into': 44,
'daemons': 1,
'reports': 4,
'Traitement': 1,
'undefine': 1,
'matter': 5,
'directory': 78,
'HAVE_LIBNCURSES': 2,
'invoke': 5,
'indent': 3,
'Implementations': 2,
'42': 1,
'vi': 2,
'libraries': 18,
'sponsored': 1,
'nonreentrancy': 1,
'MS': 4,
'Patch': 1,
'explaining': 3,
'could': 14,
'Part': 2,
'ldconfig': 3,
'howto': 1,
'directories': 39,
'big': 3,
'Certain': 1,
'regarding': 2,
'compilers': 10,
'SUFFIXES': 2,
'almost': 4,
'contact': 1,
'readability': 2,
'Update': 1,
'_don': 1,
'should': 263,
'technique': 5,
'792': 4,
'K': 1,
'meaningful': 3,
'package': 62,
'processed': 6,
'compensation': 1,
'Address': 1,
'the': 1573,
'DIRNAME': 1,
'wider': 1,
'mkfifo': 2,
'1': 165,
'as': 249,
'unusual': 2,
'publish': 4,
'designing': 1,
'P': 7,
'Giving': 1,
'b': 14,
'mv': 8,
'Historically': 1,
'pixels': 1,
'Process': 2,
'expand': 5,
'F': 9,
'Example': 1,
'reboot': 2,
'breaking': 1,
'differences': 2,
'inline': 1,
'docdir': 5,
'various': 11,
'CBC': 3,
'listinfo': 1,
'message': 13,
'2015': 1,
'suit': 1,
'breakdown': 1,
'reads': 3,
'manext': 2,
'explanation': 10,
'unsigned': 4,
'obtain': 2,
'behave': 2,
'Format': 1,
'copyrighted': 1,
'users': 36,
'unacceptable': 1,
'provision': 1,
'Compile': 2,
'MPL': 2,
'info': 30,
'assert': 1,
'invoking': 1,
'win': 8,
'doesn': 4,
'objdump': 4,
'systems': 36,
'Referring': 4,
'Behavior': 4,
'contributors': 2,
'tie': 1,
'video': 1,
'successfully': 2,
'employer': 1,
'understand': 5,
'convenient': 6,
'publisher': 12,
'signed': 2,
'translated': 3,
'php': 1,
'entirely': 6,
'Man': 4,
'ideally': 2,
'extracted': 1,
'graphic': 1,
'operating': 7,
'placate': 1,
'cause': 4,
'compatible': 11,
'send': 2,
'conditional': 11,
'doc': 4,
'07': 2,
'Such': 5,
'portions': 1,
'op': 1,
'originally': 1,
'conditions': 14,
'conditionalized': 1,
'unhappy': 3,
'distribute': 16,
'numbers': 9,
'appear': 10,
'143': 1,
'driven': 1,
'invariant': 2,
'imports': 1,
'structure': 16,
'preserves': 1,
'Arrange': 2,
'minor': 3,
'editing': 2,
'regard': 1,
'Portable': 5,
'related': 4,
'byte': 2,
'initialized': 1,
'tv_sec': 4,
'direct': 2,
'3414': 2,
'short': 7,
'agrees': 2,
'C89': 2,
'represented': 1,
'Device': 1,
'_Each_': 1,
'sum': 1,
'extensions': 15,
'bigger': 1,
'Next': 3,
'948': 1,
'choice': 3,
'disclaimers': 1,
'LDAP': 2,
'is': 497,
'cc': 1,
'machine': 13,
'two': 26,
'large': 10,
'suggested': 3,
'including': 4,
'say': 7,
'773': 1,
'cp': 13,
'appearance': 1,
'duplicate': 2,
'until': 8,
'doing': 4,
'interactive': 5,
'hardcopy': 1,
'Defining': 1,
'concerns': 1,
'legally': 2,
'2004': 1,
'Serpent': 13,
'conversion': 1,
'prefers': 1,
'known': 6,
'full': 18,
'scripting': 1,
'CGI': 2,
'catalogs': 1,
'fdmountd': 1,
'enum': 4,
'SPECIAL': 1,
'1992': 1,
'Fcommand_execute': 1,
'translations': 8,
'can': 136,
'method': 2,
'Otherwise': 3,
'implement': 6,
'headers': 1,
'utilities': 11,
'for': 447,
'mind': 1,
'refer': 17,
'fi': 2,
'LaTeX': 1,
'tutorial': 3,
'programs': 103,
'usefully': 1,
'edits': 1,
'nx': 1,
'narrow': 1,
'licensing': 3,
'Near': 1,
'bad': 2,
'redistribute': 2,
'bap': 1,
'face': 1,
'guaranteed': 1,
'collection': 5,
'lower': 5,
'www': 28,
'11': 5,
'X11': 1,
'doschk': 3,
'existed': 3,
...})
In [59]:
c3.most_common(10)
Out[59]:
[('the', 1573),
('in', 844),
('to', 831),
('of', 663),
('a', 652),
('is', 497),
('and', 494),
('for', 447),
('that', 368),
('it', 325)]
In [60]:
d={x:randint(60,100) for x in 'xyzabc'}
In [61]:
sorted(d)
Out[61]:
['a', 'b', 'c', 'x', 'y', 'z']
In [62]:
iter(d)
Out[62]:
<dict_keyiterator at 0x7f57a86af9f8>
In [63]:
list(iter(d))
Out[63]:
['a', 'c', 'z', 'x', 'y', 'b']
In [64]:
d
Out[64]:
{'a': 60, 'b': 98, 'c': 93, 'x': 92, 'y': 79, 'z': 80}
In [65]:
(97,'a')>(69,'b')
Out[65]:
True
In [66]:
(98,'b')>(98,'c')
Out[66]:
False
In [67]:
d.items()
Out[67]:
dict_items([('a', 60), ('c', 93), ('z', 80), ('x', 92), ('y', 79), ('b', 98)])
In [69]:
zip(d.keys(),d.values())
Out[69]:
<zip at 0x7f57ab045c08>
In [70]:
list(zip(d.keys(),d.values()))
Out[70]:
[('a', 60), ('c', 93), ('z', 80), ('x', 92), ('y', 79), ('b', 98)]
In [ ]:
Content source: quietcoolwu/python-playground
Similar notebooks: