@@ -78,7 +78,7 @@ static int codec_set_pass_key(sqlite3* db, int nDb, const void *zKey, int nKey,
7878 struct Db * pDb = & db -> aDb [nDb ];
7979 sqlcipher_log (SQLCIPHER_LOG_DEBUG , "codec_set_pass_key: db=%p nDb=%d for_ctx=%d" , db , nDb , for_ctx );
8080 if (pDb -> pBt ) {
81- codec_ctx * ctx = (codec_ctx * ) sqlite3PagerGetCodec (pDb -> pBt -> pBt -> pPager );
81+ codec_ctx * ctx = (codec_ctx * ) sqlcipherPagerGetCodec (pDb -> pBt -> pBt -> pPager );
8282
8383 if (ctx ) {
8484 return sqlcipher_codec_ctx_set_pass (ctx , zKey , nKey , for_ctx );
@@ -97,7 +97,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
9797 int rc ;
9898
9999 if (pDb -> pBt ) {
100- ctx = (codec_ctx * ) sqlite3PagerGetCodec (pDb -> pBt -> pBt -> pPager );
100+ ctx = (codec_ctx * ) sqlcipherPagerGetCodec (pDb -> pBt -> pBt -> pPager );
101101 }
102102
103103 if (sqlite3_stricmp (zLeft , "key" ) != 0 && sqlite3_stricmp (zLeft , "rekey" ) != 0 ) {
@@ -822,10 +822,10 @@ static void sqlite3FreeCodecArg(void *pCodecArg) {
822822 sqlcipher_deactivate (); /* cleanup related structures, OpenSSL etc, when codec is detatched */
823823}
824824
825- int sqlite3CodecAttach (sqlite3 * db , int nDb , const void * zKey , int nKey ) {
825+ int sqlcipherCodecAttach (sqlite3 * db , int nDb , const void * zKey , int nKey ) {
826826 struct Db * pDb = & db -> aDb [nDb ];
827827
828- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : db=%p, nDb=%d" , db , nDb );
828+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : db=%p, nDb=%d" , db , nDb );
829829
830830 if (nKey && zKey && pDb -> pBt ) {
831831 int rc ;
@@ -836,12 +836,12 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
836836 /* check if the sqlite3_file is open, and if not force handle to NULL */
837837 if ((fd = sqlite3PagerFile (pPager ))-> pMethods == 0 ) fd = NULL ;
838838
839- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : calling sqlcipher_activate()" );
839+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : calling sqlcipher_activate()" );
840840 sqlcipher_activate (); /* perform internal initialization for sqlcipher */
841841
842- sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlite3CodecAttach : entering database mutex %p" , db -> mutex );
842+ sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlcipherCodecAttach : entering database mutex %p" , db -> mutex );
843843 sqlite3_mutex_enter (db -> mutex );
844- sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlite3CodecAttach : entered database mutex %p" , db -> mutex );
844+ sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlcipherCodecAttach : entered database mutex %p" , db -> mutex );
845845
846846#ifdef SQLCIPHER_EXT
847847 if ((rc = sqlite3_set_authorizer (db , sqlcipher_license_authorizer , db )) != SQLITE_OK ) {
@@ -851,44 +851,44 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
851851#endif
852852
853853 /* point the internal codec argument against the contet to be prepared */
854- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : calling sqlcipher_codec_ctx_init()" );
854+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : calling sqlcipher_codec_ctx_init()" );
855855 rc = sqlcipher_codec_ctx_init (& ctx , pDb , pDb -> pBt -> pBt -> pPager , zKey , nKey );
856856
857857 if (rc != SQLITE_OK ) {
858858 /* initialization failed, do not attach potentially corrupted context */
859- sqlcipher_log (SQLCIPHER_LOG_ERROR , "sqlite3CodecAttach : context initialization failed forcing error state with rc=%d" , rc );
859+ sqlcipher_log (SQLCIPHER_LOG_ERROR , "sqlcipherCodecAttach : context initialization failed forcing error state with rc=%d" , rc );
860860 /* force an error at the pager level, such that even the upstream caller ignores the return code
861861 the pager will be in an error state and will process no further operations */
862862 sqlite3pager_error (pPager , rc );
863863 pDb -> pBt -> pBt -> db -> errCode = rc ;
864- sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlite3CodecAttach : leaving database mutex %p (early return on rc=%d)" , db -> mutex , rc );
864+ sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlcipherCodecAttach : leaving database mutex %p (early return on rc=%d)" , db -> mutex , rc );
865865 sqlite3_mutex_leave (db -> mutex );
866- sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlite3CodecAttach : left database mutex %p (early return on rc=%d)" , db -> mutex , rc );
866+ sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlcipherCodecAttach : left database mutex %p (early return on rc=%d)" , db -> mutex , rc );
867867 return rc ;
868868 }
869869
870- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : calling sqlite3PagerSetCodec ()" );
871- sqlite3PagerSetCodec (sqlite3BtreePager (pDb -> pBt ), sqlite3Codec , NULL , sqlite3FreeCodecArg , (void * ) ctx );
870+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : calling sqlcipherPagerSetCodec ()" );
871+ sqlcipherPagerSetCodec (sqlite3BtreePager (pDb -> pBt ), sqlite3Codec , NULL , sqlite3FreeCodecArg , (void * ) ctx );
872872
873- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : calling codec_set_btree_to_codec_pagesize()" );
873+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : calling codec_set_btree_to_codec_pagesize()" );
874874 codec_set_btree_to_codec_pagesize (db , pDb , ctx );
875875
876876 /* force secure delete. This has the benefit of wiping internal data when deleted
877877 and also ensures that all pages are written to disk (i.e. not skipped by
878878 sqlite3PagerDontWrite optimizations) */
879- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : calling sqlite3BtreeSecureDelete()" );
879+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : calling sqlite3BtreeSecureDelete()" );
880880 sqlite3BtreeSecureDelete (pDb -> pBt , 1 );
881881
882882 /* if fd is null, then this is an in-memory database and
883883 we dont' want to overwrite the AutoVacuum settings
884884 if not null, then set to the default */
885885 if (fd != NULL ) {
886- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecAttach : calling sqlite3BtreeSetAutoVacuum()" );
886+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecAttach : calling sqlite3BtreeSetAutoVacuum()" );
887887 sqlite3BtreeSetAutoVacuum (pDb -> pBt , SQLITE_DEFAULT_AUTOVACUUM );
888888 }
889- sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlite3CodecAttach : leaving database mutex %p" , db -> mutex );
889+ sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlcipherCodecAttach : leaving database mutex %p" , db -> mutex );
890890 sqlite3_mutex_leave (db -> mutex );
891- sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlite3CodecAttach : left database mutex %p" , db -> mutex );
891+ sqlcipher_log (SQLCIPHER_LOG_TRACE , "sqlcipherCodecAttach : left database mutex %p" , db -> mutex );
892892 }
893893 return SQLITE_OK ;
894894}
@@ -921,7 +921,7 @@ int sqlite3_key_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
921921 /* attach key if db and pKey are not null and nKey is > 0 */
922922 if (db && pKey && nKey ) {
923923 int db_index = sqlcipher_find_db_index (db , zDb );
924- return sqlite3CodecAttach (db , db_index , pKey , nKey );
924+ return sqlcipherCodecAttach (db , db_index , pKey , nKey );
925925 }
926926 sqlcipher_log (SQLCIPHER_LOG_ERROR , "sqlite3_key_v2: no key provided" );
927927 return SQLITE_ERROR ;
@@ -955,7 +955,7 @@ int sqlite3_rekey_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
955955 PgHdr * page ;
956956 Pager * pPager = pDb -> pBt -> pBt -> pPager ;
957957
958- ctx = (codec_ctx * ) sqlite3PagerGetCodec (pDb -> pBt -> pBt -> pPager );
958+ ctx = (codec_ctx * ) sqlcipherPagerGetCodec (pDb -> pBt -> pBt -> pPager );
959959
960960 if (ctx == NULL ) {
961961 /* there was no codec attached to this database, so this should do nothing! */
@@ -1013,11 +1013,11 @@ int sqlite3_rekey_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
10131013 return SQLITE_ERROR ;
10141014}
10151015
1016- void sqlite3CodecGetKey (sqlite3 * db , int nDb , void * * zKey , int * nKey ) {
1016+ void sqlcipherCodecGetKey (sqlite3 * db , int nDb , void * * zKey , int * nKey ) {
10171017 struct Db * pDb = & db -> aDb [nDb ];
1018- sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlite3CodecGetKey :db=%p, nDb=%d" , db , nDb );
1018+ sqlcipher_log (SQLCIPHER_LOG_DEBUG , "sqlcipherCodecGetKey :db=%p, nDb=%d" , db , nDb );
10191019 if ( pDb -> pBt ) {
1020- codec_ctx * ctx = (codec_ctx * ) sqlite3PagerGetCodec (pDb -> pBt -> pBt -> pPager );
1020+ codec_ctx * ctx = (codec_ctx * ) sqlcipherPagerGetCodec (pDb -> pBt -> pBt -> pPager );
10211021
10221022 if (ctx ) {
10231023 /* pass back the keyspec from the codec, unless PRAGMA cipher_store_pass
0 commit comments