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

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

?? table.c

?? sqlite 3.3.8 支持加密的版本
?? C
字號:
/*
** 2001 September 15
**
** 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 the sqlite3_get_table() and sqlite3_free_table()
** interface routines.  These are just wrappers around the main
** interface routine of sqlite3_exec().
**
** These routines are in a separate files so that they will not be linked
** if they are not used.
*/
#include "sqliteInt.h"
#include <stdlib.h>
#include <string.h>

#ifndef SQLITE_OMIT_GET_TABLE

/*
** This structure is used to pass data from sqlite3_get_table() through
** to the callback function is uses to build the result.
*/
typedef struct TabResult {
  char **azResult;
  char *zErrMsg;
  int nResult;
  int nAlloc;
  int nRow;
  int nColumn;
  int nData;
  int rc;
} TabResult;

/*
** This routine is called once for each row in the result table.  Its job
** is to fill in the TabResult structure appropriately, allocating new
** memory as necessary.
*/
static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
  TabResult *p = (TabResult*)pArg;
  int need;
  int i;
  char *z;

  /* Make sure there is enough space in p->azResult to hold everything
  ** we need to remember from this invocation of the callback.
  */
  if( p->nRow==0 && argv!=0 ){
    need = nCol*2;
  }else{
    need = nCol;
  }
  if( p->nData + need >= p->nAlloc ){
    char **azNew;
    p->nAlloc = p->nAlloc*2 + need + 1;
    azNew = sqlite3_realloc( p->azResult, sizeof(char*)*p->nAlloc );
    if( azNew==0 ) goto malloc_failed;
    p->azResult = azNew;
  }

  /* If this is the first row, then generate an extra row containing
  ** the names of all columns.
  */
  if( p->nRow==0 ){
    p->nColumn = nCol;
    for(i=0; i<nCol; i++){
      if( colv[i]==0 ){
        z = sqlite3_mprintf("");
      }else{
        z = sqlite3_mprintf("%s", colv[i]);
      }
      p->azResult[p->nData++] = z;
    }
  }else if( p->nColumn!=nCol ){
    sqlite3SetString(&p->zErrMsg,
       "sqlite3_get_table() called with two or more incompatible queries",
       (char*)0);
    p->rc = SQLITE_ERROR;
    return 1;
  }

  /* Copy over the row data
  */
  if( argv!=0 ){
    for(i=0; i<nCol; i++){
      if( argv[i]==0 ){
        z = 0;
      }else{
        z = sqlite3_malloc( strlen(argv[i])+1 );
        if( z==0 ) goto malloc_failed;
        strcpy(z, argv[i]);
      }
      p->azResult[p->nData++] = z;
    }
    p->nRow++;
  }
  return 0;

malloc_failed:
  p->rc = SQLITE_NOMEM;
  return 1;
}

/*
** Query the database.  But instead of invoking a callback for each row,
** malloc() for space to hold the result and return the entire results
** at the conclusion of the call.
**
** The result that is written to ***pazResult is held in memory obtained
** from malloc().  But the caller cannot free this memory directly.  
** Instead, the entire table should be passed to sqlite3_free_table() when
** the calling procedure is finished using it.
*/
int sqlite3_get_table(
  sqlite3 *db,                /* The database on which the SQL executes */
  const char *zSql,           /* The SQL to be executed */
  char ***pazResult,          /* Write the result table here */
  int *pnRow,                 /* Write the number of rows in the result here */
  int *pnColumn,              /* Write the number of columns of result here */
  char **pzErrMsg             /* Write error messages here */
){
  int rc;
  TabResult res;
  if( pazResult==0 ){ return SQLITE_ERROR; }
  *pazResult = 0;
  if( pnColumn ) *pnColumn = 0;
  if( pnRow ) *pnRow = 0;
  res.zErrMsg = 0;
  res.nResult = 0;
  res.nRow = 0;
  res.nColumn = 0;
  res.nData = 1;
  res.nAlloc = 20;
  res.rc = SQLITE_OK;
  res.azResult = sqlite3_malloc( sizeof(char*)*res.nAlloc );
  if( res.azResult==0 ) return SQLITE_NOMEM;
  res.azResult[0] = 0;
  rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
  if( res.azResult ){
    assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
    res.azResult[0] = (char*)res.nData;
  }
  if( (rc&0xff)==SQLITE_ABORT ){
    sqlite3_free_table(&res.azResult[1]);
    if( res.zErrMsg ){
      if( pzErrMsg ){
        sqlite3_free(*pzErrMsg);
        *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg);
      }
      sqliteFree(res.zErrMsg);
    }
    db->errCode = res.rc;
    return res.rc & db->errMask;
  }
  sqliteFree(res.zErrMsg);
  if( rc!=SQLITE_OK ){
    sqlite3_free_table(&res.azResult[1]);
    return rc & db->errMask;
  }
  if( res.nAlloc>res.nData ){
    char **azNew;
    azNew = sqlite3_realloc( res.azResult, sizeof(char*)*(res.nData+1) );
    if( azNew==0 ){
      sqlite3_free_table(&res.azResult[1]);
      return SQLITE_NOMEM;
    }
    res.nAlloc = res.nData+1;
    res.azResult = azNew;
  }
  *pazResult = &res.azResult[1];
  if( pnColumn ) *pnColumn = res.nColumn;
  if( pnRow ) *pnRow = res.nRow;
  return rc & db->errMask;
}

/*
** This routine frees the space the sqlite3_get_table() malloced.
*/
void sqlite3_free_table(
  char **azResult            /* Result returned from from sqlite3_get_table() */
){
  if( azResult ){
    int i, n;
    azResult--;
    if( azResult==0 ) return;
    n = (int)azResult[0];
    for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }
    sqlite3_free(azResult);
  }
}

#endif /* SQLITE_OMIT_GET_TABLE */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美激情四射| 国产精品护士白丝一区av| 欧美视频一区二区三区四区 | 成人av在线资源网站| 日本va欧美va欧美va精品| 无码av免费一区二区三区试看 | 亚洲午夜久久久久中文字幕久| 中文字幕在线不卡一区| 国产精品色呦呦| 欧美国产日本视频| 国产精品每日更新在线播放网址| 中文在线资源观看网站视频免费不卡| 国产午夜一区二区三区| 欧美国产激情一区二区三区蜜月 | 免费一级欧美片在线观看| 日日夜夜精品视频天天综合网| 亚洲黄色小说网站| 亚洲国产精品尤物yw在线观看| 五月天中文字幕一区二区| 午夜精品福利久久久| 日韩制服丝袜av| 久久av资源站| 成人午夜在线播放| 色综合视频在线观看| 欧美高清视频一二三区 | 99精品久久免费看蜜臀剧情介绍| 91老司机福利 在线| 欧美日韩国产中文| 91精品国产综合久久国产大片| 91精品国产91热久久久做人人| 欧美成人高清电影在线| 日本一区二区成人| 一区二区三区欧美视频| 免费成人性网站| 国产成人鲁色资源国产91色综 | 久久久久久免费| 国产精品美女久久久久久久久久久| 一区二区三区鲁丝不卡| 日本中文字幕不卡| 国产成人在线网站| 在线亚洲欧美专区二区| 日韩女优av电影| 国产日韩欧美激情| 中文字幕乱码一区二区免费| 中文字幕av一区 二区| 国产日韩欧美制服另类| 国产精品成人一区二区三区夜夜夜| 中文子幕无线码一区tr| 亚洲精品视频在线观看网站| 亚洲va欧美va国产va天堂影院| 欧美美女一区二区| 国产午夜精品福利| 亚洲一区二区av电影| 国内精品在线播放| 欧美亚洲国产一区二区三区| 精品国产不卡一区二区三区| 亚洲人成伊人成综合网小说| 卡一卡二国产精品| 色综合久久久久综合体桃花网| 精品久久久久久综合日本欧美| 亚洲欧美日本韩国| 国产美女视频一区| 欧美日韩免费观看一区二区三区 | 国产成人av一区二区三区在线观看| 日本道免费精品一区二区三区| 精品奇米国产一区二区三区| 亚洲激情五月婷婷| 国产精品一卡二卡在线观看| 777亚洲妇女| 亚洲精品高清视频在线观看| 国产自产高清不卡| 欧美人伦禁忌dvd放荡欲情| 国产精品视频一二三| 免费在线观看不卡| 欧美午夜宅男影院| 中文字幕日韩一区| 国产福利一区二区三区在线视频| 欧美精品在线一区二区三区| 亚洲女同女同女同女同女同69| 国产精品一区二区视频| 欧美伦理视频网站| 一区二区成人在线| 不卡一区中文字幕| 国产日产欧美精品一区二区三区| 日本女人一区二区三区| 欧美综合色免费| 亚洲激情自拍偷拍| 色综合欧美在线| 国产精品国产三级国产aⅴ无密码| 国产精品自在在线| 精品捆绑美女sm三区| 日韩和欧美一区二区三区| 欧美三级资源在线| 有坂深雪av一区二区精品| 91在线观看免费视频| 欧美激情资源网| 国产成人免费9x9x人网站视频| 337p日本欧洲亚洲大胆色噜噜| 青娱乐精品视频在线| 9191久久久久久久久久久| 亚洲一区二区视频| 色偷偷88欧美精品久久久| 亚洲欧洲日本在线| 成年人网站91| 1000精品久久久久久久久| 国产成人在线视频网站| 久久综合九色综合欧美98| 国产一区二三区| 久久精品日产第一区二区三区高清版| 裸体歌舞表演一区二区| 欧美电视剧在线观看完整版| 蜜臀av性久久久久av蜜臀妖精 | 一区二区三区四区高清精品免费观看| 免费欧美高清视频| 97国产一区二区| 亚洲色欲色欲www| 91成人看片片| 亚洲国产精品欧美一二99| 欧美私人免费视频| 午夜伊人狠狠久久| 欧美一区二区三区在线电影| 免费三级欧美电影| 亚洲精品一区二区三区在线观看 | 成人av小说网| 一区二区三区在线免费播放| 精品视频在线免费看| 免费观看一级特黄欧美大片| 精品av综合导航| 成人永久看片免费视频天堂| 综合婷婷亚洲小说| 欧美自拍偷拍一区| 青娱乐精品视频| 欧美激情在线观看视频免费| 91美女在线视频| 日产国产高清一区二区三区| 国产丝袜美腿一区二区三区| 成人性生交大合| 亚洲成a人片综合在线| 精品国产三级电影在线观看| 国产91精品在线观看| 一区二区三国产精华液| 日韩免费在线观看| kk眼镜猥琐国模调教系列一区二区 | 欧美一级久久久| 国产精品综合网| 一区二区三区在线免费观看| 日韩精品一区二区三区蜜臀| 成人免费黄色在线| 亚洲不卡一区二区三区| 精品国一区二区三区| 99久久er热在这里只有精品66| 亚洲不卡一区二区三区| 国产日韩在线不卡| 精品视频一区 二区 三区| 国产在线播放一区二区三区| 一个色妞综合视频在线观看| 亚洲精品一区在线观看| 日本韩国精品在线| 韩国三级中文字幕hd久久精品| 亚洲色图视频网| 欧美精品一区二区三区四区| 91黄色激情网站| 国产成人高清视频| 日韩在线一区二区三区| 亚洲欧洲日产国码二区| 精品毛片乱码1区2区3区| 色哟哟一区二区| 国产精品中文有码| 日韩制服丝袜av| 亚洲免费三区一区二区| 久久久久久久性| 777奇米成人网| 成人激情小说网站| 蜜桃视频一区二区三区在线观看| 《视频一区视频二区| 久久婷婷一区二区三区| 欧美久久一二三四区| 一本大道久久a久久综合婷婷 | 91福利视频网站| 国产99久久久久| 乱中年女人伦av一区二区| 亚洲一区欧美一区| 国产精品久久午夜夜伦鲁鲁| 欧美一级一级性生活免费录像| 欧美亚一区二区| 91小视频在线| 国产成人在线免费观看| 免费不卡在线视频| 亚洲国产va精品久久久不卡综合| 国产精品国产馆在线真实露脸| 亚洲精品一区二区在线观看| 91精品国产综合久久久蜜臀图片| 日本韩国欧美国产| 91麻豆福利精品推荐| 成人一级片在线观看| 国产乱人伦偷精品视频免下载 | 国产精品18久久久久| 麻豆国产精品一区二区三区| 日本亚洲天堂网| jiyouzz国产精品久久|