⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intro.texi

📁 一个C源代码分析器
💻 TEXI
📖 第 1 页 / 共 2 页
字号:
@end itemizeFor example, suppose the header file @file{stdlib.h} declares a functionnamed @code{abs} with@smallexampleextern int abs (int);@end smallexample@noindentand also provides a macro definition for @code{abs}.  Then, in:@smallexample#include <stdlib.h>int f (int *i) @{ return (abs (++*i)); @}@end smallexample@noindentthe reference to @code{abs} might refer to either a macro or a function.On the other hand, in each of the following examples the reference isto a function and not a macro.@smallexample#include <stdlib.h>int g (int *i) @{ return ((abs)(++*i)); @}#undef absint h (int *i) @{ return (abs (++*i)); @}@end smallexampleSince macro definitions that double for a function behave inexactly the same way as the actual function version, there is usually noneed for any of these methods.  In fact, removing macro definitions usuallyjust makes your program slower.@node Reserved Names, Feature Test Macros, Macro Definitions, Using the Library@subsection Reserved Names@cindex reserved names@cindex name spaceThe names of all library types, macros, variables and functions thatcome from the ANSI C standard are reserved unconditionally; your program@strong{may not} redefine these names.  All other library names arereserved if your program explicitly includes the header file thatdefines or declares them.  There are several reasons for theserestrictions:@itemize @bullet@itemOther people reading your code could get very confused if you were usinga function named @code{exit} to do something completely different fromwhat the standard @code{exit} function does, for example.  Preventingthis situation helps to make your programs easier to understand andcontributes to modularity and maintainability.@itemIt avoids the possibility of a user accidentally redefining a libraryfunction that is called by other library functions.  If redefinitionwere allowed, those other functions would not work properly.@itemIt allows the compiler to do whatever special optimizations it pleaseson calls to these functions, without the possibility that they may havebeen redefined by the user.  Some library facilities, such as those fordealing with variadic arguments (@pxref{Variadic Functions})and non-local exits (@pxref{Non-Local Exits}), actually require aconsiderable amount of cooperation on the part of the C compiler, andimplementationally it might be easier for the compiler to treat these asbuilt-in parts of the language.@end itemizeIn addition to the names documented in this manual, reserved namesinclude all external identifiers (global functions and variables) thatbegin with an underscore (@samp{_}) and all identifiers regardless ofuse that begin with either two underscores or an underscore followed bya capital letter are reserved names.  This is so that the library andheader files can define functions, variables, and macros for internalpurposes without risk of conflict with names in user programs.Some additional classes of identifier names are reserved for futureextensions to the C language.  While using these names for your ownpurposes right now might not cause a problem, they do raise thepossibility of conflict with future versions of the C standard, so youshould avoid these names.@itemize @bullet@item Names beginning with a capital @samp{E} followed a digit or uppercaseletter may be used for additional error code names.  @xref{ErrorReporting}.@itemNames that begin with either @samp{is} or @samp{to} followed by alowercase letter may be used for additional character testing andconversion functions.  @xref{Character Handling}.@itemNames that begin with @samp{LC_} followed by an uppercase letter may beused for additional macros specifying locale attributes.@xref{Locales}.@itemNames of all existing mathematics functions (@pxref{Mathematics})suffixed with @samp{f} or @samp{l} are reserved for correspondingfunctions that operate on @code{float} and @code{long double} arguments,respectively.@itemNames that begin with @samp{SIG} followed by an uppercase letter arereserved for additional signal names.  @xref{Standard Signals}.@itemNames that begin with @samp{SIG_} followed by an uppercase letter arereserved for additional signal actions.  @xref{Basic Signal Handling}.@itemNames beginning with @samp{str}, @samp{mem}, or @samp{wcs} followed by alowercase letter are reserved for additional string and array functions.@xref{String and Array Utilities}.@itemNames that end with @samp{_t} are reserved for additional type names.@end itemizeIn addition, some individual header files reserve names beyondthose that they actually define.  You only need to worry about theserestrictions if your program includes that particular header file.@itemize @bullet@itemThe header file @file{dirent.h} reserves names prefixed with@samp{d_}.@pindex dirent.h@itemThe header file @file{fcntl.h} reserves names prefixed with@samp{l_}, @samp{F_}, @samp{O_}, and @samp{S_}.@pindex fcntl.h@itemThe header file @file{grp.h} reserves names prefixed with @samp{gr_}.@pindex grp.h@itemThe header file @file{limits.h} reserves names suffixed with @samp{_MAX}.@pindex limits.h@itemThe header file @file{pwd.h} reserves names prefixed with @samp{pw_}.@pindex pwd.h@itemThe header file @file{signal.h} reserves names prefixed with @samp{sa_}and @samp{SA_}.@pindex signal.h@itemThe header file @file{sys/stat.h} reserves names prefixed with @samp{st_}and @samp{S_}.@pindex sys/stat.h@itemThe header file @file{sys/times.h} reserves names prefixed with @samp{tms_}.@pindex sys/times.h@itemThe header file @file{termios.h} reserves names prefixed with @samp{c_},@samp{V}, @samp{I}, @samp{O}, and @samp{TC}; and names prefixed with@samp{B} followed by a digit.@pindex termios.h@end itemize@comment Include the section on Creature Nest Macros.@comment It is in a separate file so it can be formatted into ../NOTES.@include creature.texi@node Roadmap to the Manual,  , Using the Library, Introduction@section Roadmap to the ManualHere is an overview of the contents of the remaining chapters ofthis manual.@itemize @bullet@item @ref{Error Reporting}, describes how errors detected by the libraryare reported.@item @ref{Language Features}, contains information about library support forstandard parts of the C language, including things like the @code{sizeof}operator and the symbolic constant @code{NULL}, how to write functionsaccepting variable numbers of arguments, and constants describing theranges and other properties of the numerical types.  There is also a simpledebugging mechanism which allows you to put assertions in your code, andhave diagnostic messages printed if the tests fail.@item @ref{Memory Allocation}, describes the GNU library's facilities fordynamic allocation of storage.  If you do not know in advance how muchstorage your program needs, you can allocate it dynamically instead,and manipulate it via pointers.@item @ref{Character Handling}, contains information about characterclassification functions (such as @code{isspace}) and functions forperforming case conversion.@item @ref{String and Array Utilities}, has descriptions of functions formanipulating strings (null-terminated character arrays) and generalbyte arrays, including operations such as copying and comparison.@item@ref{I/O Overview}, gives an overall look at the input and outputfacilities in the library, and contains information about basic conceptssuch as file names.@item@ref{I/O on Streams}, describes I/O operations involving streams (or@w{@code{FILE *}} objects).  These are the normal C library functionsfrom @file{stdio.h}.@item@ref{Low-Level I/O}, contains information about I/O operationson file descriptors.  File descriptors are a lower-level mechanismspecific to the Unix family of operating systems.@item@ref{File System Interface}, has descriptions of operations on entirefiles, such as functions for deleting and renaming them and for creatingnew directories.  This chapter also contains information about how youcan access the attributes of a file, such as its owner and file protectionmodes.@item@ref{Pipes and FIFOs}, contains information about simple interprocesscommunication mechanisms.  Pipes allow communication between two relatedprocesses (such as between a parent and child), while FIFOs allowcommunication between processes sharing a common file system.@item@ref{Sockets}, describes a more complicated interprocess communicationmechanism that allows processes running on different machines tocommunicate over a network.  This chapter also contains information aboutInternet host addressing and how to use the system network databases.@item@ref{Low-Level Terminal Interface}, describes how you can change theattributes of a terminal device.  If you want to disable echo ofcharacters typed by the user, for example, read this chapter.@item @ref{Mathematics}, contains information about the math libraryfunctions.  These include things like random-number generators andremainder functions on integers as well as the usual trigonometric andexponential functions on floating-point numbers.@item@ref{Arithmetic,, Low-Level Arithmetic Functions}, describes functionsfor simple arithmetic, analysis of floating-point values, and readingnumbers from strings.@item @ref{Searching and Sorting}, contains information about functionsfor searching and sorting arrays.  You can use these functions on anykind of array by providing an appropriate comparison function.@item@ref{Pattern Matching}, presents functions for matching regular expressionsand shell file name patterns, and for expanding words as the shell does.@item@ref{Date and Time}, describes functions for measuring both calendar timeand CPU time, as well as functions for setting alarms and timers.@item @ref{Extended Characters}, contains information about manipulatingcharacters and strings using character sets larger than will fit inthe usual @code{char} data type.  @item @ref{Locales}, describes how selecting a particular country or language affects the behavior of the library.  For example, the localeaffects collation sequences for strings and how monetary values areformatted.@item@ref{Non-Local Exits}, contains descriptions of the @code{setjmp} and@code{longjmp} functions.  These functions provide a facility for@code{goto}-like jumps which can jump from one function to another.@item@ref{Signal Handling}, tells you all about signals---what they are,how to establish a handler that is called when a particular kind ofsignal is delivered, and how to prevent signals from arriving duringcritical sections of your program.@item@ref{Process Startup}, tells how your programs can access theircommand-line arguments and environment variables.@item @ref{Processes}, contains information about how to start new processesand run programs.@item@ref{Job Control}, describes functions for manipulating process groups.This material is probably only of interest if you are writing a shell.@item@ref{User Database}, and @ref{Group Database}, tell you how to accessthe system user and group databases.@item@ref{System Information}, describes functions for getting informationabout the hardware and software configuration your program is executingunder.@item @ref{System Configuration}, tells you how you can get information aboutvarious operating system limits.  Most of these parameters are provided forcompatibility with POSIX.@item@ref{Library Summary}, gives a summary of all the functions, variables, andmacros in the library, with complete data types and function prototypes,and says what standard or system each is derived from.@item@ref{Maintenance}, explains how to build and install the GNU C library onyour system, how to report any bugs you might find, and how to add newfunctions or port the library to a new system.@end itemizeIf you already know the name of the facility you are interested in, youcan look it up in @ref{Library Summary}.  This gives you a summary ofits syntax and a pointer to where you can find a more detaileddescription.  This appendix is particularly useful if you just want toverify the order and type of arguments to a function, for example.  Italso tells you what standard or system each function, variable, or macrois derived from.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -