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

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

?? vdbemem.c

?? sqlite庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** 2004 May 26**** 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 code use to manipulate "Mem" structure.  A "Mem"** stores a single value in the VDBE.  Mem is an opaque structure visible** only within the VDBE.  Interface routines refer to a Mem using the** name sqlite_value*/#include "sqliteInt.h"#include "os.h"#include <ctype.h>#include "vdbeInt.h"/*** If pMem is an object with a valid string representation, this routine** ensures the internal encoding for the string representation is** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.**** If pMem is not a string object, or the encoding of the string** representation is already stored using the requested encoding, then this** routine is a no-op.**** SQLITE_OK is returned if the conversion is successful (or not required).** SQLITE_NOMEM may be returned if a malloc() fails during conversion** between formats.*/int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){  int rc;  if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){    return SQLITE_OK;  }#ifdef SQLITE_OMIT_UTF16  return SQLITE_ERROR;#else  /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned,  ** then the encoding of the value may not have changed.  */  rc = sqlite3VdbeMemTranslate(pMem, desiredEnc);  assert(rc==SQLITE_OK    || rc==SQLITE_NOMEM);  assert(rc==SQLITE_OK    || pMem->enc!=desiredEnc);  assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);  if( rc==SQLITE_NOMEM ){/*    sqlite3VdbeMemRelease(pMem);    pMem->flags = MEM_Null;    pMem->z = 0;*/  }  return rc;#endif}/*** Make the given Mem object MEM_Dyn.**** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.*/int sqlite3VdbeMemDynamicify(Mem *pMem){  int n = pMem->n;  u8 *z;  if( (pMem->flags & (MEM_Ephem|MEM_Static|MEM_Short))==0 ){    return SQLITE_OK;  }  assert( (pMem->flags & MEM_Dyn)==0 );  assert( pMem->flags & (MEM_Str|MEM_Blob) );  z = sqliteMallocRaw( n+2 );  if( z==0 ){    return SQLITE_NOMEM;  }  pMem->flags |= MEM_Dyn|MEM_Term;  pMem->xDel = 0;  memcpy(z, pMem->z, n );  z[n] = 0;  z[n+1] = 0;  pMem->z = (char*)z;  pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short);  return SQLITE_OK;}/*** Make the given Mem object either MEM_Short or MEM_Dyn so that bytes** of the Mem.z[] array can be modified.**** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.*/int sqlite3VdbeMemMakeWriteable(Mem *pMem){  int n;  u8 *z;  if( (pMem->flags & (MEM_Ephem|MEM_Static))==0 ){    return SQLITE_OK;  }  assert( (pMem->flags & MEM_Dyn)==0 );  assert( pMem->flags & (MEM_Str|MEM_Blob) );  if( (n = pMem->n)+2<sizeof(pMem->zShort) ){    z = (u8*)pMem->zShort;    pMem->flags |= MEM_Short|MEM_Term;  }else{    z = sqliteMallocRaw( n+2 );    if( z==0 ){      return SQLITE_NOMEM;    }    pMem->flags |= MEM_Dyn|MEM_Term;    pMem->xDel = 0;  }  memcpy(z, pMem->z, n );  z[n] = 0;  z[n+1] = 0;  pMem->z = (char*)z;  pMem->flags &= ~(MEM_Ephem|MEM_Static);  assert(0==(1&(int)pMem->z));  return SQLITE_OK;}/*** Make sure the given Mem is \u0000 terminated.*/int sqlite3VdbeMemNulTerminate(Mem *pMem){  /* In SQLite, a string without a nul terminator occurs when a string  ** is loaded from disk (in this case the memory management is ephemeral),  ** or when it is supplied by the user as a bound variable or function  ** return value. Therefore, the memory management of the string must be  ** either ephemeral, static or controlled by a user-supplied destructor.  */  assert(                             !(pMem->flags&MEM_Str) ||                /* it's not a string, or      */    (pMem->flags&MEM_Term) ||                /* it's nul term. already, or */    (pMem->flags&(MEM_Ephem|MEM_Static)) ||  /* it's static or ephem, or   */    (pMem->flags&MEM_Dyn && pMem->xDel)      /* external management        */  );  if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){    return SQLITE_OK;   /* Nothing to do */  }  if( pMem->flags & (MEM_Static|MEM_Ephem) ){    return sqlite3VdbeMemMakeWriteable(pMem);  }else{    char *z = sqliteMalloc(pMem->n+2);    if( !z ) return SQLITE_NOMEM;    memcpy(z, pMem->z, pMem->n);    z[pMem->n] = 0;    z[pMem->n+1] = 0;    pMem->xDel(pMem->z);    pMem->xDel = 0;    pMem->z = z;  }  return SQLITE_OK;}/*** Add MEM_Str to the set of representations for the given Mem.  Numbers** are converted using sqlite3_snprintf().  Converting a BLOB to a string** is a no-op.**** Existing representations MEM_Int and MEM_Real are *not* invalidated.**** A MEM_Null value will never be passed to this function. This function is** used for converting values to text for returning to the user (i.e. via** sqlite3_value_text()), or for ensuring that values to be used as btree** keys are strings. In the former case a NULL pointer is returned the** user and the later is an internal programming error.*/int sqlite3VdbeMemStringify(Mem *pMem, int enc){  int rc = SQLITE_OK;  int fg = pMem->flags;  char *z = pMem->zShort;  assert( !(fg&(MEM_Str|MEM_Blob)) );  assert( fg&(MEM_Int|MEM_Real) );  /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8  ** string representation of the value. Then, if the required encoding  ** is UTF-16le or UTF-16be do a translation.  **   ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16.  */  if( fg & MEM_Int ){    sqlite3_snprintf(NBFS, z, "%lld", pMem->i);  }else{    assert( fg & MEM_Real );    sqlite3_snprintf(NBFS, z, "%!.15g", pMem->r);  }  pMem->n = strlen(z);  pMem->z = z;  pMem->enc = SQLITE_UTF8;  pMem->flags |= MEM_Str | MEM_Short | MEM_Term;  sqlite3VdbeChangeEncoding(pMem, enc);  return rc;}/*** Memory cell pMem contains the context of an aggregate function.** This routine calls the finalize method for that function.  The** result of the aggregate is stored back into pMem.**** Return SQLITE_ERROR if the finalizer reports an error.  SQLITE_OK** otherwise.*/int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){  int rc = SQLITE_OK;  if( pFunc && pFunc->xFinalize ){    sqlite3_context ctx;    assert( (pMem->flags & MEM_Null)!=0 || pFunc==*(FuncDef**)&pMem->i );    ctx.s.flags = MEM_Null;    ctx.s.z = pMem->zShort;    ctx.pMem = pMem;    ctx.pFunc = pFunc;    ctx.isError = 0;    pFunc->xFinalize(&ctx);    if( pMem->z && pMem->z!=pMem->zShort ){      sqliteFree( pMem->z );    }    *pMem = ctx.s;    if( pMem->flags & MEM_Short ){      pMem->z = pMem->zShort;    }    if( ctx.isError ){      rc = SQLITE_ERROR;    }  }  return rc;}/*** Release any memory held by the Mem. This may leave the Mem in an** inconsistent state, for example with (Mem.z==0) and** (Mem.type==SQLITE_TEXT).*/void sqlite3VdbeMemRelease(Mem *p){  if( p->flags & (MEM_Dyn|MEM_Agg) ){    if( p->xDel ){      if( p->flags & MEM_Agg ){        sqlite3VdbeMemFinalize(p, *(FuncDef**)&p->i);        assert( (p->flags & MEM_Agg)==0 );        sqlite3VdbeMemRelease(p);      }else{        p->xDel((void *)p->z);      }    }else{      sqliteFree(p->z);    }    p->z = 0;    p->xDel = 0;  }}/*** Return some kind of integer value which is the best we can do** at representing the value that *pMem describes as an integer.** If pMem is an integer, then the value is exact.  If pMem is** a floating-point then the value returned is the integer part.** If pMem is a string or blob, then we make an attempt to convert** it into a integer and return that.  If pMem is NULL, return 0.**** If pMem is a string, its encoding might be changed.*/i64 sqlite3VdbeIntValue(Mem *pMem){  int flags = pMem->flags;  if( flags & MEM_Int ){    return pMem->i;  }else if( flags & MEM_Real ){    return (i64)pMem->r;  }else if( flags & (MEM_Str|MEM_Blob) ){    i64 value;    if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)       || sqlite3VdbeMemNulTerminate(pMem) ){      return 0;    }    assert( pMem->z );    sqlite3atoi64(pMem->z, &value);    return value;  }else{    return 0;  }}/*** Return the best representation of pMem that we can get into a** double.  If pMem is already a double or an integer, return its** value.  If it is a string or blob, try to convert it to a double.** If it is a NULL, return 0.0.*/double sqlite3VdbeRealValue(Mem *pMem){  if( pMem->flags & MEM_Real ){    return pMem->r;  }else if( pMem->flags & MEM_Int ){    return (double)pMem->i;  }else if( pMem->flags & (MEM_Str|MEM_Blob) ){    double val = 0.0;    if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)       || sqlite3VdbeMemNulTerminate(pMem) ){      return 0.0;    }    assert( pMem->z );    sqlite3AtoF(pMem->z, &val);    return val;  }else{    return 0.0;  }}/*** The MEM structure is already a MEM_Real.  Try to also make it a** MEM_Int if we can.*/void sqlite3VdbeIntegerAffinity(Mem *pMem){  assert( pMem->flags & MEM_Real );  pMem->i = pMem->r;  if( ((double)pMem->i)==pMem->r ){    pMem->flags |= MEM_Int;  }}/*** Convert pMem to type integer.  Invalidate any prior representations.*/int sqlite3VdbeMemIntegerify(Mem *pMem){  pMem->i = sqlite3VdbeIntValue(pMem);  sqlite3VdbeMemRelease(pMem);  pMem->flags = MEM_Int;  return SQLITE_OK;}/*** Convert pMem so that it is of type MEM_Real.** Invalidate any prior representations.*/int sqlite3VdbeMemRealify(Mem *pMem){  pMem->r = sqlite3VdbeRealValue(pMem);  sqlite3VdbeMemRelease(pMem);  pMem->flags = MEM_Real;  return SQLITE_OK;}/*** Convert pMem so that it has types MEM_Real or MEM_Int or both.** Invalidate any prior representations.*/int sqlite3VdbeMemNumerify(Mem *pMem){  sqlite3VdbeMemRealify(pMem);  sqlite3VdbeIntegerAffinity(pMem);  return SQLITE_OK;}/*** Delete any previous value and set the value stored in *pMem to NULL.*/void sqlite3VdbeMemSetNull(Mem *pMem){  sqlite3VdbeMemRelease(pMem);  pMem->flags = MEM_Null;  pMem->type = SQLITE_NULL;  pMem->n = 0;}/*** Delete any previous value and set the value stored in *pMem to val,** manifest type INTEGER.*/void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){  sqlite3VdbeMemRelease(pMem);  pMem->i = val;  pMem->flags = MEM_Int;  pMem->type = SQLITE_INTEGER;}/*** Delete any previous value and set the value stored in *pMem to val,** manifest type REAL.*/void sqlite3VdbeMemSetDouble(Mem *pMem, double val){  sqlite3VdbeMemRelease(pMem);  pMem->r = val;  pMem->flags = MEM_Real;  pMem->type = SQLITE_FLOAT;}/*** Make an shallow copy of pFrom into pTo.  Prior contents of** pTo are overwritten.  The pFrom->z field is not duplicated.  If** pFrom->z is used, then pTo->z points to the same thing as pFrom->z** and flags gets srcType (either MEM_Ephem or MEM_Static).*/void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){  memcpy(pTo, pFrom, sizeof(*pFrom)-sizeof(pFrom->zShort));  pTo->xDel = 0;  if( pTo->flags & (MEM_Str|MEM_Blob) ){    pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Short|MEM_Ephem);    assert( srcType==MEM_Ephem || srcType==MEM_Static );    pTo->flags |= srcType;  }}/*** Make a full copy of pFrom into pTo.  Prior contents of pTo are** freed before the copy is made.*/int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){  int rc;  if( pTo->flags & MEM_Dyn ){    sqlite3VdbeMemRelease(pTo);  }  sqlite3VdbeMemShallowCopy(pTo, pFrom, MEM_Ephem);  if( pTo->flags & MEM_Ephem ){    rc = sqlite3VdbeMemMakeWriteable(pTo);  }else{    rc = SQLITE_OK;  }  return rc;}/*** Transfer the contents of pFrom to pTo. Any existing value in pTo is** freed. If pFrom contains ephemeral data, a copy is made.**** pFrom contains an SQL NULL when this routine returns.  SQLITE_NOMEM** might be returned if pFrom held ephemeral data and we were unable** to allocate enough space to make a copy.*/int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){  int rc;  if( pTo->flags & MEM_Dyn ){    sqlite3VdbeMemRelease(pTo);  }  memcpy(pTo, pFrom, sizeof(Mem));  if( pFrom->flags & MEM_Short ){    pTo->z = pTo->zShort;  }  pFrom->flags = MEM_Null;  pFrom->xDel = 0;  if( pTo->flags & MEM_Ephem ){    rc = sqlite3VdbeMemMakeWriteable(pTo);  }else{    rc = SQLITE_OK;  }  return rc;}/*** Change the value of a Mem to be a string or a BLOB.*/int sqlite3VdbeMemSetStr(  Mem *pMem,          /* Memory cell to set to string value */  const char *z,      /* String pointer */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久疯狂做爰流白浆xx| 国产精品网站一区| 亚洲二区视频在线| 欧美性高清videossexo| 亚洲主播在线观看| 欧美男男青年gay1069videost| 午夜精品一区二区三区电影天堂 | 精品国产sm最大网站免费看| 久久er99精品| 国产欧美日韩精品一区| 日本精品一区二区三区高清| 亚洲欧美日韩国产一区二区三区| 色综合欧美在线视频区| 天天色综合天天| 精品毛片乱码1区2区3区| 国产精品影视天天线| 最新中文字幕一区二区三区| 在线亚洲一区二区| 精品一区二区三区久久| 国产精品蜜臀av| 9191久久久久久久久久久| 老司机一区二区| 《视频一区视频二区| 91精品久久久久久久99蜜桃 | 婷婷中文字幕一区三区| 精品欧美一区二区三区精品久久| 国产成人精品免费网站| 亚洲精品日韩综合观看成人91| 欧美一级片在线观看| 国产福利视频一区二区三区| 亚洲人成网站影音先锋播放| 欧美军同video69gay| 国产成a人亚洲| 香蕉乱码成人久久天堂爱免费| 精品电影一区二区三区| 92精品国产成人观看免费| 日本在线观看不卡视频| 亚洲国产精品二十页| 欧美日本在线播放| 国产一区二区三区不卡在线观看 | 成人激情av网| 亚洲成va人在线观看| 国产亚洲一区二区在线观看| 欧洲人成人精品| 成人午夜精品一区二区三区| 天堂va蜜桃一区二区三区 | 国产不卡高清在线观看视频| 亚洲午夜在线视频| 国产精品天美传媒沈樵| 日韩欧美不卡一区| 欧美乱妇15p| 91成人看片片| 99精品欧美一区二区蜜桃免费| 日本午夜一区二区| 亚洲国产一区视频| 日韩伦理免费电影| 中文一区二区完整视频在线观看| 日韩欧美国产一区二区三区| 欧美日韩精品一区二区三区蜜桃 | 日韩精品一区二区三区中文精品| 91成人在线观看喷潮| 不卡av免费在线观看| 国内外成人在线| 久久精品国产999大香线蕉| 丝袜脚交一区二区| 亚洲夂夂婷婷色拍ww47| 自拍偷拍亚洲综合| 国产精品理论片| 中国色在线观看另类| 久久伊人中文字幕| 精品sm捆绑视频| 欧美成人乱码一区二区三区| 91精品国产欧美一区二区18| 7878成人国产在线观看| 欧美日本免费一区二区三区| 欧美综合色免费| 欧美影院午夜播放| 欧美四级电影在线观看| 欧美日韩午夜影院| 欧美精品xxxxbbbb| 日韩一区二区三区免费看| 91精品国产色综合久久ai换脸 | 奇米777欧美一区二区| 日韩av中文字幕一区二区| 日韩电影在线免费观看| 日韩电影在线免费| 经典三级在线一区| 国产精品资源站在线| 丁香婷婷综合色啪| 91在线精品一区二区三区| 色婷婷亚洲综合| 欧美老肥妇做.爰bbww| 91精品欧美久久久久久动漫| 日韩免费看的电影| 久久网这里都是精品| 中文久久乱码一区二区| 最新国产成人在线观看| 亚洲一区自拍偷拍| 青青草视频一区| 国产精品自拍一区| 97se亚洲国产综合在线| 欧美三级资源在线| 日韩欧美中文字幕精品| 国产人伦精品一区二区| 亚洲乱码精品一二三四区日韩在线| 亚洲一区二区视频在线观看| 免费在线欧美视频| 国产a视频精品免费观看| 日本高清无吗v一区| 日韩一级免费一区| 欧美韩国日本综合| 亚洲午夜久久久久久久久久久| 麻豆传媒一区二区三区| www.av亚洲| 欧美一区二区三区色| 国产蜜臀97一区二区三区| 亚洲日本va午夜在线影院| 奇米一区二区三区| 不卡av在线网| 日韩一区二区三区视频| ㊣最新国产の精品bt伙计久久| 三级欧美韩日大片在线看| 成人性生交大片免费看视频在线 | 国产大陆a不卡| 日本精品一级二级| 精品国产sm最大网站| 亚洲一区二区欧美激情| 国内不卡的二区三区中文字幕| 91免费观看国产| 日韩精品一区二区三区在线播放 | 色综合一区二区三区| 精品国产一区二区国模嫣然| 亚洲麻豆国产自偷在线| 久久99最新地址| 欧美日韩黄视频| 国产精品传媒视频| 免费成人美女在线观看.| 91麻豆视频网站| 国产日韩欧美精品在线| 日韩国产在线一| 欧美又粗又大又爽| 国产精品女上位| 激情五月激情综合网| 欧美日韩在线精品一区二区三区激情| 久久久久综合网| 理论片日本一区| 3d动漫精品啪啪一区二区竹菊| 亚洲少妇屁股交4| 成人激情小说乱人伦| 精品国产一区二区三区忘忧草| 亚洲1区2区3区视频| 99re这里都是精品| 国产欧美视频在线观看| 黄色小说综合网站| 欧美一区二区三区视频免费| 亚洲第一综合色| 色8久久精品久久久久久蜜| 亚洲色图欧美偷拍| 菠萝蜜视频在线观看一区| 国产日产欧美一区二区三区| 极品少妇一区二区| 精品国产一区二区三区忘忧草| 日本亚洲天堂网| 日韩视频一区在线观看| 奇米影视7777精品一区二区| 欧美一级二级三级蜜桃| 日韩成人一级大片| 日韩一级视频免费观看在线| 蜜桃视频一区二区三区在线观看| 欧美另类一区二区三区| 热久久国产精品| 欧美一级高清大全免费观看| 蜜臀久久久99精品久久久久久| 日韩视频永久免费| 久久er精品视频| 日本一区免费视频| 成人一区二区视频| 中文字幕在线不卡| 91网页版在线| 亚洲一级不卡视频| 欧美日韩国产高清一区二区 | 欧美自拍偷拍午夜视频| 亚洲风情在线资源站| 欧美一区二区三区电影| 裸体歌舞表演一区二区| 久久久久久久久久美女| 国产99久久久国产精品潘金| 中文字幕一区二区三区在线不卡| 91麻豆精品在线观看| 香蕉影视欧美成人| 久久久久久亚洲综合影院红桃| 丁香激情综合国产| 一区二区三区四区av| 欧美丰满美乳xxx高潮www| 麻豆久久一区二区| 欧美激情一区二区三区不卡| 91精彩视频在线| 蜜臀av一区二区| 欧美激情艳妇裸体舞| 欧美精品一卡两卡|