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

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

?? shell.c

?? sqlite 嵌入式數據庫的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*** 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 code to implement the "sqlite" command line** utility for accessing SQLite databases.**** $Id: shell.c,v 1.122 2005/02/23 12:35:41 drh Exp $*/#include <stdlib.h>#include <string.h>#include <stdio.h>#include <assert.h>#include "sqlite3.h"#include <ctype.h>#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__)# include <signal.h># include <pwd.h># include <unistd.h># include <sys/types.h>#endif#ifdef __MACOS__# include <console.h># include <signal.h># include <unistd.h># include <extras.h># include <Files.h># include <Folders.h>#endif#if defined(HAVE_READLINE) && HAVE_READLINE==1# include <readline/readline.h># include <readline/history.h>#else# define readline(p) local_getline(p,stdin)# define add_history(X)# define read_history(X)# define write_history(X)# define stifle_history(X)#endif/* Make sure isatty() has a prototype.*/extern int isatty();/*** The following is the open SQLite database.  We make a pointer** to this database a static variable so that it can be accessed** by the SIGINT handler to interrupt database processing.*/static sqlite3 *db = 0;/*** True if an interrupt (Control-C) has been received.*/static int seenInterrupt = 0;/*** This is the name of our program. It is set in main(), used** in a number of other places, mostly for error messages.*/static char *Argv0;/*** Prompt strings. Initialized in main. Settable with**   .prompt main continue*/static char mainPrompt[20];     /* First line prompt. default: "sqlite> "*/static char continuePrompt[20]; /* Continuation prompt. default: "   ...> " *//*** Determines if a string is a number of not.*/static int isNumber(const unsigned char *z, int *realnum){  if( *z=='-' || *z=='+' ) z++;  if( !isdigit(*z) ){    return 0;  }  z++;  if( realnum ) *realnum = 0;  while( isdigit(*z) ){ z++; }  if( *z=='.' ){    z++;    if( !isdigit(*z) ) return 0;    while( isdigit(*z) ){ z++; }    if( realnum ) *realnum = 1;  }  if( *z=='e' || *z=='E' ){    z++;    if( *z=='+' || *z=='-' ) z++;    if( !isdigit(*z) ) return 0;    while( isdigit(*z) ){ z++; }    if( realnum ) *realnum = 1;  }  return *z==0;}/*** A global char* and an SQL function to access its current value ** from within an SQL statement. This program used to use the ** sqlite_exec_printf() API to substitue a string into an SQL statement.** The correct way to do this with sqlite3 is to use the bind API, but** since the shell is built around the callback paradigm it would be a lot** of work. Instead just use this hack, which is quite harmless.*/static const char *zShellStatic = 0;static void shellstaticFunc(  sqlite3_context *context,  int argc,  sqlite3_value **argv){  assert( 0==argc );  assert( zShellStatic );  sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC);}/*** This routine reads a line of text from FILE in, stores** the text in memory obtained from malloc() and returns a pointer** to the text.  NULL is returned at end of file, or if malloc()** fails.**** The interface is like "readline" but no command-line editing** is done.*/static char *local_getline(char *zPrompt, FILE *in){  char *zLine;  int nLine;  int n;  int eol;  if( zPrompt && *zPrompt ){    printf("%s",zPrompt);    fflush(stdout);  }  nLine = 100;  zLine = malloc( nLine );  if( zLine==0 ) return 0;  n = 0;  eol = 0;  while( !eol ){    if( n+100>nLine ){      nLine = nLine*2 + 100;      zLine = realloc(zLine, nLine);      if( zLine==0 ) return 0;    }    if( fgets(&zLine[n], nLine - n, in)==0 ){      if( n==0 ){        free(zLine);        return 0;      }      zLine[n] = 0;      eol = 1;      break;    }    while( zLine[n] ){ n++; }    if( n>0 && zLine[n-1]=='\n' ){      n--;      zLine[n] = 0;      eol = 1;    }  }  zLine = realloc( zLine, n+1 );  return zLine;}/*** Retrieve a single line of input text.  "isatty" is true if text** is coming from a terminal.  In that case, we issue a prompt and** attempt to use "readline" for command-line editing.  If "isatty"** is false, use "local_getline" instead of "readline" and issue no prompt.**** zPrior is a string of prior text retrieved.  If not the empty** string, then issue a continuation prompt.*/static char *one_input_line(const char *zPrior, FILE *in){  char *zPrompt;  char *zResult;  if( in!=0 ){    return local_getline(0, in);  }  if( zPrior && zPrior[0] ){    zPrompt = continuePrompt;  }else{    zPrompt = mainPrompt;  }  zResult = readline(zPrompt);#if defined(HAVE_READLINE) && HAVE_READLINE==1  if( zResult ) add_history(zResult);#endif  return zResult;}struct previous_mode_data {  int valid;        /* Is there legit data in here? */  int mode;  int showHeader;  int colWidth[100];};/*** An pointer to an instance of this structure is passed from** the main program to the callback.  This is used to communicate** state and mode information.*/struct callback_data {  sqlite3 *db;            /* The database */  int echoOn;            /* True to echo input commands */  int cnt;               /* Number of records displayed so far */  FILE *out;             /* Write results here */  int mode;              /* An output mode setting */  int showHeader;        /* True to show column names in List or Column mode */  char *zDestTable;      /* Name of destination table when MODE_Insert */  char separator[20];    /* Separator character for MODE_List */  int colWidth[100];     /* Requested width of each column when in column mode*/  int actualWidth[100];  /* Actual width of each column */  char nullvalue[20];    /* The text to print when a NULL comes back from                         ** the database */  struct previous_mode_data explainPrev;                         /* Holds the mode information just before                         ** .explain ON */  char outfile[FILENAME_MAX]; /* Filename for *out */  const char *zDbFilename;    /* name of the database file */  char *zKey;                 /* Encryption key */};/*** These are the allowed modes.*/#define MODE_Line     0  /* One column per line.  Blank line between records */#define MODE_Column   1  /* One record per line in neat columns */#define MODE_List     2  /* One record per line with a separator */#define MODE_Semi     3  /* Same as MODE_List but append ";" to each line */#define MODE_Html     4  /* Generate an XHTML table */#define MODE_Insert   5  /* Generate SQL "insert" statements */#define MODE_Tcl      6  /* Generate ANSI-C or TCL quoted elements */#define MODE_Csv      7  /* Quote strings, numbers are plain */#define MODE_NUM_OF   8  /* The number of modes (not a mode itself) */char *modeDescr[MODE_NUM_OF] = {  "line",  "column",  "list",  "semi",  "html",  "insert",  "tcl",  "csv",};/*** Number of elements in an array*/#define ArraySize(X)  (sizeof(X)/sizeof(X[0]))/*** Output the given string as a quoted string using SQL quoting conventions.*/static void output_quoted_string(FILE *out, const char *z){  int i;  int nSingle = 0;  for(i=0; z[i]; i++){    if( z[i]=='\'' ) nSingle++;  }  if( nSingle==0 ){    fprintf(out,"'%s'",z);  }else{    fprintf(out,"'");    while( *z ){      for(i=0; z[i] && z[i]!='\''; i++){}      if( i==0 ){        fprintf(out,"''");        z++;      }else if( z[i]=='\'' ){        fprintf(out,"%.*s''",i,z);        z += i+1;      }else{        fprintf(out,"%s",z);        break;      }    }    fprintf(out,"'");  }}/*** Output the given string as a quoted according to C or TCL quoting rules.*/static void output_c_string(FILE *out, const char *z){  unsigned int c;  fputc('"', out);  while( (c = *(z++))!=0 ){    if( c=='\\' ){      fputc(c, out);      fputc(c, out);    }else if( c=='\t' ){      fputc('\\', out);      fputc('t', out);    }else if( c=='\n' ){      fputc('\\', out);      fputc('n', out);    }else if( c=='\r' ){      fputc('\\', out);      fputc('r', out);    }else if( !isprint(c) ){      fprintf(out, "\\%03o", c);    }else{      fputc(c, out);    }  }  fputc('"', out);}/*** Output the given string with characters that are special to** HTML escaped.*/static void output_html_string(FILE *out, const char *z){  int i;  while( *z ){    for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){}    if( i>0 ){      fprintf(out,"%.*s",i,z);    }    if( z[i]=='<' ){      fprintf(out,"&lt;");    }else if( z[i]=='&' ){      fprintf(out,"&amp;");    }else{      break;    }    z += i + 1;  }}/*** Output a single term of CSV.  Actually, p->separator is used for** the separator, which may or may not be a comma.  p->nullvalue is** the null value.  Strings are quoted using ANSI-C rules.  Numbers** appear outside of quotes.*/static void output_csv(struct callback_data *p, const char *z, int bSep){  if( z==0 ){    fprintf(p->out,"%s",p->nullvalue);  }else if( isNumber(z, 0) ){    fprintf(p->out,"%s",z);  }else{    output_c_string(p->out, z);  }  if( bSep ){    fprintf(p->out, p->separator);  }}#ifdef SIGINT/*** This routine runs when the user presses Ctrl-C*/static void interrupt_handler(int NotUsed){  seenInterrupt = 1;  if( db ) sqlite3_interrupt(db);}#endif/*** This is the callback routine that the SQLite library** invokes for each row of a query result.*/static int callback(void *pArg, int nArg, char **azArg, char **azCol){  int i;  struct callback_data *p = (struct callback_data*)pArg;  switch( p->mode ){    case MODE_Line: {      int w = 5;      if( azArg==0 ) break;      for(i=0; i<nArg; i++){        int len = strlen(azCol[i]);        if( len>w ) w = len;      }      if( p->cnt++>0 ) fprintf(p->out,"\n");      for(i=0; i<nArg; i++){        fprintf(p->out,"%*s = %s\n", w, azCol[i],                 azArg[i] ? azArg[i] : p->nullvalue);      }      break;    }    case MODE_Column: {      if( p->cnt++==0 ){        for(i=0; i<nArg; i++){          int w, n;          if( i<ArraySize(p->colWidth) ){             w = p->colWidth[i];          }else{             w = 0;          }          if( w<=0 ){            w = strlen(azCol[i] ? azCol[i] : "");            if( w<10 ) w = 10;            n = strlen(azArg && azArg[i] ? azArg[i] : p->nullvalue);            if( w<n ) w = n;          }          if( i<ArraySize(p->actualWidth) ){            p->actualWidth[i] = w;          }          if( p->showHeader ){            fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": "  ");          }        }        if( p->showHeader ){          for(i=0; i<nArg; i++){            int w;            if( i<ArraySize(p->actualWidth) ){               w = p->actualWidth[i];            }else{               w = 10;            }            fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------"                   "----------------------------------------------------------",                    i==nArg-1 ? "\n": "  ");          }        }      }      if( azArg==0 ) break;      for(i=0; i<nArg; i++){        int w;        if( i<ArraySize(p->actualWidth) ){           w = p->actualWidth[i];        }else{           w = 10;        }        fprintf(p->out,"%-*.*s%s",w,w,            azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": "  ");      }      break;    }    case MODE_Semi:    case MODE_List: {      if( p->cnt++==0 && p->showHeader ){        for(i=0; i<nArg; i++){          fprintf(p->out,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator);        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三国产精华液| 亚洲一区二区三区四区五区中文 | 国产农村妇女毛片精品久久麻豆| 欧美综合一区二区| av电影在线观看不卡| 国产999精品久久久久久绿帽| 久久精品999| 久久精品国产99| 欧美在线一区二区三区| 久久精品人人做人人综合| 精品福利视频一区二区三区| 日韩午夜激情av| 日韩无一区二区| 亚洲一区二区视频| 成人教育av在线| 91久久精品一区二区三| 欧美日韩一二区| 精品国一区二区三区| 亚洲日本在线a| 一区二区免费视频| av欧美精品.com| 国产欧美日韩麻豆91| 久久99深爱久久99精品| 欧美丰满嫩嫩电影| 精品国产一区二区在线观看| 五月婷婷综合在线| 国内成人精品2018免费看| 国产福利视频一区二区三区| 91免费在线看| 日韩午夜电影av| 免费日本视频一区| 懂色av一区二区三区蜜臀| 日韩精品一区二| 亚洲激情六月丁香| 国产在线不卡视频| 在线精品视频免费播放| 亚洲三级视频在线观看| gogo大胆日本视频一区| 国产精品久久久久久户外露出 | 欧美主播一区二区三区美女| 成人欧美一区二区三区小说 | 亚洲影院免费观看| 在线日韩av片| 午夜视频一区在线观看| 制服丝袜亚洲播放| 中文字幕一区在线观看视频| 丁香一区二区三区| 国产精品久久夜| 91视频免费观看| 亚洲成人av一区| 99精品欧美一区| 久久久久久久久蜜桃| 视频一区中文字幕国产| 成人av资源在线观看| 中文字幕av一区二区三区高| 一区二区三区四区亚洲| 欧美日韩一区视频| 久久99久久精品| 欧美一区二区啪啪| 亚洲第一激情av| 精品精品国产高清a毛片牛牛| 国产精品一品视频| 日韩区在线观看| 国产99久久久国产精品潘金网站| 亚洲日本va在线观看| 欧美日韩一区二区在线视频| 麻豆精品视频在线观看视频| 欧美男生操女生| 亚洲国产美女搞黄色| 91色porny在线视频| 婷婷综合五月天| 国产欧美精品国产国产专区| 在线看国产日韩| 国产毛片精品一区| 亚洲一区二区美女| 久久久久久亚洲综合影院红桃 | 国产精品久久久久久久第一福利| 欧美亚洲一区二区三区四区| 日韩美女视频一区二区| 5858s免费视频成人| 风流少妇一区二区| 日韩 欧美一区二区三区| 7799精品视频| 成人免费视频视频在线观看免费| 中文字幕高清一区| 欧美一级艳片视频免费观看| www.性欧美| 九九视频精品免费| 亚洲国产日韩精品| 自拍av一区二区三区| 精品成人佐山爱一区二区| 在线亚洲一区二区| 成人性生交大片免费看视频在线| 日韩电影在线观看一区| 亚洲欧美色图小说| 欧美三级日韩在线| 97se狠狠狠综合亚洲狠狠| 麻豆精品蜜桃视频网站| 一个色综合网站| 亚洲欧洲av色图| 国产亚洲成aⅴ人片在线观看 | 91老司机福利 在线| 国产精品夜夜嗨| 久久国产视频网| 日韩成人伦理电影在线观看| 亚洲午夜在线电影| 亚洲精品国产a| 综合色天天鬼久久鬼色| 国产目拍亚洲精品99久久精品| 日韩精品中文字幕在线不卡尤物 | 久久99精品网久久| 免费观看一级特黄欧美大片| 亚洲国产精品视频| 亚洲一区二区精品久久av| 亚洲免费在线看| 亚洲靠逼com| 亚洲男帅同性gay1069| 中文欧美字幕免费| 欧美男人的天堂一二区| 欧美在线一区二区| 欧美区在线观看| 555www色欧美视频| 日韩一区二区不卡| 精品国产乱码久久| 久久精品夜夜夜夜久久| 国产欧美一区在线| 成人免费一区二区三区视频| 亚洲色图一区二区三区| 一区二区三区在线视频播放| 亚洲一区二区精品视频| 丝袜美腿亚洲色图| 久久国产人妖系列| 成人午夜视频在线观看| 91网站视频在线观看| 欧美视频一区在线| 日韩欧美电影一区| 欧美国产日本视频| 亚洲永久免费视频| 久久国产尿小便嘘嘘尿| 成人免费毛片片v| 91丨九色丨黑人外教| 在线观看欧美精品| 欧美日韩三级一区二区| 色av综合在线| 日韩欧美一二区| 久久亚洲综合色| 色噜噜狠狠成人中文综合| 日本高清无吗v一区| 日韩欧美一区二区视频| 久久色成人在线| 亚洲欧洲日韩av| 亚洲一区二区三区三| 精品一区二区三区av| 成人永久看片免费视频天堂| 成人在线视频一区二区| 91视频com| 在线观看不卡一区| 久久综合av免费| 亚洲色图在线播放| 亚洲高清久久久| 韩国一区二区三区| 99久久综合精品| 欧美人伦禁忌dvd放荡欲情| 国产三级一区二区| 一区二区国产视频| 久久精品99国产精品日本| 成人美女在线观看| 精品久久久久av影院| 国产精品不卡在线观看| 婷婷一区二区三区| 成人午夜激情视频| 日韩美女天天操| 中文字幕亚洲不卡| 蜜桃视频在线一区| 99久久久久免费精品国产 | 成人av网站免费| 欧美久久一区二区| 久久精品视频一区二区| 亚洲日本在线看| 成人黄色在线视频| 4438x亚洲最大成人网| 国产精品久久久久国产精品日日| 一区二区三区蜜桃| 成人av在线播放网址| 欧美成人精品二区三区99精品| 亚洲桃色在线一区| 久久成人免费网站| 日韩一区二区三区高清免费看看| 国产精品传媒入口麻豆| 精品一区二区三区久久| 国产成人精品免费| 国产亚洲精品免费| 看电视剧不卡顿的网站| 欧美揉bbbbb揉bbbbb| 亚洲综合男人的天堂| 粉嫩av亚洲一区二区图片| 欧美成人一级视频| 婷婷开心激情综合| 5858s免费视频成人| 亚洲一区二区三区四区五区黄|