当前位置: 技术问答>linux和unix
内核中带下划线的函数和不带下划线的函数都表示什么含义
来源: 互联网 发布时间:2016-04-16
本文导语: 如题!谢谢! | 参考Indent style,这里讲, K&R style The K&R style, so-called because it was used in Kernighan and Ritchie's book The C Programming Language, is commonly used in C. ... Advocates of this style so...
如题!谢谢!
|
参考Indent style,这里讲,
K&R style
The K&R style, so-called because it was used in Kernighan and Ritchie's book The C Programming Language, is commonly used in C. ...
Advocates of this style sometimes refer to it as "The One True Brace Style" (abbreviated as 1TBS or OTBS) because of the precedent set by C (although advocates of other styles have been known to use similarly strong language). The source code of the Unix kernel and Linux kernel are written in this style.
找到那本书:里面关于“_”的部分:
1)The underscore ``_'' counts as a letter; it is sometimes useful for improving the readability of long variable names. Don't begin variable names with underscore, however, since library routines often use such names.
2)In the following excerpt from a typical , names that are intended for use only by functions of the library begin with an underscore so they are less likely to collide with names in a user's program. This convention is used by all standard library routines.
3)External identifiers that begin with an underscore are reserved for use by the library, as are all other identifiers that begin with an underscore and an upper-case letter or another underscore.
从上面看来,可以理解为,带下划线开头的,仅仅用作一个模块或者内核内部使用吧
不知道有没有其他解释?
K&R style
The K&R style, so-called because it was used in Kernighan and Ritchie's book The C Programming Language, is commonly used in C. ...
Advocates of this style sometimes refer to it as "The One True Brace Style" (abbreviated as 1TBS or OTBS) because of the precedent set by C (although advocates of other styles have been known to use similarly strong language). The source code of the Unix kernel and Linux kernel are written in this style.
找到那本书:里面关于“_”的部分:
1)The underscore ``_'' counts as a letter; it is sometimes useful for improving the readability of long variable names. Don't begin variable names with underscore, however, since library routines often use such names.
2)In the following excerpt from a typical , names that are intended for use only by functions of the library begin with an underscore so they are less likely to collide with names in a user's program. This convention is used by all standard library routines.
3)External identifiers that begin with an underscore are reserved for use by the library, as are all other identifiers that begin with an underscore and an upper-case letter or another underscore.
从上面看来,可以理解为,带下划线开头的,仅仅用作一个模块或者内核内部使用吧
不知道有没有其他解释?
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。