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

news/2024/11/9 21:08:56

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*/


http://www.niftyadmin.cn/n/3855212.html

相关文章

Openstack(两控制节点+四计算节点)-4 模拟控制节点宕机

为什么80%的码农都做不了架构师?>>> 双控制节点通过heartbeatpacemaker监控相关服务,所以须在两台控制节点上先安装heartbeat软件,安装过程可参照: http://my.oschina.net/guol/blog/90128 pacemaker主要是对控制节点…

行业网站优化一般步骤

关于行业网站优化我写的只是 SEO 的操作细则并非运营思路,运营思路将在后期引入, 这个行业网站优化细则我花几天的时间进行梳理结构和整理, 希望大家提意见, 同时谢谢长 期支持本站的 SEOer。 行业站的优势在于其海量的信息&#…

java Socket多线程服务器源代码介绍

java Socket多线程服务器源代码介绍java Socket多线程在我们进行相关学习的时候需要注意不断出现的问题,下面我们就来看看在java Socket多线程中服务器的代码编写。java Socket多线程需要我们不断的学习,在学习的时候我们就会发现在服务器的配置上有不少…

Java Socket 编程——多线程网络聊天程序

Java Socket 编程——多线程网络聊天程序 首先,进行服务端的编程,作为服务端,编程主要按下面几个步骤进行:// 1. 创建socketServerSocket ss new ServerSocket(PortNumber);Socket s ss.accept(); //监听器,产生阻塞…

SQL Server 跨服务器 不同数据库之间复制表的数据的方法:

不同数据库之间复制表的数据的方法: 当表目标表存在时: insert into 目的数据库..表 select * from 源数据库..表 当目标表不存在时: select * into 目的数据库..表 from 源数据库..表 --如果在不同的SQL之间: insert into openrowset(sql…

Java多线程-----Socket通信

Java多线程-----Socket通信程序分Server和Client服务器端打开侦听的端口,一有客户端连接就创建两个新的线程来负责这个连接一个负责客户端发送的信息(ClientMsgCollectThread 类),另一个负责通过该Socket发送数据(ServerMsgSendThread &#…

算法学习-哈希表

之前在大学学习数据结构的时候,学过数组和链表。数组的优点就是可以直接定位,速度快,但是缺点就是插入删除,效率就慢了很多。链表的可以快速的插入删除,但是不能直接定位,需要遍历才可以。他们使用在不同的…

改变VM内存大小

-Xms512m -Xmx1024m -XX:PermSize128M -XX:MaxPermSize256M 转载于:https://blog.51cto.com/yaomingkai/1125760