cocos2d-x开发之sqlite数据库加密研究(sqlite3.c代码浅析1)

本文涉及的产品
密钥管理服务KMS,1000个密钥,100个凭据,1个月
简介:

SQLITE版本3.7.15.1中的sqlite3.c长达13万多行,要细致分析这个文件可不容易。但是,这个文件是由许多个.H和.C文件组合而成,正如此文件开始的注释中所述:
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
** version 3.7.15.1.  By combining all the individual C code files into this 
** single large file, the entire code can be compiled as a single translation
** unit.  This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately.  Performance improvements
** of 5% or more are commonly seen when SQLite is compiled as a single
** translation unit.

**
** This file is all you need to compile SQLite.  To use SQLite in other
** programs, you need this file and the "sqlite3.h" header file that defines
** the programming interface to the SQLite library.  (If you do not have 
** the "sqlite3.h" header file at hand, you will find a copy embedded within
** the text of this file.  Search for "Begin file sqlite3.h" to find the start
** of the embedded sqlite3.h header file.) Additional code files may be needed
** if you want a wrapper to interface SQLite with your choice of programming
** language. The code for the "sqlite3" command-line shell is also in a
** separate file. This file contains only code for the core SQLite library.
*/

另外,从上述注释中,我们也可以清楚sqlite3.h和另一个一起发布的头文件sqlite3ext.h(此文件一般不必使用)如何使用了。
下面给出我对这个长文件结构的简要分析记录一,供有共同研究的爱好者参考。

其中,已经使用了相应的表示包含意义的缩进,相信我不必详细说明了吧。

Begin file sqliteInt.h (end at about line 12436)
    Begin file sqliteLimit.h
    Begin file sqlite3.h (at about 7161 lines)
    Begin file hash.h (at about line 7755)
    Begin file parse.h (at about  line 7856)
    Begin file btree.h
    Begin file vdbe.h --Header file for the Virtual DataBase Engine, at about line 8644
    Begin file opcodes.h
    Begin file pager.h--The page cache subsystem reads and writes a file a page
          at a time and 

provides a journal for rollback.
    Begin file pcache.h--defines the interface that the sqlite page cache
 subsystem
    Begin file os.h
    Begin file mutex.h

Begin file global.c (at about line 12437)--contains definitions of global variables and contants
Begin file ctime.c (at about line 12668)
Begin file status.c (at about line 13075)
    Begin file vdbeInt.h
Begin file date.c (at about line 13816)
Begin file os.c (at about line 14946)
Begin file fault.c(at about line 15304)
Begin file mem0.c
Begin file mem1.c
Begin file mem2.c
Begin file mem3.c
Begin file mem5.c (a bit strange without mem4.c???!!)
Begin file mutex.c--contains the C functions that implement mutexes
Begin file mutex_noop.c
Begin file mutex_unix.c
Begin file mutex_w32.c
Begin file malloc.c
Begin file printf.c
Begin file random.c
Begin file utf.c
Begin file util.c(at about line 21061)
Begin file hash.c
Begin file opcodes.c
Begin file os_unix.c
    Begin file os_common.h
        Begin file hwtime.h
Begin file os_win.c
    Begin file os_common.h
        Begin file hwtime.h
Begin file bitvec.c
Begin file pcache.c
Begin file pcache1.c
Begin file rowset.c
Begin file pager.c(at about line 37203)
    Begin file wal.h--defines the interface to the write-ahead logging system
Begin file wal.c
Begin file btmutex.c
    Begin file btreeInt.h
Begin file btree.c
Begin file backup.c
Begin file vdbemem.c
Begin file vdbeaux.c
Begin file vdbeapi.c
Begin file vdbetrace.c
Begin file vdbe.c
    Begin file hwtime.h
Begin file vdbeblob.c
Begin file vdbesort.c
Begin file journal.c
Begin file memjournal.c
Begin file walker.c--routines used for walking the parser tree for an SQL statement
Begin file resolve.c
Begin file expr.c
Begin file alter.c
Begin file analyze.c
Begin file attach.c
Begin file auth.c--code used to implement the sqlite3_set_authorizer() API
Begin file build.c--contains C code routines that are called by the SQLite parser
                     when syntax rules are   reduced
Begin file callback.c
Begin file delete.c
Begin file func.c
Begin file fkey.c
Begin file insert.c
Begin file legacy.c
Begin file loadext.c--code used to dynamically load extensions into
                                 the SQLite library
    Begin file sqlite3ext.h(at about line 90707)
Begin file pragma.c--contains code used to implement the PRAGMA command
Begin file prepare.c
Begin file select.c
Begin file table.c
Begin file trigger.c
Begin file update.c
Begin file vacuum.c
Begin file vtab.c
Begin file where.c
Begin file parse.c
Begin file tokenize.c
    Begin file keywordhash.h******************
