亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? callback.c

?? 新版輕量級嵌入式數據庫
?? C
字號:
/*** 2005 May 23 **** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.******************************************************************************* This file contains functions used to access the internal hash tables** of user defined functions and collation sequences.**** $Id: callback.c,v 1.14 2006/03/14 11:08:28 drh Exp $*/#include "sqliteInt.h"/*** Invoke the 'collation needed' callback to request a collation sequence** in the database text encoding of name zName, length nName.** If the collation sequence*/static void callCollNeeded(sqlite3 *db, const char *zName, int nName){  assert( !db->xCollNeeded || !db->xCollNeeded16 );  if( nName<0 ) nName = strlen(zName);  if( db->xCollNeeded ){    char *zExternal = sqliteStrNDup(zName, nName);    if( !zExternal ) return;    db->xCollNeeded(db->pCollNeededArg, db, (int)ENC(db), zExternal);    sqliteFree(zExternal);  }#ifndef SQLITE_OMIT_UTF16  if( db->xCollNeeded16 ){    char const *zExternal;    sqlite3_value *pTmp = sqlite3ValueNew();    sqlite3ValueSetStr(pTmp, nName, zName, SQLITE_UTF8, SQLITE_STATIC);    zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);    if( zExternal ){      db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);    }    sqlite3ValueFree(pTmp);  }#endif}/*** This routine is called if the collation factory fails to deliver a** collation function in the best encoding but there may be other versions** of this collation function (for other text encodings) available. Use one** of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if** possible.*/static int synthCollSeq(sqlite3 *db, CollSeq *pColl){  CollSeq *pColl2;  char *z = pColl->zName;  int n = strlen(z);  int i;  static const u8 aEnc[] = { SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8 };  for(i=0; i<3; i++){    pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, n, 0);    if( pColl2->xCmp!=0 ){      memcpy(pColl, pColl2, sizeof(CollSeq));      return SQLITE_OK;    }  }  return SQLITE_ERROR;}/*** This function is responsible for invoking the collation factory callback** or substituting a collation sequence of a different encoding when the** requested collation sequence is not available in the database native** encoding.** ** If it is not NULL, then pColl must point to the database native encoding ** collation sequence with name zName, length nName.**** The return value is either the collation sequence to be used in database** db for collation type name zName, length nName, or NULL, if no collation** sequence can be found.*/CollSeq *sqlite3GetCollSeq(  sqlite3* db,   CollSeq *pColl,   const char *zName,   int nName){  CollSeq *p;  p = pColl;  if( !p ){    p = sqlite3FindCollSeq(db, ENC(db), zName, nName, 0);  }  if( !p || !p->xCmp ){    /* No collation sequence of this type for this encoding is registered.    ** Call the collation factory to see if it can supply us with one.    */    callCollNeeded(db, zName, nName);    p = sqlite3FindCollSeq(db, ENC(db), zName, nName, 0);  }  if( p && !p->xCmp && synthCollSeq(db, p) ){    p = 0;  }  assert( !p || p->xCmp );  return p;}/*** This routine is called on a collation sequence before it is used to** check that it is defined. An undefined collation sequence exists when** a database is loaded that contains references to collation sequences** that have not been defined by sqlite3_create_collation() etc.**** If required, this routine calls the 'collation needed' callback to** request a definition of the collating sequence. If this doesn't work, ** an equivalent collating sequence that uses a text encoding different** from the main database is substituted, if one is available.*/int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){  if( pColl ){    const char *zName = pColl->zName;    CollSeq *p = sqlite3GetCollSeq(pParse->db, pColl, zName, -1);    if( !p ){      if( pParse->nErr==0 ){        sqlite3ErrorMsg(pParse, "no such collation sequence: %s", zName);      }      pParse->nErr++;      return SQLITE_ERROR;    }    assert( p==pColl );  }  return SQLITE_OK;}/*** Locate and return an entry from the db.aCollSeq hash table. If the entry** specified by zName and nName is not found and parameter 'create' is** true, then create a new entry. Otherwise return NULL.**** Each pointer stored in the sqlite3.aCollSeq hash table contains an** array of three CollSeq structures. The first is the collation sequence** prefferred for UTF-8, the second UTF-16le, and the third UTF-16be.**** Stored immediately after the three collation sequences is a copy of** the collation sequence name. A pointer to this string is stored in** each collation sequence structure.*/static CollSeq *findCollSeqEntry(  sqlite3 *db,  const char *zName,  int nName,  int create){  CollSeq *pColl;  if( nName<0 ) nName = strlen(zName);  pColl = sqlite3HashFind(&db->aCollSeq, zName, nName);  if( 0==pColl && create ){    pColl = sqliteMalloc( 3*sizeof(*pColl) + nName + 1 );    if( pColl ){      CollSeq *pDel = 0;      pColl[0].zName = (char*)&pColl[3];      pColl[0].enc = SQLITE_UTF8;      pColl[1].zName = (char*)&pColl[3];      pColl[1].enc = SQLITE_UTF16LE;      pColl[2].zName = (char*)&pColl[3];      pColl[2].enc = SQLITE_UTF16BE;      memcpy(pColl[0].zName, zName, nName);      pColl[0].zName[nName] = 0;      pDel = sqlite3HashInsert(&db->aCollSeq, pColl[0].zName, nName, pColl);      /* If a malloc() failure occured in sqlite3HashInsert(), it will       ** return the pColl pointer to be deleted (because it wasn't added      ** to the hash table).      */      assert( !pDel || (sqlite3MallocFailed() && pDel==pColl) );      if( pDel ){        sqliteFree(pDel);        pColl = 0;      }    }  }  return pColl;}/*** Parameter zName points to a UTF-8 encoded string nName bytes long.** Return the CollSeq* pointer for the collation sequence named zName** for the encoding 'enc' from the database 'db'.**** If the entry specified is not found and 'create' is true, then create a** new entry.  Otherwise return NULL.*/CollSeq *sqlite3FindCollSeq(  sqlite3 *db,  u8 enc,  const char *zName,  int nName,  int create){  CollSeq *pColl;  if( zName ){    pColl = findCollSeqEntry(db, zName, nName, create);  }else{    pColl = db->pDfltColl;  }  assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 );  assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );  if( pColl ) pColl += enc-1;  return pColl;}/*** Locate a user function given a name, a number of arguments and a flag** indicating whether the function prefers UTF-16 over UTF-8.  Return a** pointer to the FuncDef structure that defines that function, or return** NULL if the function does not exist.**** If the createFlag argument is true, then a new (blank) FuncDef** structure is created and liked into the "db" structure if a** no matching function previously existed.  When createFlag is true** and the nArg parameter is -1, then only a function that accepts** any number of arguments will be returned.**** If createFlag is false and nArg is -1, then the first valid** function found is returned.  A function is valid if either xFunc** or xStep is non-zero.**** If createFlag is false, then a function with the required name and** number of arguments may be returned even if the eTextRep flag does not** match that requested.*/FuncDef *sqlite3FindFunction(  sqlite3 *db,       /* An open database */  const char *zName, /* Name of the function.  Not null-terminated */  int nName,         /* Number of characters in the name */  int nArg,          /* Number of arguments.  -1 means any number */  u8 enc,            /* Preferred text encoding */  int createFlag     /* Create new entry if true and does not otherwise exist */){  FuncDef *p;         /* Iterator variable */  FuncDef *pFirst;    /* First function with this name */  FuncDef *pBest = 0; /* Best match found so far */  int bestmatch = 0;    assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );  if( nArg<-1 ) nArg = -1;  pFirst = (FuncDef*)sqlite3HashFind(&db->aFunc, zName, nName);  for(p=pFirst; p; p=p->pNext){    /* During the search for the best function definition, bestmatch is set    ** as follows to indicate the quality of the match with the definition    ** pointed to by pBest:    **    ** 0: pBest is NULL. No match has been found.    ** 1: A variable arguments function that prefers UTF-8 when a UTF-16    **    encoding is requested, or vice versa.    ** 2: A variable arguments function that uses UTF-16BE when UTF-16LE is    **    requested, or vice versa.    ** 3: A variable arguments function using the same text encoding.    ** 4: A function with the exact number of arguments requested that    **    prefers UTF-8 when a UTF-16 encoding is requested, or vice versa.    ** 5: A function with the exact number of arguments requested that    **    prefers UTF-16LE when UTF-16BE is requested, or vice versa.    ** 6: An exact match.    **    ** A larger value of 'matchqual' indicates a more desirable match.    */    if( p->nArg==-1 || p->nArg==nArg || nArg==-1 ){      int match = 1;          /* Quality of this match */      if( p->nArg==nArg || nArg==-1 ){        match = 4;      }      if( enc==p->iPrefEnc ){        match += 2;      }      else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) ||               (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){        match += 1;      }      if( match>bestmatch ){        pBest = p;        bestmatch = match;      }    }  }  /* If the createFlag parameter is true, and the seach did not reveal an  ** exact match for the name, number of arguments and encoding, then add a  ** new entry to the hash table and return it.  */  if( createFlag && bestmatch<6 &&       (pBest = sqliteMalloc(sizeof(*pBest)+nName))!=0 ){    pBest->nArg = nArg;    pBest->pNext = pFirst;    pBest->iPrefEnc = enc;    memcpy(pBest->zName, zName, nName);    pBest->zName[nName] = 0;    if( pBest==sqlite3HashInsert(&db->aFunc,pBest->zName,nName,(void*)pBest) ){      sqliteFree(pBest);      return 0;    }  }  if( pBest && (pBest->xStep || pBest->xFunc || createFlag) ){    return pBest;  }  return 0;}/*** Free all resources held by the schema structure. The void* argument points** at a Schema struct. This function does not call sqliteFree() on the ** pointer itself, it just cleans up subsiduary resources (i.e. the contents** of the schema hash tables).*/void sqlite3SchemaFree(void *p){  Hash temp1;  Hash temp2;  HashElem *pElem;  Schema *pSchema = (Schema *)p;  temp1 = pSchema->tblHash;  temp2 = pSchema->trigHash;  sqlite3HashInit(&pSchema->trigHash, SQLITE_HASH_STRING, 0);  sqlite3HashClear(&pSchema->aFKey);  sqlite3HashClear(&pSchema->idxHash);  for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){    sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem));  }  sqlite3HashClear(&temp2);  sqlite3HashInit(&pSchema->tblHash, SQLITE_HASH_STRING, 0);  for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){    Table *pTab = sqliteHashData(pElem);    sqlite3DeleteTable(0, pTab);  }  sqlite3HashClear(&temp1);  pSchema->pSeqTab = 0;  pSchema->flags &= ~DB_SchemaLoaded;}/*** Find and return the schema associated with a BTree.  Create** a new one if necessary.*/Schema *sqlite3SchemaGet(Btree *pBt){  Schema * p;  if( pBt ){    p = (Schema *)sqlite3BtreeSchema(pBt,sizeof(Schema),sqlite3SchemaFree);  }else{    p = (Schema *)sqliteMalloc(sizeof(Schema));  }  if( p && 0==p->file_format ){    sqlite3HashInit(&p->tblHash, SQLITE_HASH_STRING, 0);    sqlite3HashInit(&p->idxHash, SQLITE_HASH_STRING, 0);    sqlite3HashInit(&p->trigHash, SQLITE_HASH_STRING, 0);    sqlite3HashInit(&p->aFKey, SQLITE_HASH_STRING, 1);  }  return p;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区在线观看免费| 久久精品国内一区二区三区| 亚洲高清免费一级二级三级| 久久国产精品第一页| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 中文字幕av一区二区三区免费看| 亚洲主播在线播放| 国产成人欧美日韩在线电影| 欧美人与禽zozo性伦| 亚洲欧美日韩国产综合| 国产精品一区二区三区乱码| 欧美高清www午色夜在线视频| 国产精品色一区二区三区| 久久99精品国产.久久久久久| 欧洲精品在线观看| 国产精品家庭影院| 国产精品一区二区在线观看网站| 欧美美女bb生活片| 亚洲综合激情小说| 99精品国产热久久91蜜凸| 国产亚洲人成网站| 美女www一区二区| 日韩一二三四区| 日韩成人精品在线| 91精品国产一区二区三区香蕉| 亚洲天天做日日做天天谢日日欢| 国产.精品.日韩.另类.中文.在线.播放| 制服丝袜中文字幕一区| 亚洲午夜精品一区二区三区他趣| 成人av在线资源| 国产日韩欧美精品在线| 国产伦理精品不卡| 国产亚洲精品aa| 国产精品1024| 国产色产综合产在线视频| 国产在线精品免费| 久久九九国产精品| 成人sese在线| 亚洲少妇中出一区| 91福利区一区二区三区| 亚洲精品国产一区二区精华液 | 国产午夜一区二区三区| 久久狠狠亚洲综合| 精品乱人伦小说| 国产乱淫av一区二区三区 | 欧美精品视频www在线观看| 性感美女久久精品| 日韩一区二区在线观看| 精品亚洲国产成人av制服丝袜| 欧美大胆人体bbbb| 国产成人免费视频网站| 亚洲欧美在线另类| 欧美视频一区二区三区| 蜜臀久久久99精品久久久久久| 精品国产一区二区亚洲人成毛片 | 一本大道av伊人久久综合| 一区二区三区四区乱视频| 欧美日韩日日骚| 久久www免费人成看片高清| 欧美大肚乱孕交hd孕妇| 黄色成人免费在线| 日韩理论片中文av| 日韩视频一区二区三区| 国产成+人+日韩+欧美+亚洲| 亚洲精品网站在线观看| 91精品国产一区二区三区| 国产精品一级黄| 亚洲一级片在线观看| 日韩欧美激情一区| av亚洲精华国产精华精华| 天天综合色天天| 欧美国产1区2区| 91精品黄色片免费大全| 不卡一二三区首页| 日韩国产在线观看一区| 国产精品每日更新| 欧美大胆人体bbbb| 色婷婷精品久久二区二区蜜臀av| 美女mm1313爽爽久久久蜜臀| 亚洲精品欧美激情| 国产日韩欧美a| 69成人精品免费视频| 99久久久精品免费观看国产蜜| 美女爽到高潮91| 亚洲福利电影网| 亚洲欧洲成人精品av97| 精品成a人在线观看| 欧美视频在线一区二区三区| 不卡的电影网站| 精品在线播放免费| 日本三级韩国三级欧美三级| 亚洲毛片av在线| 中文字幕 久热精品 视频在线 | 精品视频免费在线| 成人av电影在线播放| 精品一区二区三区香蕉蜜桃| 午夜影视日本亚洲欧洲精品| 亚洲国产电影在线观看| 久久色.com| 精品免费日韩av| 日韩一区二区电影在线| 欧美日韩一级片在线观看| 91在线观看免费视频| 粉嫩绯色av一区二区在线观看| 久久国产精品无码网站| 麻豆精品一区二区| 青娱乐精品视频| 日日欢夜夜爽一区| 午夜精品一区在线观看| 亚洲一区二区三区国产| 亚洲激情图片一区| 亚洲夂夂婷婷色拍ww47| 亚洲男人电影天堂| 亚洲女爱视频在线| 亚洲日本在线观看| 亚洲精品久久嫩草网站秘色| 亚洲精品乱码久久久久久| 亚洲自拍都市欧美小说| 一区二区三区在线免费视频| 亚洲欧美另类久久久精品2019| 日韩理论片网站| 亚洲国产aⅴ天堂久久| 亚洲6080在线| 全国精品久久少妇| 国产一区二区三区综合| 国产毛片一区二区| 成人网在线播放| 日本精品一级二级| 91精品国产一区二区三区| 欧美精品一区二区三区视频| 久久蜜桃av一区精品变态类天堂| 久久久久国产精品麻豆| 国产精品福利一区| 亚洲精品一二三| 日韩1区2区日韩1区2区| 国产曰批免费观看久久久| 国产成人精品一区二区三区四区 | 91精品国产欧美一区二区成人| 欧美一区二区高清| 国产三级欧美三级| 一级中文字幕一区二区| 日韩成人一区二区| 国产在线精品一区二区三区不卡| 高清不卡在线观看av| 欧美在线999| 精品久久久久久综合日本欧美 | 99久久久精品| 91精品国产综合久久福利软件| 久久网站热最新地址| 中文字幕日韩一区二区| 亚洲mv大片欧洲mv大片精品| 老司机免费视频一区二区| 懂色av一区二区三区免费观看 | 99国产精品久久久| 51精品秘密在线观看| 日本一区二区三区视频视频| 亚洲国产精品久久人人爱| 精品一区二区在线看| 91影院在线免费观看| 欧美一级夜夜爽| 亚洲视频小说图片| 久久成人免费网站| 欧美主播一区二区三区| 国产亚洲精品久| 蜜臀av一区二区| 91成人免费网站| 日本一区二区高清| 捆绑紧缚一区二区三区视频| fc2成人免费人成在线观看播放 | 欧美性猛片xxxx免费看久爱| 久久久亚洲精品石原莉奈| 亚洲一二三四久久| a亚洲天堂av| 久久人人爽爽爽人久久久| 亚洲超丰满肉感bbw| 色先锋久久av资源部| 国产日韩欧美激情| 寂寞少妇一区二区三区| 欧美三级资源在线| 亚洲美女视频一区| 成熟亚洲日本毛茸茸凸凹| 欧美变态口味重另类| 亚洲成av人在线观看| 91精彩视频在线| 亚洲色欲色欲www在线观看| 高清成人免费视频| 国产日韩成人精品| 国产高清精品在线| 久久伊人蜜桃av一区二区| 日韩二区在线观看| 欧美日韩国产经典色站一区二区三区| 中文字幕中文字幕在线一区| 成人国产精品免费观看| 久久婷婷国产综合精品青草| 美女高潮久久久| 精品国产凹凸成av人导航| 天堂影院一区二区| 欧美精品v日韩精品v韩国精品v| 亚洲同性同志一二三专区| 9i看片成人免费高清|