Sqlite3 extension

Riguz留言 | 贡献2025年7月24日 (四) 11:13的版本 (创建页面,内容为“ <syntaxhighlight lang="cpp"> →‎** This routine does the work of opening a database on behalf of ** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" ** is UTF-8 encoded.:​ static int openDatabase( const char *zFilename, →‎Database filename UTF-8 encoded:​ sqlite3 **ppDb, →‎OUT: Returned database handle:​ unsigned int flags, →‎Operational flags:​ const char *zVfs →‎Name of the VFS to use:​ ){ // ... /*…”
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
/*
** This routine does the work of opening a database on behalf of
** sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
** is UTF-8 encoded.
*/
static int openDatabase(
  const char *zFilename, /* Database filename UTF-8 encoded */
  sqlite3 **ppDb,        /* OUT: Returned database handle */
  unsigned int flags,    /* Operational flags */
  const char *zVfs       /* Name of the VFS to use */
){
  // ...
  /* Load compiled-in extensions */
  for(i=0; rc==SQLITE_OK && i<ArraySize(sqlite3BuiltinExtensions); i++){
    rc = sqlite3BuiltinExtensions[i](db);
  }

  /* Load automatic extensions - extensions that have been registered
  ** using the sqlite3_automatic_extension() API.
  */
  if( rc==SQLITE_OK ){
    sqlite3AutoLoadExtensions(db);
    rc = sqlite3_errcode(db);
    if( rc!=SQLITE_OK ){
      goto opendb_out;
    }
  }
  // ...
}