Begin file complete.c
Begin file main.c--- Main file for the SQLite library
    Begin file fts3.h
    Begin file rtree.h
    Begin file sqliteicu.h
Begin file notify.c
Begin file fts3.c
    Begin file fts3Int.h
        Begin file fts3_tokenizer.h
        Begin file fts3_hash.h
Begin file fts3_aux.c
Begin file fts3_expr.c
Begin file fts3_hash.c
Begin file fts3_porter.c
Begin file fts3_tokenizer.c
Begin file fts3_tokenizer1.c
Begin file fts3_write.c
Begin file fts3_snippet.c
Begin file fts3_unicode.c
Begin file fts3_unicode2.c
Begin file rtree.c
Begin file icu.c
Begin file fts3_icu.c

/******about line 137441 ******** End of fts3_icu.c and whole file*/


















本文转自朱先忠老师51CTO博客,原文链接:http://blog.51cto.com/zhuxianzhong/1531763 ,如需转载请自行联系原作者



相关文章
|
1月前
|
存储 缓存 Java
java语言后台管理ruoyi后台管理框架-登录提示“无效的会话,或者会话已过期,请重新登录。”-扩展知识数据库中密码加密的方法-问题如何解决-以及如何重置若依后台管理框架admin密码-优雅草卓伊凡
java语言后台管理ruoyi后台管理框架-登录提示“无效的会话,或者会话已过期,请重新登录。”-扩展知识数据库中密码加密的方法-问题如何解决-以及如何重置若依后台管理框架admin密码-优雅草卓伊凡
121 3
java语言后台管理ruoyi后台管理框架-登录提示“无效的会话,或者会话已过期,请重新登录。”-扩展知识数据库中密码加密的方法-问题如何解决-以及如何重置若依后台管理框架admin密码-优雅草卓伊凡
|
2月前
|
前端开发 Java 数据库连接
Java后端开发-使用springboot进行Mybatis连接数据库步骤
本文介绍了使用Java和IDEA进行数据库操作的详细步骤,涵盖从数据库准备到测试类编写及运行的全过程。主要内容包括: 1. **数据库准备**:创建数据库和表。 2. **查询数据库**:验证数据库是否可用。 3. **IDEA代码配置**:构建实体类并配置数据库连接。 4. **测试类编写**:编写并运行测试类以确保一切正常。
93 2
|
3月前
|
存储 前端开发 关系型数据库
鸿蒙开发:实现键值数据库存储
对于数据量比较的小的,我们直接选择轻量级的用户首选项方式即可,而对于数据量比较大的情况下,直接可以使用数据库,而对于相对来说,比较大的数据,我们就可以使用键值型数据库方式
129 2
|
3月前
|
SQL 关系型数据库 API
HarmonyOs开发:关系型数据库封装之增删改查
每个方法都预留了多种调用方式,比如使用callback异步回调或者使用Promise异步回调,亦或者同步执行,大家在使用的过程中,可以根据自身业务需要进行选择性调用,也分别暴露了成功和失败的方法,可以针对性的判断在执行的过程中是否执行成功。
138 13
|
3月前
|
存储 JSON 测试技术
【HarmonyOS Next开发】云开发-云数据库(二)
实现了云侧和端侧的云数据库创建、更新、修改等操作。这篇文章实现调用云函数对云数据库进行增删改查。
79 9
【HarmonyOS Next开发】云开发-云数据库(二)
|
4月前
|
Linux 数据库 数据安全/隐私保护
GBase 数据库 加密客户端---数据库用户口令非明文存放需求的实现
GBase 数据库 加密客户端---数据库用户口令非明文存放需求的实现
|
4月前
|
存储 缓存 NoSQL
2款使用.NET开发的数据库系统
2款使用.NET开发的数据库系统
|
4月前
|
存储 SQL API
探索后端开发:构建高效API与数据库交互
【10月更文挑战第36天】在数字化时代,后端开发是连接用户界面和数据存储的桥梁。本文深入探讨如何设计高效的API以及如何实现API与数据库之间的无缝交互,确保数据的一致性和高性能。我们将从基础概念出发,逐步深入到实战技巧,为读者提供一个清晰的后端开发路线图。
|
9月前
|
存储 缓存 数据库
Android之SQLite数据库使用详解
Android之SQLite数据库使用详解
|
9月前
|
数据库 Android开发 数据安全/隐私保护
在 Android Studio 中结合使用 SQLite 数据库实现简单的注册和登录功能
在 Android Studio 中结合使用 SQLite 数据库实现简单的注册和登录功能
318 2