设为首页 收藏本站
查看: 1243|回复: 0

[经验分享] SQLite源码剖析(6)

[复制链接]

尚未签到

发表于 2016-11-29 06:05:29 | 显示全部楼层 |阅读模式
  /*
  ** Add the ability to override 'extern'
  */
  //定义extern的宏,可使用SQLITE_EXTERN来完成extern功能
  #ifndef SQLITE_EXTERN
  # define SQLITE_EXTERN extern
  #endif
  //定义SQLITE_API宏
  #ifndef SQLITE_API
  # define SQLITE_API
  #endif
   
   
  /* no-op宏经常在接口前标记那些实验性的和不推荐的接口。新应用程序最好
  **不使用不推荐的接口,它们支持向后兼容。程序员必须意识到实验性接口
  **会在某个版本中改变
  ** These no-op macros are used in front of interfaces to mark those
  ** interfaces as either deprecated or experimental.  New applications
  ** should not use deprecated interfaces - they are support for backwards
  ** compatibility only.  Application writers should be aware that
  ** experimental interfaces are subject to change in point releases.
  **这些宏在他们需要时,能实现编译器魔法compiler magic警告信息,
  **编译器魔法最终产生BUG报告,编译器会试着使用noop宏。
  ** These macros used to resolve to various kinds of compiler magic that
  ** would generate warning messages when they were used.  But that
  ** compiler magic ended up generating such a flurry of bug reports
  ** that we have taken it all out and gone back to using simple
  ** noop macros.
  */
  #define SQLITE_DEPRECATED
  #define SQLITE_EXPERIMENTAL
   
  /*
  ** Ensure these symbols were not defined by some previous header file.
  */
  //如果SQLITE_VERSION、SQLITE_VERSION_NUMBER标志已经定义,则取消
  #ifdef SQLITE_VERSION
  # undef SQLITE_VERSION
  #endif
  #ifdef SQLITE_VERSION_NUMBER
  # undef SQLITE_VERSION_NUMBER
  #endif
   
  /*
  ** CAPI3REF: Compile-Time Library Version Numbers
  ** SQLITE_VERSION 宏为版本号,[X.Y.Z的SQLITE版本号中,X是主版本号,Y
  **是次版本号,Z是发行号
  ** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
  ** evaluates to a string literal that is the SQLite version in the
  ** format "X.Y.Z" where X is the major version number (always 3 for
  ** SQLite3) and Y is the minor version number and Z is the release number.)^
  ** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves
  ** to an integer with the value (X*1000000 + Y*1000 + Z) where X, Y,
  **and Z are the same numbers used in [SQLITE_VERSION].)^
  ** SQLITE_VERSION_NUMBER根据SQLITE_VERSION中版本号计算一个
  **整数(X*1000000 + Y*1000 + Z)
  ** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
  ** be larger than the release from which it is derived.  Either Y will
  ** be held constant and Z will be incremented or else Y will be incremented
  ** and Z will be reset to zero.
  **
  ** Since version 3.6.18, SQLite source code has been stored in the
  ** <a href="http://www.fossil-scm.org/">Fossil configuration management
  ** system</a>.  ^The SQLITE_SOURCE_ID macro evalutes to
  ** a string which identifies a particular check-in of SQLite
  ** within its configuration management system.  ^The SQLITE_SOURCE_ID
  ** string contains the date and time of the check-in (UTC) and an SHA1
  ** hash of the entire source tree.
  ** SQLITE_SOURCE_ID 为一个字符串,为SQLITE配置管理系统中的check-in
  **详情包含check-in的日期和时间以及整个源码树的SHA1哈希
  ** See also: [sqlite3_libversion()],
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
  ** [sqlite_version()] and [sqlite_source_id()].
  */
  //定义版本号,并计算SQLITE_VERSION_NUMBER
  #define SQLITE_VERSION        "3.6.23.1"
  #define SQLITE_VERSION_NUMBER 3006023
  #define SQLITE_SOURCE_ID      "2010-03-26 22:28:06 b078b588d617e07886ad156e9f54ade6d823568e"
   
  /*
  ** CAPI3REF: Run-Time Library Version Numbers
  ** KEYWORDS: sqlite3_version, sqlite3_sourceid
  ** 这些接口通过库而不是头文件提供了
  *SQLITE_VERSION、SQLITE_VERSION_NUMBER以**及SQLITE_SOURCE_ID宏
  **的相同信息
  ** These interfaces provide the same information as the [SQLITE_VERSION],
  ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
  ** but are associated with the library instead of the header file.  ^(Cautious
  ** programmers might include assert() statements in their application to
  ** verify that values returned by these interfaces match the macros in
  ** the header, and thus insure that the application is
  ** compiled with matching library and header files.
  **可小心地通过包含以下的assert()声明,在应用程序核实匹配头文件中宏的
  **这些接口,以确保应用程序使用相匹配的库和头文件编译
  ** <blockquote><pre>
  ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
  ** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
  ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
  ** </pre></blockquote>)^
  
  
  
  
  声明:本SQLite源码剖析系列为刘兴(http://deepfuture.iyunv.com/)原创,未经笔者授权,任何人和机构不能转载

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-306774-1-1.html 上篇帖子: Android开发 下篇帖子: sqlite 入门备忘
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表